Update settings.component.spec.ts

This commit is contained in:
piotrpekala7 2021-05-11 18:16:20 +02:00
parent cf2f0e3110
commit 748997c635

View File

@ -23,6 +23,7 @@ describe('SettingsComponent', () => {
let mapSettingsService = {
integrateLinkLabelsToLinks: true,
toggleIntegrateInterfaceLabels(val: boolean) {},
toggleOpenConsolesInWidget(val: boolean) {}
};
let consoleService;
let updatesService = autoSpy(UpdatesService);
@ -75,11 +76,19 @@ describe('SettingsComponent', () => {
};
const getAll = spyOn(settingsService, 'getAll').and.returnValue(settings);
const setAll = spyOn(settingsService, 'setAll');
spyOn(mapSettingsService, 'toggleIntegrateInterfaceLabels');
spyOn(mapSettingsService, 'toggleOpenConsolesInWidget');
component.ngOnInit();
expect(getAll).toHaveBeenCalled();
expect(component.settings).toEqual(settings);
component.settings.crash_reports = false;
component.save();
expect(setAll).toHaveBeenCalledWith(settings);
expect(mapSettingsService.toggleIntegrateInterfaceLabels).toHaveBeenCalled();
expect(mapSettingsService.toggleOpenConsolesInWidget).toHaveBeenCalled();
});
});