From 05eec95d29df8efcc8ccccd697dc7ab980b9019d Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Thu, 14 Nov 2024 15:08:26 +0100 Subject: [PATCH] fix(tests): fix tests to use displayName --- src/pages/dataElements/List.spec.tsx | 8 ++++---- .../__mocks__/list/dataElementsMock.json | 20 +++++++++++++++++++ .../list/filteredDataElementsMock.json | 1 + 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/pages/dataElements/List.spec.tsx b/src/pages/dataElements/List.spec.tsx index 9c65f1ed..22a18298 100644 --- a/src/pages/dataElements/List.spec.tsx +++ b/src/pages/dataElements/List.spec.tsx @@ -172,7 +172,7 @@ describe('Data Elements List', () => { dataElements: [ { ...FIRST_FILTERED_DATA_ELEMENT, - name: 'first page result', + displayName: 'first page result', }, ], } @@ -186,7 +186,7 @@ describe('Data Elements List', () => { dataElements: [ { ...FIRST_FILTERED_DATA_ELEMENT, - name: 'second page result', + displayName: 'second page result', }, ], } @@ -218,7 +218,7 @@ describe('Data Elements List', () => { ).toHaveAttribute('disabled') }) // next page - it('should allowing going to Next page', async () => { + it('should allow going to Next page', async () => { const user = userEvent.setup() const { getByTestId, findByText, queryByText } = await renderWithPager() @@ -270,7 +270,7 @@ describe('Data Elements List', () => { result: [ { ...FIRST_FILTERED_DATA_ELEMENT, - name: 'last page result', + displayName: 'last page result', }, ], }, diff --git a/src/pages/dataElements/__mocks__/list/dataElementsMock.json b/src/pages/dataElements/__mocks__/list/dataElementsMock.json index 274e6248..8d028fc8 100644 --- a/src/pages/dataElements/__mocks__/list/dataElementsMock.json +++ b/src/pages/dataElements/__mocks__/list/dataElementsMock.json @@ -9,6 +9,7 @@ "dataElements": [ { "name": "ANC 1st visit", + "displayName": "ANC 1st visit", "lastUpdated": "2017-03-02T16:52:07.101", "sharing": { "public": "r-------" @@ -31,6 +32,7 @@ }, { "name": "ANC 2nd visit", + "displayName": "ANC 2nd visit", "lastUpdated": "2024-03-05T22:55:32.803", "sharing": { "public": "r-------" @@ -53,6 +55,7 @@ }, { "name": "ANC 3rd visit", + "displayName": "ANC 3rd visit", "lastUpdated": "2024-03-05T23:09:47.216", "sharing": { "public": "r-------" @@ -75,6 +78,7 @@ }, { "name": "ANC 4th or more visits", + "displayName": "ANC 4th or more visits", "lastUpdated": "2024-03-05T09:48:09.192", "sharing": { "public": "rw------" @@ -97,6 +101,7 @@ }, { "name": "ARI treated with antibiotics (pneumonia) follow-up", + "displayName": "ARI treated with antibiotics (pneumonia) follow-up", "lastUpdated": "2024-03-05T23:10:04.850", "sharing": { "public": "rw------" @@ -119,6 +124,7 @@ }, { "name": "ARI treated with antibiotics (pneumonia) new", + "displayName": "ARI treated with antibiotics (pneumonia) new", "lastUpdated": "2024-03-05T22:52:47.886", "sharing": { "public": "r-------" @@ -141,6 +147,7 @@ }, { "name": "ARI treated with antibiotics (pneumonia) referrals", + "displayName": "ARI treated with antibiotics (pneumonia) referrals", "lastUpdated": "2024-03-05T09:48:09.193", "sharing": { "public": "rw------" @@ -163,6 +170,7 @@ }, { "name": "ARI treated without antibiotics (cough) follow-up", + "displayName": "ARI treated without antibiotics (cough) follow-up", "lastUpdated": "2024-03-05T09:48:09.191", "sharing": { "public": "rw------" @@ -185,6 +193,7 @@ }, { "name": "ARI treated without antibiotics (cough) new", + "displayName": "ARI treated without antibiotics (cough) new", "lastUpdated": "2024-03-05T09:48:09.194", "sharing": { "public": "rw------" @@ -207,6 +216,7 @@ }, { "name": "ARI treated without antibiotics (cough) referrals", + "displayName": "ARI treated without antibiotics (cough) referrals", "lastUpdated": "2024-03-05T09:48:09.191", "sharing": { "public": "rw------" @@ -229,6 +239,7 @@ }, { "name": "ART No clients who stopped TRT due to TRT failure", + "displayName": "ART No clients who stopped TRT due to TRT failure", "lastUpdated": "2024-03-05T09:48:09.194", "sharing": { "public": "rw------" @@ -251,6 +262,7 @@ }, { "name": "ART No clients who stopped TRT due to adverse clinical status/event", + "displayName": "ART No clients who stopped TRT due to adverse clinical status/event", "lastUpdated": "2024-03-05T09:48:09.191", "sharing": { "public": "rw------" @@ -273,6 +285,7 @@ }, { "name": "ART No clients with change of regimen due to drug toxicity", + "displayName": "ART No clients with change of regimen due to drug toxicity", "lastUpdated": "2024-03-05T09:48:09.195", "sharing": { "public": "rw------" @@ -295,6 +308,7 @@ }, { "name": "ART No clients with new adverse drug reaction", + "displayName": "ART No clients with new adverse drug reaction", "lastUpdated": "2024-03-05T09:48:09.191", "sharing": { "public": "rw------" @@ -317,6 +331,7 @@ }, { "name": "ART No started Opportunist Infection prophylaxis", + "displayName": "ART No started Opportunist Infection prophylaxis", "lastUpdated": "2024-03-05T09:48:09.191", "sharing": { "public": "rw------" @@ -339,6 +354,7 @@ }, { "name": "ART clients with new adverse clinical event", + "displayName": "ART clients with new adverse clinical event", "lastUpdated": "2024-03-05T09:48:09.192", "sharing": { "public": "rw------" @@ -361,6 +377,7 @@ }, { "name": "ART defaulters", + "displayName": "ART defaulters", "lastUpdated": "2024-03-05T09:48:09.192", "sharing": { "public": "rw------" @@ -383,6 +400,7 @@ }, { "name": "ART enrollment stage 1", + "displayName": "ART enrollment stage 1", "lastUpdated": "2024-03-05T09:48:09.194", "sharing": { "public": "rw------" @@ -405,6 +423,7 @@ }, { "name": "ART enrollment stage 2", + "displayName": "ART enrollment stage 2", "lastUpdated": "2024-03-05T09:48:09.190", "sharing": { "public": "rw------" @@ -427,6 +446,7 @@ }, { "name": "ART enrollment stage 3", + "displayName": "ART enrollment stage 3", "lastUpdated": "2024-03-05T09:48:09.193", "sharing": { "public": "rw------" diff --git a/src/pages/dataElements/__mocks__/list/filteredDataElementsMock.json b/src/pages/dataElements/__mocks__/list/filteredDataElementsMock.json index 55d6c2dd..465bc685 100644 --- a/src/pages/dataElements/__mocks__/list/filteredDataElementsMock.json +++ b/src/pages/dataElements/__mocks__/list/filteredDataElementsMock.json @@ -17,6 +17,7 @@ }, "id": "JuTpJ2Ywq5b", "name": "FILTERED Age of LLINs", + "displayName": "FILTERED Age of LLINs", "domainType": "TRACKER", "valueType": "INTEGER_ZERO_OR_POSITIVE", "lastUpdated": "2019-08-21T13:08:02.032",