Skip to content

Commit

Permalink
fix: useRedirectionRule hook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmuniz1994 committed Oct 29, 2023
1 parent 5ba2817 commit a78fc5c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/hooks/useRedirectionRule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,20 @@ describe("getRedirectionRule: /p2p-call", () => {
expect(result).toBe("/create");
});

it("when not authenticated, be forced to reset flow", () => {
it("when not authenticated and the url has call uuid, then go to join page", () => {
// TODO: retrieve attempt call uid and convert into "/?joining=" flow
const result = getRedirectionRule(
{ path: "/p2p-call/123-321", hasAuth: false },
{}
);
expect(result).toBe("/join?callUid=123-321");
});

it("when not authenticated and the url has not call uuid, be forced to reset flow", () => {
const result = getRedirectionRule(
{ path: "/p2p-call/", hasAuth: false },
{}
);
expect(result).toBe("/");
});
});

0 comments on commit a78fc5c

Please sign in to comment.