From 30b330c26d171350133548344e2d1775a886141e Mon Sep 17 00:00:00 2001 From: Peter Muriuki Date: Tue, 9 Apr 2024 17:04:37 +0300 Subject: [PATCH] Update tests --- .../LocationInventory/tests/utils.test.tsx | 23 --------------- .../AddEditLocationUnit/tests/index.test.tsx | 9 ------ .../RootLocationWizard/tests/fixtures.ts | 29 ++++++++++++++----- 3 files changed, 22 insertions(+), 39 deletions(-) diff --git a/packages/fhir-group-management/src/components/LocationInventory/tests/utils.test.tsx b/packages/fhir-group-management/src/components/LocationInventory/tests/utils.test.tsx index b97104ac5..e308c938c 100644 --- a/packages/fhir-group-management/src/components/LocationInventory/tests/utils.test.tsx +++ b/packages/fhir-group-management/src/components/LocationInventory/tests/utils.test.tsx @@ -1,7 +1,6 @@ import { handleDisabledPastDates, handleDisabledFutureDates, - getValuesetSelectOptions, isAttractiveProduct, productAccountabilityMonths, getMember, @@ -10,7 +9,6 @@ import { } from '../utils'; import dayjs from 'dayjs'; import { - expandedValueSets, unicefValuesetConcept, donorValuesetConcept, productCharacteristics, @@ -47,27 +45,6 @@ describe('fhir-group-management/src/components/LocationInventory/utils', () => { expect(handleDisabledFutureDates(past)).toEqual(false); }); - it('getValuesetSelectOptions works as expected', () => { - expect(getValuesetSelectOptions(expandedValueSets)).toEqual([ - { - label: 'No complications', - value: JSON.stringify({ - code: 'ANC.End.26', - display: 'No complications', - system: 'http://smartregister.org/CodeSystem/eusm-unicef-sections', - }), - }, - { - label: 'Postpartum haemorrhage', - value: JSON.stringify({ - code: 'ANC.End.27', - display: 'Postpartum haemorrhage', - system: 'http://smartregister.org/CodeSystem/eusm-unicef-sections', - }), - }, - ]); - }); - it('get attractive items works as expected', () => { const noAttractiveCharacteristic = commodity1.characteristic?.filter( (char) => char.code.coding?.[0].code !== attractiveCharacteristicCode diff --git a/packages/fhir-location-management/src/components/AddEditLocationUnit/tests/index.test.tsx b/packages/fhir-location-management/src/components/AddEditLocationUnit/tests/index.test.tsx index 04f58eba2..618ee18c3 100644 --- a/packages/fhir-location-management/src/components/AddEditLocationUnit/tests/index.test.tsx +++ b/packages/fhir-location-management/src/components/AddEditLocationUnit/tests/index.test.tsx @@ -171,15 +171,6 @@ test('#1277 - works ok for new locations', async () => { }, ], }, - { - coding: [ - { - system: 'https://smartregister.org/CodeSystem/administrative-level', - code: '0', - display: 'Level 0', - }, - ], - }, ], physicalType: { coding: [ diff --git a/packages/fhir-location-management/src/components/RootLocationWizard/tests/fixtures.ts b/packages/fhir-location-management/src/components/RootLocationWizard/tests/fixtures.ts index 92dc95a2d..a031b70ad 100644 --- a/packages/fhir-location-management/src/components/RootLocationWizard/tests/fixtures.ts +++ b/packages/fhir-location-management/src/components/RootLocationWizard/tests/fixtures.ts @@ -1,17 +1,31 @@ export const rootlocationFixture = { - id: 'eff94f33-c356-4634-8795-d52340706ba9', - identifier: [ - { - use: 'official', - value: 'eff94f33-c356-4634-8795-d52340706ba9', - }, - ], resourceType: 'Location', + identifier: [{ use: 'official', value: 'eff94f33-c356-4634-8795-d52340706ba9' }], status: 'active', name: 'Root FHIR Location', alias: ['Root Location'], description: 'This is the Root Location that all other locations are part of. Any locations that are directly part of this should be displayed as the root location.', + type: [ + { + coding: [ + { + system: 'http://terminology.hl7.org/CodeSystem/location-physical-type', + code: 'jdn', + display: 'Jurisdiction', + }, + ], + }, + { + coding: [ + { + system: 'https://smartregister.org/CodeSystem/administrative-level', + code: '0', + display: 'Level 0', + }, + ], + }, + ], physicalType: { coding: [ { @@ -21,4 +35,5 @@ export const rootlocationFixture = { }, ], }, + id: 'eff94f33-c356-4634-8795-d52340706ba9', };