Skip to content
Snippets Groups Projects
Commit ec1337ef authored by Reinder Kraaij's avatar Reinder Kraaij :eye:
Browse files

Pin Date for System event List

parent c3e391d5
No related branches found
No related tags found
1 merge request!1267Tmss code cleanup part 4
......@@ -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
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment