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", () => {
const user = useUserStore();
user.loggedIn = true;
user.organisation = 1;
const mockNext = vi.fn();
onboardingRedirect(routeLocation("accountProfile", "vv"), START_LOCATION, mockNext);
expect(mockNext).toHaveBeenCalledWith({
name: "checkoutAddress",
params: { courseType: "vv" },
const testCases = ["vv-de", "vv-it", "vv-fr"];
testCases.forEach((testCase) => {
const user = useUserStore();
user.loggedIn = true;
user.organisation = 1;
const mockNext = vi.fn();
onboardingRedirect(
routeLocation("accountProfile", testCase),
START_LOCATION,
mockNext
);
expect(mockNext).toHaveBeenCalledWith({
name: "checkoutAddress",
params: { courseType: testCase },
});
});
});