Skip to content

Commit e20cc05

Browse files
VIA-629 SB Add missing test for getNbsQueryParams.
1 parent 6d94a74 commit e20cc05

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/services/nbs/nbs-service.test.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { VaccineType } from "@src/models/vaccine";
2-
import { getSSOUrlToNBSForVaccine } from "@src/services/nbs/nbs-service";
2+
import { getNbsQueryParams, getSSOUrlToNBSForVaccine } from "@src/services/nbs/nbs-service";
33
import { generateAssertedLoginIdentityJwt } from "@src/utils/auth/generate-auth-payload";
44
import config from "@src/utils/config";
55
import { ConfigMock, configBuilder } from "@test-data/config/builders";
@@ -65,3 +65,19 @@ describe("getSSOUrlToNBSForVaccine", () => {
6565
});
6666
});
6767
});
68+
69+
describe("getNbsQueryParams", () => {
70+
beforeEach(() => {
71+
(generateAssertedLoginIdentityJwt as jest.Mock).mockReturnValue(mockAssertedLoginIdentityJWT);
72+
});
73+
74+
it("should include campaignID query param when vaccineType supplied", async () => {
75+
const actual = await getNbsQueryParams(VaccineType.RSV);
76+
expect(actual).toEqual(expect.arrayContaining([expect.objectContaining({ name: "wt.mc_id" })]));
77+
});
78+
79+
it("should not include campaignID query param when vaccineType not supplied", async () => {
80+
const actual = await getNbsQueryParams();
81+
expect(actual).not.toEqual(expect.arrayContaining([expect.objectContaining({ name: "wt.mc_id" })]));
82+
});
83+
});

0 commit comments

Comments
 (0)