Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki committed Apr 9, 2024
1 parent 11f0ad8 commit 30b330c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
handleDisabledPastDates,
handleDisabledFutureDates,
getValuesetSelectOptions,
isAttractiveProduct,
productAccountabilityMonths,
getMember,
Expand All @@ -10,7 +9,6 @@ import {
} from '../utils';
import dayjs from 'dayjs';
import {
expandedValueSets,
unicefValuesetConcept,
donorValuesetConcept,
productCharacteristics,
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
Original file line number Diff line number Diff line change
@@ -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: [
{
Expand All @@ -21,4 +35,5 @@ export const rootlocationFixture = {
},
],
},
id: 'eff94f33-c356-4634-8795-d52340706ba9',
};

0 comments on commit 30b330c

Please sign in to comment.