Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 507b54a

Browse files
committed
Add describes in tests
1 parent 3633dfc commit 507b54a

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

site/src/util/redirect.test.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import { embedRedirect, retrieveRedirect } from "./redirect"
22

33
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+
})
713
})
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+
})
1519
})
1620
})

0 commit comments

Comments
 (0)