Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
MAT-7852: add/modify unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
etan-sb committed Nov 20, 2024
1 parent aae6dae commit 7705d42
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/api/TerminologyServiceApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe("TerminologyServiceApi Tests", () => {
});
});

it("Should call Terminology Service URL to fetch value set expansions when manifest Expansion feature flag is true", () => {
it("Should call Terminology Service URL to fetch value set expansions when manifest Expansion feature flag is true and activeOnly is set to 'true' when manifestExpansion is truthy (expansion type is Manifest)", () => {
axios.put = jest
.fn()
.mockResolvedValue({ data: cqm_measure_basic_valueset });
Expand All @@ -101,6 +101,32 @@ describe("TerminologyServiceApi Tests", () => {
fullUrl: "https://cts.nlm.nih.gov/fhir/Library/mu2-update-2015-05-01",
id: "mu2-update-2015-05-01",
},
activeOnly: "true",
profile: "",
valueSetParams: [
{ oid: "2.16.840.1.113883.3.666.5.307" },
{ oid: "2.16.840.1.113883.3.464.1003.103.12.1001" },
],
},
{ headers: { Authorization: "Bearer undefined" }, signal: true }
);
});

it("Should call Terminology Service URL to fetch value set expansions when manifest Expansion feature flag is true and activeOnly is set to 'false' when manifestExpansion is falsy (expansion type is Latest)", () => {
axios.put = jest
.fn()
.mockResolvedValue({ data: cqm_measure_basic_valueset });
const result = terminologyService.getQdmValueSetsExpansion(
cqm_measure_basic,
null,
true
);
expect(axios.put).toBeCalledWith(
"test.url/terminology/value-sets/expansion/qdm",
{
includeDraft: "yes",
manifestExpansion: null,
activeOnly: "false",
profile: "",
valueSetParams: [
{ oid: "2.16.840.1.113883.3.666.5.307" },
Expand Down Expand Up @@ -128,6 +154,7 @@ describe("TerminologyServiceApi Tests", () => {
"https://cts.nlm.nih.gov/fhir/Library/mu2-update-2015-05-01",
id: "mu2-update-2015-05-01",
},
activeOnly: "true",
profile: "",
valueSetParams: [
{ oid: "2.16.840.1.113883.3.666.5.307" },
Expand Down

0 comments on commit 7705d42

Please sign in to comment.