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 03c0bd2c47900a54be53ba1f8bdbdf9c2376ec96..75835849f6adf910a6d557d6f28612e2aed5f46c 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 @@ -199,24 +199,26 @@ it("creates new Scheduling Unit with default values", async() => { expect(content.queryAllByText('Select Strategy').length).toBe(1); expect(content.queryAllByText('UC1 CTC+pipelines').length).toBe(3); - expect(content.queryByText('Scheduling Constraints specification')).toBeInTheDocument(); - + expect(content.queryByText('Scheduling Constraints specification')).toBeInTheDocument(); // make sure Scheduling Constraint appear when page loading + expect(content.queryAllByText('dynamic').length).toBe(1); // In Scheduling Constraints, the scheduler type is set with default value 'dynamic' expect(content.queryByText('Task Parameters')).toBeInTheDocument(); expect(content.queryByText('Target Pointing 1')).toBeInTheDocument(); - expect(content.queryByText('Not a valid input. Mimimum: 00:00:00, Maximum:23:59:59.')).not.toBeInTheDocument(); - expect(content.queryByText('Not a valid input. Mimimum: 00:00:00, Maximum:90:00:00.')).not.toBeInTheDocument(); - + expect(content.queryByText('Tile Beam')).toBeInTheDocument(); + expect(content.queryAllByText('J2000').length).toBe(3); // As per the data provided it should contains 3 values + expect(content.queryByText('Degrees or Radian')).not.toBeInTheDocument(); // Make sure default values are loaded + expect(content.queryByText('Maximum number of stations that can be missed in the selected groups')).toBeInTheDocument(); //make sure station group is loaded + /* This is set again to call the validateEditor function in the component. If this is removed, the editor validation will not occur in the test but works in browser.*/ - await act( async() => { + /* await act( async() => { fireEvent.change(nameInput, { target: { value: 'UC1 test scheduling unit 1.1' } }); - }); + });*/ expect(content.queryByTestId('save-btn').hasAttribute("disabled")).toBeFalsy(); - + expect(content.queryByText('Success')).not.toBeInTheDocument(); await act(async () => { fireEvent.click(content.queryByTestId('save-btn')); }); expect(saveSUFromStrategySpy).toHaveBeenCalled(); - + expect(content.queryByText('Success')).toBeInTheDocument(); //check popup appear after create SU successfully }); \ No newline at end of file