diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.test.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.test.js index ff34dd4a3f60c0b016ba742871804b05217d4886..c0083747011cf23881b6209a910bfb6db9774e07 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.test.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { cleanup, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; - +import UtilService from "../../services/util.service"; import SchedulingSetCreate from './excelview.schedulingset'; import ScheduleService from '../../services/schedule.service'; import ProjectService from '../../services/project.service'; @@ -31,9 +31,7 @@ function createStandardPageMocks() { return Promise.resolve(ProjectServiceMock.projectList) }); - observStrategiesSpy = jest.spyOn(ScheduleService, 'getObservationStrategies').mockImplementation(() => { - return Promise.resolve(SUServiceMock.getObservStrategies()) - }); + observStrategiesSpy = jest.spyOn(ScheduleService, 'getObservationStrategies').mockResolvedValue(OBSERVATION_STRATEGY_TEMPLATES); suConstraintTemplateSpy = jest.spyOn(ScheduleService, 'getSchedulingConstraintTemplates').mockImplementation(() => { return Promise.resolve(SUServiceMock.getSUCTemplates()); @@ -57,6 +55,8 @@ function createStandardPageMocks() { rolesSpy = jest.spyOn(ProjectService, 'getMyRoles').mockImplementation(() => { return Promise.resolve(SUServiceMock.getMyRoles) }); + const utcTime = '2023-08-11 06:20:45'; + utcspy = jest.spyOn(UtilService, 'getUTC').mockResolvedValue(utcTime); } function getColumnTypes(columnDefs) { @@ -175,7 +175,7 @@ describe('Scheduling Units Excel View create page with an observation strategy t await waitFor(() => expect(pageContent.queryByTestId('save-btn')).toBeInTheDocument()); await clickItem(pageContent.queryByTestId('save-btn')) expect(saveSUFromStrategySpy).not.toHaveBeenCalled(); - expect(pageContent.getByRole('dialog')).toBeDefined(); //pop-up indicating errored SU + expect(pageContent.getByRole('dialog')).toBeInTheDocument(); //pop-up indicating errored SU });