mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-02 02:56:42 +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 { DrawingsEventSource } from '../../../cartography/events/drawings-event-source';
|
||||||
import { DrawingsDataSource } from '../../../cartography/datasources/drawings-datasource';
|
import { DrawingsDataSource } from '../../../cartography/datasources/drawings-datasource';
|
||||||
|
|
||||||
fdescribe('ProjectMapMenuComponent', () => {
|
describe('ProjectMapMenuComponent', () => {
|
||||||
let component: ProjectMapMenuComponent;
|
let component: ProjectMapMenuComponent;
|
||||||
let fixture: ComponentFixture<ProjectMapMenuComponent>;
|
let fixture: ComponentFixture<ProjectMapMenuComponent>;
|
||||||
let drawingService = new MockedDrawingService();
|
let drawingService = new MockedDrawingService();
|
||||||
@ -94,9 +94,9 @@ fdescribe('ProjectMapMenuComponent', () => {
|
|||||||
spyOn(mapSettingService, 'changeMapLockValue');
|
spyOn(mapSettingService, 'changeMapLockValue');
|
||||||
|
|
||||||
component.changeLockValue();
|
component.changeLockValue();
|
||||||
expect(mapSettingService.changeMapLockValue).toHaveBeenCalled();
|
expect(mapSettingService.changeMapLockValue).toHaveBeenCalledWith(true);;
|
||||||
|
|
||||||
component.changeLockValue();
|
component.changeLockValue();
|
||||||
expect(mapSettingService.changeMapLockValue).toHaveBeenCalled();
|
expect(mapSettingService.changeMapLockValue).toHaveBeenCalledWith(false);;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -210,6 +210,7 @@ export class ProjectMapMenuComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
public changeLockValue() {
|
public changeLockValue() {
|
||||||
this.isLocked = !this.isLocked;
|
this.isLocked = !this.isLocked;
|
||||||
|
this.mapSettingsService.changeMapLockValue(this.isLocked);
|
||||||
const dialogRef = this.dialog.open(ProjectMapLockConfirmationDialogComponent, {
|
const dialogRef = this.dialog.open(ProjectMapLockConfirmationDialogComponent, {
|
||||||
width: '500px',
|
width: '500px',
|
||||||
maxHeight: '200px',
|
maxHeight: '200px',
|
||||||
@ -225,7 +226,6 @@ export class ProjectMapMenuComponent implements OnInit, OnDestroy {
|
|||||||
} else {
|
} else {
|
||||||
this.unlockAllNode();
|
this.unlockAllNode();
|
||||||
}
|
}
|
||||||
this.mapSettingsService.changeMapLockValue(this.isLocked);
|
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user