fixup: formatting
This commit is contained in:
parent
0fabb3a81d
commit
cbf00ae7aa
@ -73,43 +73,33 @@ describe(
|
||||
},
|
||||
)
|
||||
|
||||
describe(
|
||||
"VS Code Routes with no workspace or folder",
|
||||
["--disable-workspace-trust"],
|
||||
{},
|
||||
async () => {
|
||||
test("should redirect to last query folder/workspace", async ({ codeServerPage }) => {
|
||||
const folder = process.env.CODE_FOLDER_DIR
|
||||
const workspace = process.env.CODE_WORKSPACE_DIR
|
||||
await codeServerPage.navigate(`/?folder=${folder}&workspace=${workspace}`)
|
||||
describe("VS Code Routes with no workspace or folder", ["--disable-workspace-trust"], {}, async () => {
|
||||
test("should redirect to last query folder/workspace", async ({ codeServerPage }) => {
|
||||
const folder = process.env.CODE_FOLDER_DIR
|
||||
const workspace = process.env.CODE_WORKSPACE_DIR
|
||||
await codeServerPage.navigate(`/?folder=${folder}&workspace=${workspace}`)
|
||||
|
||||
// If you visit again without query parameters it will re-attach them by
|
||||
// redirecting. It should always redirect to the same route.
|
||||
for (const route of routes) {
|
||||
await codeServerPage.navigate(route)
|
||||
const url = new URL(codeServerPage.page.url())
|
||||
expect(url.pathname).toBe(route)
|
||||
expect(url.search).toBe(`?folder=${folder}&workspace=${workspace}`)
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
// If you visit again without query parameters it will re-attach them by
|
||||
// redirecting. It should always redirect to the same route.
|
||||
for (const route of routes) {
|
||||
await codeServerPage.navigate(route)
|
||||
const url = new URL(codeServerPage.page.url())
|
||||
expect(url.pathname).toBe(route)
|
||||
expect(url.search).toBe(`?folder=${folder}&workspace=${workspace}`)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
describe(
|
||||
"VS Code Routes with no workspace or folder",
|
||||
["--disable-workspace-trust"],
|
||||
{},
|
||||
async () => {
|
||||
test("should not redirect if ew passed in", async ({ codeServerPage }) => {
|
||||
const folder = process.env.CODE_FOLDER_DIR
|
||||
const workspace = process.env.CODE_WORKSPACE_DIR
|
||||
await codeServerPage.navigate(`/?folder=${folder}&workspace=${workspace}`)
|
||||
describe("VS Code Routes with no workspace or folder", ["--disable-workspace-trust"], {}, async () => {
|
||||
test("should not redirect if ew passed in", async ({ codeServerPage }) => {
|
||||
const folder = process.env.CODE_FOLDER_DIR
|
||||
const workspace = process.env.CODE_WORKSPACE_DIR
|
||||
await codeServerPage.navigate(`/?folder=${folder}&workspace=${workspace}`)
|
||||
|
||||
// Closing the folder should stop the redirecting.
|
||||
await codeServerPage.navigate("/?ew=true")
|
||||
let url = new URL(codeServerPage.page.url())
|
||||
expect(url.pathname).toBe("/")
|
||||
expect(url.search).toBe("?ew=true")
|
||||
})
|
||||
},
|
||||
)
|
||||
// Closing the folder should stop the redirecting.
|
||||
await codeServerPage.navigate("/?ew=true")
|
||||
let url = new URL(codeServerPage.page.url())
|
||||
expect(url.pathname).toBe("/")
|
||||
expect(url.search).toBe("?ew=true")
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user