diff --git a/SAS/TMSS/frontend/tmss_webapp/src/tests/__snapshots__/systemevent.list.test.js.snap b/SAS/TMSS/frontend/tmss_webapp/src/tests/__snapshots__/systemevent.list.test.js.snap index 9febebcea3eb91b7f0c25825b001b804927a8148..2098d5d589b642b4a8e212a3715afe2b3e60af5c 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/tests/__snapshots__/systemevent.list.test.js.snap +++ b/SAS/TMSS/frontend/tmss_webapp/src/tests/__snapshots__/systemevent.list.test.js.snap @@ -1521,7 +1521,7 @@ exports[`Systen Event List System Event Renders correctly with data 1`] = ` <div style="box-sizing: border-box; flex: 150 0 auto; min-width: 60px; width: 150px;" > - 2023-12-29 11:23:40 + 2023-08-06 02:00:00 </div> </td> <td @@ -1530,7 +1530,7 @@ exports[`Systen Event List System Event Renders correctly with data 1`] = ` <div style="box-sizing: border-box; flex: 150 0 auto; min-width: 60px; width: 150px;" > - 2023-12-29 11:23:40 + 2023-08-06 02:00:00 </div> </td> <td @@ -1691,7 +1691,7 @@ exports[`Systen Event List System Event Renders correctly with data 1`] = ` <div style="box-sizing: border-box; flex: 150 0 auto; min-width: 60px; width: 150px;" > - 2023-12-29 11:23:40 + 2023-08-06 02:00:00 </div> </td> <td @@ -1700,7 +1700,7 @@ exports[`Systen Event List System Event Renders correctly with data 1`] = ` <div style="box-sizing: border-box; flex: 150 0 auto; min-width: 60px; width: 150px;" > - 2023-12-29 11:23:40 + 2023-08-06 02:00:00 </div> </td> <td @@ -1861,7 +1861,7 @@ exports[`Systen Event List System Event Renders correctly with data 1`] = ` <div style="box-sizing: border-box; flex: 150 0 auto; min-width: 60px; width: 150px;" > - 2023-12-29 11:23:40 + 2023-08-06 02:00:00 </div> </td> <td @@ -1870,7 +1870,7 @@ exports[`Systen Event List System Event Renders correctly with data 1`] = ` <div style="box-sizing: border-box; flex: 150 0 auto; min-width: 60px; width: 150px;" > - 2023-12-29 11:23:40 + 2023-08-06 02:00:00 </div> </td> <td diff --git a/SAS/TMSS/frontend/tmss_webapp/src/tests/systemevent.list.test.js b/SAS/TMSS/frontend/tmss_webapp/src/tests/systemevent.list.test.js index e0706c9871f9a6e32622fc384933db124f0e8cf0..130b50e192928f54906f51f163ca404f296e99ab 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/tests/systemevent.list.test.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/tests/systemevent.list.test.js @@ -22,6 +22,8 @@ import { SystemEventList } from "../routes/SystemEvent/system.event.list"; function MakePrimaryMock() { + jest.useFakeTimers() + jest.setSystemTime(new Date('2023-08-06')); let mock = new MockAdapter(axios); mock.onOptions("/api/system_event/").reply(200, systemeventoptions); mock.onGet("/api/system_event_template").reply(200, systemeventtemplate); @@ -30,15 +32,6 @@ function MakePrimaryMock() { mock.onGet("/api/system_event_severity").reply(200, systemeventseverity); mock.onGet("/api/system_event_status").reply(200, systemeventsstatus); mock.onGet("/api/system_event/?ordering=id&limit=10&offset=0").reply(200, systemeventsstatus); - - - - - - - - - return mock } @@ -46,11 +39,10 @@ function MakePrimaryMock() { describe('Systen Event List ', () => { it('System Event List renders correctly without security', async () => { - new MockAdapter(axios); + new MockAdapter(axios); let component await act(async () => { component = render(<MemoryRouter><SystemEventList history={{}} location="/systemevent/list/" /></MemoryRouter>) }); const componentSnapshot = component.asFragment(); - expect(componentSnapshot).toMatchSnapshot(); component.unmount();