diff --git a/SAS/TMSS/backend/test/CMakeLists.txt b/SAS/TMSS/backend/test/CMakeLists.txt index 3bf5d5b68b0ff6817fad689edf88f1e725b556f5..457c7f72432a939c5bd25a7c738213bf49ed10d5 100644 --- a/SAS/TMSS/backend/test/CMakeLists.txt +++ b/SAS/TMSS/backend/test/CMakeLists.txt @@ -24,8 +24,8 @@ if(BUILD_TESTING) lofar_add_test(t_complex_serializers) lofar_add_test(t_conversions) lofar_add_test(t_feedback) - # lofar_add_test(t_l2station_tmss_integration_test) - # lofar_add_test(t_l2station_tmss_test) + #lofar_add_test(t_l2station_tmss_integration_test) + #lofar_add_test(t_l2station_tmss_test) lofar_add_test(t_observation_strategies_specification_and_scheduling_test) lofar_add_test(t_observing_strategies_regression_test) lofar_add_test(t_permissions_project_roles) diff --git a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/DateTimeInfo.test.js b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/DateTimeInfo.test.js index 2f14041e79b7a70efb8504b398eb62884c95dd42..619d7eacb134c5c3347d9c10c30cc311d1e0201b 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/DateTimeInfo.test.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/DateTimeInfo.test.js @@ -20,7 +20,17 @@ describe('DateTimeInfo Component', () => { it('renders datetime info when currentUTC and currentLST are available and valid', async () => { const utcTime = '2023-08-11 06:20:45'; - const lstTime = '2023-08-11 12:20:45'; + const lstTime = { + + data : { + UTC:"2023-11-21T00:00:00Z", + LST: { + CS002 : "04:26:26" + } + + } + } + UtilService.getUTC.mockResolvedValue(utcTime); UtilService.getLST.mockResolvedValue(lstTime); @@ -33,7 +43,7 @@ describe('DateTimeInfo Component', () => { expect(content.getByTestId('Date-element')).toBeInTheDocument(); expect(content.getByTestId('UTC-element')).toBeInTheDocument(); - expect(content.getByTestId('LST-element')).toBeInTheDocument(); + expect(content.getByTestId('LOFAR Core LST-element')).toBeInTheDocument(); expect(UtilService.getUTC).toHaveBeenCalled(); expect(UtilService.getLST).toHaveBeenCalled(); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.test.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.test.js index 4b7bc52b44cd28b96e1baf2c3afabe53b8fe4917..bee5e40b6ef73f87ebb35658d79211c29b42b307 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.test.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/create.test.js @@ -406,7 +406,7 @@ it("remove default resource and added resource", async () => { await act(async () => { fireEvent.click(screen.getAllByText("Add Resources")[0].parentElement.parentElement.parentElement.children[3]); }); - await new Promise((r) => setTimeout(r, 1000)); + const addResourceInput = screen.getAllByText("LOFAR Observing Time Commissioning")[0]; fireEvent.click(addResourceInput); // After selecting New Resource diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/__snapshots__/create.test.js.snap b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/__snapshots__/create.test.js.snap index 04ff8abee575a9ab6c4ee2982f2ce9a65f6ecbd4..984a0022612274e9e04de46032e9986808a8bee8 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/__snapshots__/create.test.js.snap +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/__snapshots__/create.test.js.snap @@ -3,7 +3,7 @@ exports[`Scheduling Unit create page default Renders with all standard service mocks 1`] = ` Array [ <div - className="page-header" + className="page-header SchedulingUnit-PageHeader" > <div className="title" diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/create.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/create.js index 574440f8e3d79c6d9aa2eb1b8944cb0ae0ace9ce..3e37d2876bdf8cf07be76967514453f995428794 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/create.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/create.js @@ -949,7 +949,7 @@ export class SchedulingUnitCreate extends Component { return ( <React.Fragment> <Toast ref={(el) => this.growl = el}/> - <PageHeader location={this.props.location} title={'Scheduling Unit - Add'} + <PageHeader location={this.props.location} className="SchedulingUnit-PageHeader" title={'Scheduling Unit - Add'} actions={[{ icon: 'fa-window-close', title: 'Click to close Scheduling Unit creation', type: 'button', actOn: 'click', props: {callback: this.checkIsDirty} diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/create.test.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/create.test.js index c89e313986c5068807c5519e24e94e02d67a02ec..222886a5ed017794ee9bb8244ef4d5aecacd09f0 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/create.test.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/create.test.js @@ -83,12 +83,14 @@ describe('Scheduling Unit create page default', () => { cleanup(); }); - test("Renders with all standard service mocks", () => { + test("Renders with all standard service mocks", async () => { const page = renderer .create(<SchedulingUnitCreate location={{ pathname: '/schedulingunit/create' }} />) .toJSON(); - expect(page).toMatchSnapshot(); + + + await waitFor (() => expect(page).toMatchSnapshot() ); })