mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-22 06:17:47 +00:00
Update settings.component.spec.ts
This commit is contained in:
parent
cf2f0e3110
commit
748997c635
@ -23,6 +23,7 @@ describe('SettingsComponent', () => {
|
|||||||
let mapSettingsService = {
|
let mapSettingsService = {
|
||||||
integrateLinkLabelsToLinks: true,
|
integrateLinkLabelsToLinks: true,
|
||||||
toggleIntegrateInterfaceLabels(val: boolean) {},
|
toggleIntegrateInterfaceLabels(val: boolean) {},
|
||||||
|
toggleOpenConsolesInWidget(val: boolean) {}
|
||||||
};
|
};
|
||||||
let consoleService;
|
let consoleService;
|
||||||
let updatesService = autoSpy(UpdatesService);
|
let updatesService = autoSpy(UpdatesService);
|
||||||
@ -75,11 +76,19 @@ describe('SettingsComponent', () => {
|
|||||||
};
|
};
|
||||||
const getAll = spyOn(settingsService, 'getAll').and.returnValue(settings);
|
const getAll = spyOn(settingsService, 'getAll').and.returnValue(settings);
|
||||||
const setAll = spyOn(settingsService, 'setAll');
|
const setAll = spyOn(settingsService, 'setAll');
|
||||||
|
spyOn(mapSettingsService, 'toggleIntegrateInterfaceLabels');
|
||||||
|
spyOn(mapSettingsService, 'toggleOpenConsolesInWidget');
|
||||||
|
|
||||||
component.ngOnInit();
|
component.ngOnInit();
|
||||||
|
|
||||||
expect(getAll).toHaveBeenCalled();
|
expect(getAll).toHaveBeenCalled();
|
||||||
expect(component.settings).toEqual(settings);
|
expect(component.settings).toEqual(settings);
|
||||||
|
|
||||||
component.settings.crash_reports = false;
|
component.settings.crash_reports = false;
|
||||||
component.save();
|
component.save();
|
||||||
|
|
||||||
expect(setAll).toHaveBeenCalledWith(settings);
|
expect(setAll).toHaveBeenCalledWith(settings);
|
||||||
|
expect(mapSettingsService.toggleIntegrateInterfaceLabels).toHaveBeenCalled();
|
||||||
|
expect(mapSettingsService.toggleOpenConsolesInWidget).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user