Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit fd448d6

Browse files
committed
fix: fix time based test
1 parent 9c786cf commit fd448d6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/__tests__/clients/db/PatientRepository.test.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,8 @@ describe('patient repository', () => {
194194
})
195195

196196
it('should not update the created date', async () => {
197-
const existingPatient = await PatientRepository.save({
198-
fullName: 'test7 test7',
199-
} as Patient)
200-
existingPatient.givenName = 'givenName'
201-
existingPatient.createdDate = getTime(new Date())
202-
197+
await patients.put({ _id: 'id111111', createdDate: getTime(new Date(2020, 3, 1)) })
198+
const existingPatient = await PatientRepository.find('id111111')
203199
const updatedPatient = await PatientRepository.saveOrUpdate(existingPatient)
204200

205201
expect(updatedPatient.createdDate).toEqual(existingPatient.createdDate)

0 commit comments

Comments
 (0)