fix: unit test vv -> vv-de vv-it vv-fr

This commit is contained in:
Livio Bieri 2023-12-08 15:40:31 +01:00 committed by Christian Cueni
parent bf1353553b
commit 213c70691a
1 changed files with 15 additions and 8 deletions

View File

@ -49,14 +49,21 @@ describe("Onboarding", () => {
}); });
it("VV: redirect to profile next route for logged-in user with organisation", () => { it("VV: redirect to profile next route for logged-in user with organisation", () => {
const user = useUserStore(); const testCases = ["vv-de", "vv-it", "vv-fr"];
user.loggedIn = true; testCases.forEach((testCase) => {
user.organisation = 1; const user = useUserStore();
const mockNext = vi.fn(); user.loggedIn = true;
onboardingRedirect(routeLocation("accountProfile", "vv"), START_LOCATION, mockNext); user.organisation = 1;
expect(mockNext).toHaveBeenCalledWith({ const mockNext = vi.fn();
name: "checkoutAddress", onboardingRedirect(
params: { courseType: "vv" }, routeLocation("accountProfile", testCase),
START_LOCATION,
mockNext
);
expect(mockNext).toHaveBeenCalledWith({
name: "checkoutAddress",
params: { courseType: testCase },
});
}); });
}); });