From 4a736b2ae8416fcca9d0046637ce6e1c46c04569 Mon Sep 17 00:00:00 2001 From: Peter Muriuki Date: Fri, 16 Feb 2024 10:59:12 +0300 Subject: [PATCH] Fix test regressions --- .../CommodityList/Eusm/ViewDetails.tsx | 2 +- .../tests/__snapshots__/list.test.tsx.snap | 35 ++++++++++++++++--- .../Eusm/tests/viewDetails.test.tsx | 6 ++-- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/packages/fhir-group-management/src/components/CommodityList/Eusm/ViewDetails.tsx b/packages/fhir-group-management/src/components/CommodityList/Eusm/ViewDetails.tsx index 37b90e240..f74d0d6fe 100644 --- a/packages/fhir-group-management/src/components/CommodityList/Eusm/ViewDetails.tsx +++ b/packages/fhir-group-management/src/components/CommodityList/Eusm/ViewDetails.tsx @@ -153,7 +153,7 @@ export const ViewDetailsWrapper = (props: ViewDetailsWrapperProps) => { const FallbackImage = ({ active }: { active: boolean }) => { return ( +
+ + Material Number + +
+
+ + 52cffa51-fa81-49aa-9944-5b45d9e4c117 + +
+ +`; + +exports[`renders correctly when listing resources 5`] = `
@@ -50,7 +75,7 @@ exports[`renders correctly when listing resources 4`] = `
`; -exports[`renders correctly when listing resources 5`] = ` +exports[`renders correctly when listing resources 6`] = `
@@ -75,7 +100,7 @@ exports[`renders correctly when listing resources 5`] = `
`; -exports[`renders correctly when listing resources 6`] = ` +exports[`renders correctly when listing resources 7`] = `
@@ -100,7 +125,7 @@ exports[`renders correctly when listing resources 6`] = `
`; -exports[`renders correctly when listing resources 7`] = ` +exports[`renders correctly when listing resources 8`] = `
@@ -125,7 +150,7 @@ exports[`renders correctly when listing resources 7`] = `
`; -exports[`renders correctly when listing resources 8`] = ` +exports[`renders correctly when listing resources 9`] = `
@@ -150,7 +175,7 @@ exports[`renders correctly when listing resources 8`] = `
`; -exports[`renders correctly when listing resources 9`] = ` +exports[`renders correctly when listing resources 10`] = `
diff --git a/packages/fhir-group-management/src/components/CommodityList/Eusm/tests/viewDetails.test.tsx b/packages/fhir-group-management/src/components/CommodityList/Eusm/tests/viewDetails.test.tsx index 1a4e0494d..63e0041fa 100644 --- a/packages/fhir-group-management/src/components/CommodityList/Eusm/tests/viewDetails.test.tsx +++ b/packages/fhir-group-management/src/components/CommodityList/Eusm/tests/viewDetails.test.tsx @@ -97,6 +97,7 @@ test('test error on attached binary request', async () => { ); expect(commodityValues).toEqual([ 'Product Id52cffa51-fa81-49aa-9944-5b45d9e4c117', + 'Material Number52cffa51-fa81-49aa-9944-5b45d9e4c117', 'NameBed nets', 'ActiveActive', 'Is it thereyes', @@ -106,7 +107,7 @@ test('test error on attached binary request', async () => { ]); // image section - screen.getByTestId('fallback-img'); + expect(document.querySelector('.fallback-img')).toBeInTheDocument(); expect(nock.isDone()).toBeTruthy(); }); @@ -131,6 +132,7 @@ test('test missing binary in commodity', async () => { ); expect(commodityValues).toEqual([ 'Product Id52cffa51-fa81-49aa-9944-5b45d9e4c117', + 'Material Number52cffa51-fa81-49aa-9944-5b45d9e4c117', 'NameBed nets', 'ActiveActive', 'Is it thereyes', @@ -140,7 +142,7 @@ test('test missing binary in commodity', async () => { ]); // image section - screen.getByTestId('fallback-img'); + expect(document.querySelector('.fallback-img')).toBeInTheDocument(); expect(nock.isDone()).toBeTruthy(); });