Skip to content

Commit

Permalink
Fix test regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki committed Dec 7, 2023
1 parent 7eec094 commit 663f3ea
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions packages/react-utils/src/helpers/tests/dataLoaders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,16 @@ describe('dataloaders/FHIRService', () => {
const fhir = new FHIRServiceClass<fhirR4.CareTeam>('https://test.fhir.org', 'CareTeam');
const result = await fhir.list();
await flushPromises();
expect(requestMock.mock.calls).toEqual([['CareTeam']]);
expect(requestMock.mock.calls).toEqual([
[
{
headers: {
'cache-control': 'no-cache',
},
url: 'CareTeam',
},
],
]);
expect(result).toEqual(fixtures.careTeams);
// make sure every item of fhirlist returns the CareTeam
expect(result.entry.every((e) => e.resource.resourceType === 'CareTeam')).toBeTruthy();
Expand All @@ -239,7 +248,16 @@ describe('dataloaders/FHIRService', () => {
// without url params
const result = await fhir.list({ _count: '100' });
await flushPromises();
expect(requestMock.mock.calls).toEqual([['CareTeam/_search?_count=100']]);
expect(requestMock.mock.calls).toEqual([
[
{
headers: {
'cache-control': 'no-cache',
},
url: 'CareTeam/_search?_count=100',
},
],
]);
expect(result).toEqual(fixtures.careTeams);
// make sure every item of fhirlist returns the CareTeam
expect(result.entry.every((e) => e.resource.resourceType === 'CareTeam')).toBeTruthy();
Expand Down

0 comments on commit 663f3ea

Please sign in to comment.