mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-30 01:38:50 +00:00
unit test cases for lock/unlock
This commit is contained in:
parent
0c0d27fd6e
commit
872ebdae09
@ -25,7 +25,7 @@ import { NodesDataSource } from '../../../cartography/datasources/nodes-datasour
|
||||
import { DrawingsEventSource } from '../../../cartography/events/drawings-event-source';
|
||||
import { DrawingsDataSource } from '../../../cartography/datasources/drawings-datasource';
|
||||
|
||||
fdescribe('ProjectMapMenuComponent', () => {
|
||||
describe('ProjectMapMenuComponent', () => {
|
||||
let component: ProjectMapMenuComponent;
|
||||
let fixture: ComponentFixture<ProjectMapMenuComponent>;
|
||||
let drawingService = new MockedDrawingService();
|
||||
@ -94,9 +94,9 @@ fdescribe('ProjectMapMenuComponent', () => {
|
||||
spyOn(mapSettingService, 'changeMapLockValue');
|
||||
|
||||
component.changeLockValue();
|
||||
expect(mapSettingService.changeMapLockValue).toHaveBeenCalled();
|
||||
expect(mapSettingService.changeMapLockValue).toHaveBeenCalledWith(true);;
|
||||
|
||||
component.changeLockValue();
|
||||
expect(mapSettingService.changeMapLockValue).toHaveBeenCalled();
|
||||
expect(mapSettingService.changeMapLockValue).toHaveBeenCalledWith(false);;
|
||||
});
|
||||
});
|
||||
|
@ -210,6 +210,7 @@ export class ProjectMapMenuComponent implements OnInit, OnDestroy {
|
||||
|
||||
public changeLockValue() {
|
||||
this.isLocked = !this.isLocked;
|
||||
this.mapSettingsService.changeMapLockValue(this.isLocked);
|
||||
const dialogRef = this.dialog.open(ProjectMapLockConfirmationDialogComponent, {
|
||||
width: '500px',
|
||||
maxHeight: '200px',
|
||||
@ -225,7 +226,6 @@ export class ProjectMapMenuComponent implements OnInit, OnDestroy {
|
||||
} else {
|
||||
this.unlockAllNode();
|
||||
}
|
||||
this.mapSettingsService.changeMapLockValue(this.isLocked);
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user