|
1 | 1 | import { embedRedirect, retrieveRedirect } from "./redirect"
|
2 | 2 |
|
3 | 3 | describe("redirect helper functions", () => {
|
4 |
| - it("embeds the page to return to in the URL", () => { |
5 |
| - const result = embedRedirect("/workspaces", "/page") |
6 |
| - expect(result).toEqual("/page?redirect=%2Fworkspaces") |
| 4 | + describe("embedRedirect", () => { |
| 5 | + it("embeds the page to return to in the URL", () => { |
| 6 | + const result = embedRedirect("/workspaces", "/page") |
| 7 | + expect(result).toEqual("/page?redirect=%2Fworkspaces") |
| 8 | + }) |
| 9 | + it("defaults to navigating to the login page", () => { |
| 10 | + const result = embedRedirect("/workspaces") |
| 11 | + expect(result).toEqual("/login?redirect=%2Fworkspaces") |
| 12 | + }) |
7 | 13 | })
|
8 |
| - it("defaults to navigating to the login page", () => { |
9 |
| - const result = embedRedirect("/workspaces") |
10 |
| - expect(result).toEqual("/login?redirect=%2Fworkspaces") |
11 |
| - }) |
12 |
| - it("retrieves the page to return to from the URL", () => { |
13 |
| - const result = retrieveRedirect("?redirect=%2Fworkspaces") |
14 |
| - expect(result).toEqual("/workspaces") |
| 14 | + describe("retrieveRedirect", () => { |
| 15 | + it("retrieves the page to return to from the URL", () => { |
| 16 | + const result = retrieveRedirect("?redirect=%2Fworkspaces") |
| 17 | + expect(result).toEqual("/workspaces") |
| 18 | + }) |
15 | 19 | })
|
16 | 20 | })
|
0 commit comments