Skip to content

Commit

Permalink
updated the mocks and its usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush-AI authored and denniskigen committed Sep 24, 2023
1 parent 1b57306 commit 20568fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,29 @@ export const mockedIdentifierTypes = [
description: 'Generator for OpenMRS ID',
baseCharacterSet: '0123456789ACDEFGHJKLMNPRTUVWXY',
prefix: '',
autoGenerationOption: {
manualEntryEnabled: false,
automaticGenerationEnabled: true,
},
},
{
uuid: '01af8526-cea4-4175-aa90-340acb411771',
name: 'Generator 2 for OpenMRS ID',
description: 'Generator 2 for OpenMRS ID',
baseCharacterSet: '0123456789ACDEFGHJKLMNPRTUVWXY',
prefix: '',
autoGenerationOption: {
manualEntryEnabled: true,
automaticGenerationEnabled: true,
},
},
],
isPrimary: true,
name: 'OpenMRS ID',
required: true,
uniquenessBehavior: 'UNIQUE',
uuid: '05a29f94-c0ed-11e2-94be-8c13b969e334',
autoGenerationSource: null,
},
{
fieldName: 'idCard',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Identifiers } from './id-field.component';
import { Resources, ResourcesContext } from '../../../offline.resources';
import { Form, Formik } from 'formik';
import { PatientRegistrationContext } from '../../patient-registration-context';
import { useConfig } from '@openmrs/esm-framework';
import { openmrsID } from '../__mocks__/identifiers.mock';
import { mockedIdentifierTypes } from '../__mocks__/identifier-types.mock';

Expand Down Expand Up @@ -35,7 +34,7 @@ describe('Identifiers', () => {
<PatientRegistrationContext.Provider
value={{
setFieldValue: jest.fn(),
initialFormValues: { identifiers: { openmrsID } },
initialFormValues: { identifiers: { ...mockedIdentifierTypes[0] } },
setInitialFormValues: jest.fn(),
values: {
identifiers: { openmrsID },
Expand All @@ -58,7 +57,7 @@ describe('Identifiers', () => {
<PatientRegistrationContext.Provider
value={{
setFieldValue: jest.fn(),
initialFormValues: { identifiers: { openmrsID } },
initialFormValues: { identifiers: { ...mockedIdentifierTypes[0] } },
setInitialFormValues: jest.fn(),
values: {
identifiers: { openmrsID },
Expand All @@ -85,7 +84,7 @@ describe('Identifiers', () => {
<PatientRegistrationContext.Provider
value={{
setFieldValue: jest.fn(),
initialFormValues: { identifiers: { openmrsID } },
initialFormValues: { identifiers: { ...mockedIdentifierTypes[0] } },
setInitialFormValues: jest.fn(),
values: {
identifiers: { openmrsID },
Expand Down

0 comments on commit 20568fa

Please sign in to comment.