diff --git a/src/app/services/default-config-service.spec.ts b/src/app/services/default-config-service.spec.ts index 2bf099626..63b5fb94a 100644 --- a/src/app/services/default-config-service.spec.ts +++ b/src/app/services/default-config-service.spec.ts @@ -13,93 +13,65 @@ describe('DefaultConfigService', () => { expect(service.defaultTheme).toBe('indigo-pink'); }); - it('should call defaultExternalServices getter', () => { - const spyGetDefaultExternalServices = jest.spyOn(service, 'defaultExternalServices', 'get'); - service.defaultExternalServices; - expect(spyGetDefaultExternalServices).toHaveBeenCalled(); + it('should have a defined defaultExternalServices configuration', () => { + expect(service.defaultExternalServices).toBeDefined(); }); - it('should call defaultTasks getter', () => { - const spyGetDefaultTasks = jest.spyOn(service, 'defaultTasks', 'get'); - service.defaultTasks; - expect(spyGetDefaultTasks).toHaveBeenCalled(); + it('should have a defined defaultTasks configuration', () => { + expect(service.defaultTasks).toBeDefined(); }); - it('should call defaultTasksByStatus getter', () => { - const spyGetDefaultTasksByStatus = jest.spyOn(service, 'defaultTasksByStatus', 'get'); - service.defaultTasksByStatus; - expect(spyGetDefaultTasksByStatus).toHaveBeenCalled(); + it('should have a defined defaultTasksByStatus configuration', () => { + expect(service.defaultTasksByStatus).toBeDefined(); }); - it('should call defaultPartititons getter', () => { - const spyGetDefaultPartitions = jest.spyOn(service, 'defaultPartitions', 'get'); - service.defaultPartitions; - expect(spyGetDefaultPartitions).toHaveBeenCalled(); + it('should have a defined defaultPartititons configuration', () => { + expect(service.defaultPartitions).toBeDefined(); }); - it('should call defaultDashboardSplitLines getter', ()=> { - const spyGetDefaultDashboardSplitLines = jest.spyOn(service, 'defaultDashboardSplitLines', 'get'); - service.defaultDashboardSplitLines; - expect(spyGetDefaultDashboardSplitLines).toHaveBeenCalled(); + it('should have a defined defaultDashboardSplitLines configuration', ()=> { + expect(service.defaultDashboardSplitLines).toBeDefined(); }); - it('should call defaultDashboardLines getter', ()=> { - const spyGetDefaultDashboardLines = jest.spyOn(service, 'defaultDashboardLines', 'get'); - service.defaultDashboardLines; - expect(spyGetDefaultDashboardLines).toHaveBeenCalled(); - }); + it('should have a defined defaultSessions configuration', () => { + expect(service.defaultSessions).toBeDefined(); + }); - it('should call defaultSessions getter', () => { - const spyGetDefaultSessions = jest.spyOn(service, 'defaultSessions', 'get'); - service.defaultSessions; - expect(spyGetDefaultSessions).toHaveBeenCalled(); + it('should have a defined defaultResults configuration', () => { + expect(service.defaultResults).toBeDefined(); }); - it('should call defaultResults getter', () => { - const spyGetDefaultResults = jest.spyOn(service, 'defaultResults', 'get'); - service.defaultResults; - expect(spyGetDefaultResults).toHaveBeenCalled(); + it('should have a defined defaultApplications configuration', () => { + expect(service.defaultApplications).toBeDefined(); }); - it('should call defaultApplications getter', () => { - const spyGetDefaultApplications = jest.spyOn(service, 'defaultApplications', 'get'); - service.defaultApplications; - expect(spyGetDefaultApplications).toHaveBeenCalled(); + it('should have a defined defaultSidebar configuration', () => { + expect(service.defaultSidebar).toBeDefined(); }); - it('should call defaultSidebar getter', () => { - const spyGetDefaultSidebar = jest.spyOn(service, 'defaultSidebar', 'get'); - service.defaultSidebar; - expect(spyGetDefaultSidebar).toHaveBeenCalled(); + it('should have a defined defaultTasksViewInLogs configuration', () => { + expect(service.defaultTasksViewInLogs).toBeDefined(); }); - it('should call defaultTasksViewInLogs getter', () => { - const spyGetDefaultTasksViewInLogs = jest.spyOn(service, 'defaultTasksViewInLogs', 'get'); - service.defaultTasksViewInLogs; - expect(spyGetDefaultTasksViewInLogs).toHaveBeenCalled(); + it('should have a defined exportedDefaultConfig configuration', () => { + expect(service.exportedDefaultConfig).toBeDefined(); }); - it('should call exportedDefaultConfig getter', () => { - const spyGetExportedDefaultConfig = jest.spyOn(service, 'exportedDefaultConfig', 'get'); - service.exportedDefaultConfig; - expect(spyGetExportedDefaultConfig).toHaveBeenCalled(); + it('should have a defined defaultLanguage configuration', () => { + expect(service.defaultLanguage).toBeDefined(); }); - it('should call defaultLanguage getter', () => { - const spyGetDefaultLanguage = jest.spyOn(service, 'defaultLanguage', 'get'); - service.defaultLanguage; - expect(spyGetDefaultLanguage).toHaveBeenCalled(); + it('should have a defined availableLanguages configuration', () => { + expect(service.availableLanguages).toBeDefined(); }); - it('should call availableLanguages getter', () => { - const spyGetAvailableLanguage = jest.spyOn(service, 'availableLanguages', 'get'); - service.availableLanguages; - expect(spyGetAvailableLanguage).toHaveBeenCalled(); + it('should have a defined healthcheck configuration', () => { + expect(service.healthCheck).toBeDefined(); }); describe(' default dashboard configuration', () => { it('the dashboard lines configuration should display at least 1 line', () => { - expect(service.defaultDashboardLines).toHaveLength(1); + expect(service.defaultDashboardLines).toBeDefined(); }); it('the line by default should contain 3 task statuses', () => { @@ -110,9 +82,9 @@ describe('DefaultConfigService', () => { it('the line by default should have finished, running, error, task statuses by default ', () => { const defaultDashboardLines = service.defaultDashboardLines; const taskStatuses = defaultDashboardLines.map( line => line.taskStatusesGroups) as unknown as TasksStatusesGroup[][]; - expect(taskStatuses[0].map(taskStatus => taskStatus.name === 'Finished')).toBeTruthy(); - expect(taskStatuses[0].map(taskStatus => taskStatus.name === 'Running')).toBeTruthy(); - expect(taskStatuses[0].map(taskStatus => taskStatus.name === 'Errors')).toBeTruthy(); + expect(taskStatuses[0].map(taskStatus => taskStatus.name === 'Finished')).toBeTruthy(); + expect(taskStatuses[0].map(taskStatus => taskStatus.name === 'Running')).toBeTruthy(); + expect(taskStatuses[0].map(taskStatus => taskStatus.name === 'Errors')).toBeTruthy(); }); it('default DashboardSplitLines should return 1 line', ()=> {