-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MU-13] ensures that date of birth is pre-populated from search (#2174)
- Loading branch information
1 parent
202b4df
commit e2d7c90
Showing
6 changed files
with
91 additions
and
25 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
apps/modernization-ui/src/apps/patient/add/basic/asBasicNewPatientEntry.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { asBasicNewPatientEntry } from './asBasicNewPatientEntry'; | ||
|
||
describe('when adding a new patient from a patient search', () => { | ||
it('should populate the date of birth from the date equals criteria with a full date', () => { | ||
const criteria = { bornOn: { equals: { month: 6, day: 5, year: 2025 } } }; | ||
|
||
const actual = asBasicNewPatientEntry(criteria); | ||
|
||
expect(actual).toEqual( | ||
expect.objectContaining({ personalDetails: expect.objectContaining({ bornOn: '06/05/2025' }) }) | ||
); | ||
}); | ||
|
||
it('should populate the date of birth from the date equals criteria with only a month', () => { | ||
const criteria = { bornOn: { equals: { month: 6 } } }; | ||
|
||
const actual = asBasicNewPatientEntry(criteria); | ||
|
||
expect(actual.personalDetails?.bornOn).toBeUndefined(); | ||
}); | ||
|
||
it('should populate the date of birth from the date equals criteria with only a day', () => { | ||
const criteria = { bornOn: { equals: { day: 5 } } }; | ||
|
||
const actual = asBasicNewPatientEntry(criteria); | ||
|
||
expect(actual.personalDetails?.bornOn).toBeUndefined(); | ||
}); | ||
|
||
it('should populate the date of birth from the date equals criteria with only a year', () => { | ||
const criteria = { bornOn: { equals: { year: 2025 } } }; | ||
|
||
const actual = asBasicNewPatientEntry(criteria); | ||
|
||
expect(actual.personalDetails?.bornOn).toBeUndefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters