From 5ef9cd969f45e240dbf81a1a59dee43b2af5f84a Mon Sep 17 00:00:00 2001 From: Peter Muriuki Date: Fri, 20 Dec 2024 18:58:44 +0300 Subject: [PATCH] Fix test regressions --- app/src/App/tests/App.test.tsx | 4 +- .../tests/__snapshots__/index.test.tsx.snap | 40 +++++++++++++++ .../containers/pages/Home/tests/Home.test.tsx | 1 + .../tests/__snapshots__/Home.test.tsx.snap | 11 ++++ app/src/routes/tests/index.test.tsx | 51 +++++++++++++++++-- 5 files changed, 102 insertions(+), 5 deletions(-) diff --git a/app/src/App/tests/App.test.tsx b/app/src/App/tests/App.test.tsx index d788c6c23..2a8a491dd 100644 --- a/app/src/App/tests/App.test.tsx +++ b/app/src/App/tests/App.test.tsx @@ -60,7 +60,7 @@ describe('App - unauthenticated', () => { ); // before resolving get oauth state request, the user is logged out - expect(wrapper.text()).toMatchInlineSnapshot(`"AdministrationLogin"`); + expect(wrapper.text()).toMatchInlineSnapshot(`"AdministrationData ImportsLogin"`); await act(async () => { await flushPromises(); @@ -175,7 +175,7 @@ describe('App - authenticated', () => { ); // before resolving get oauth state request, the user is logged out expect(wrapper.text()).toMatchInlineSnapshot( - `"AdministrationdemoWelcome to OpenSRPUser ManagementQuestionnaire Management"` + `"AdministrationData ImportsdemoWelcome to OpenSRPUser ManagementQuestionnaire ManagementData Imports"` ); await act(async () => { diff --git a/app/src/containers/ConnectedSidebar/tests/__snapshots__/index.test.tsx.snap b/app/src/containers/ConnectedSidebar/tests/__snapshots__/index.test.tsx.snap index 2fd2bec0b..8800dcb24 100644 --- a/app/src/containers/ConnectedSidebar/tests/__snapshots__/index.test.tsx.snap +++ b/app/src/containers/ConnectedSidebar/tests/__snapshots__/index.test.tsx.snap @@ -83,6 +83,16 @@ Array [ , + } + > + + Data Imports + + , ] `; @@ -169,6 +179,16 @@ Array [ , + } + > + + Data Imports + + , ] `; @@ -300,6 +320,16 @@ Object { + } + > + + Data Imports + + , null, @@ -389,5 +419,15 @@ Array [ , + } + > + + Data Imports + + , ] `; diff --git a/app/src/containers/pages/Home/tests/Home.test.tsx b/app/src/containers/pages/Home/tests/Home.test.tsx index a6898b014..1363d3c60 100644 --- a/app/src/containers/pages/Home/tests/Home.test.tsx +++ b/app/src/containers/pages/Home/tests/Home.test.tsx @@ -66,6 +66,7 @@ describe('containers/pages/Home', () => { 'Location Management', 'Organization Management', 'Questionnaire Management', + 'Data Imports', ]); links.forEach((link) => { expect(link).toMatchSnapshot(link.textContent ?? undefined); diff --git a/app/src/containers/pages/Home/tests/__snapshots__/Home.test.tsx.snap b/app/src/containers/pages/Home/tests/__snapshots__/Home.test.tsx.snap index d9c45804b..1c2f9da1a 100644 --- a/app/src/containers/pages/Home/tests/__snapshots__/Home.test.tsx.snap +++ b/app/src/containers/pages/Home/tests/__snapshots__/Home.test.tsx.snap @@ -1,5 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`containers/pages/Home renders Home correctly & changes Title of page 2: Data Imports 1`] = ` + +`; + exports[`containers/pages/Home renders Home correctly & changes Title of page 2: Location Management 1`] = `