From 6a209bb076851a74d72461cde16a737080e11ce8 Mon Sep 17 00:00:00 2001
From: Muthukrishnanmatriot
 <76949556+muthukrishnanmatriot@users.noreply.github.com>
Date: Tue, 8 Feb 2022 13:19:05 +0530
Subject: [PATCH] Update the test cases

---
 .../src/routes/Scheduling/create.test.js      | 20 ++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

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 03c0bd2c479..75835849f6a 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
-- 
GitLab