Tests added

This commit is contained in:
Piotr Pekala 2019-06-24 06:44:51 -07:00
parent b4bbd97a40
commit 6dbce19481

View File

@ -185,6 +185,7 @@ describe('ProjectMapComponent', () => {
let nodesDataSource = new MockedNodesDataSource(); let nodesDataSource = new MockedNodesDataSource();
let linksDataSource = new MockedLinksDataSource(); let linksDataSource = new MockedLinksDataSource();
let nodeCreatedLabelStylesFixer; let nodeCreatedLabelStylesFixer;
let mapSettingService = new MapSettingService();
beforeEach(async(() => { beforeEach(async(() => {
nodeCreatedLabelStylesFixer = { nodeCreatedLabelStylesFixer = {
@ -222,7 +223,7 @@ describe('ProjectMapComponent', () => {
useClass: RecentlyOpenedProjectService useClass: RecentlyOpenedProjectService
}, },
{ provide: NodeCreatedLabelStylesFixer, useValue: nodeCreatedLabelStylesFixer}, { provide: NodeCreatedLabelStylesFixer, useValue: nodeCreatedLabelStylesFixer},
{ provide: MapSettingService } { provide: MapSettingService, useValue: mapSettingService }
], ],
declarations: [ProjectMapComponent, D3MapComponent, ...ANGULAR_MAP_DECLARATIONS], declarations: [ProjectMapComponent, D3MapComponent, ...ANGULAR_MAP_DECLARATIONS],
schemas: [NO_ERRORS_SCHEMA] schemas: [NO_ERRORS_SCHEMA]
@ -261,4 +262,12 @@ describe('ProjectMapComponent', () => {
expect(component.resetDrawToolChoice).toHaveBeenCalled(); expect(component.resetDrawToolChoice).toHaveBeenCalled();
}); });
it('should call map settings service when lock value was changed', () => {
spyOn(mapSettingService, 'changeMapLockValue');
component.changeLockValue();
expect(mapSettingService.changeMapLockValue).toHaveBeenCalled();
});
}); });