Skip to content

Commit 1381081

Browse files
committed
refactor: check for editor consistently in tests
1 parent ddeebfe commit 1381081

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

test/e2e/globalSetup.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@ describe("globalSetup", () => {
1010
const storageState = JSON.parse(STORAGE) || {}
1111
await jestPlaywright.resetContext({
1212
storageState,
13-
logger: {
14-
isEnabled: (name, severity) => name === "browser",
15-
log: (name, severity, message, args) => console.log(`${name} ${message}`),
16-
},
1713
})
1814
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
1915
})
2016

2117
it("should keep us logged in using the storageState", async () => {
22-
// See the editor
23-
const codeServerEditor = await page.isVisible(".monaco-workbench")
24-
expect(codeServerEditor).toBeTruthy()
18+
// Make sure the editor actually loaded
19+
expect(await page.isVisible("div.monaco-workbench"))
2520
})
2621
})

test/e2e/login.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
33

44
describe("login", () => {
55
beforeEach(async () => {
6-
await jestPlaywright.resetBrowser({
7-
logger: {
8-
isEnabled: (name, severity) => name === "browser",
9-
log: (name, severity, message, args) => console.log(`${name} ${message}`),
10-
},
11-
})
6+
await jestPlaywright.resetBrowser()
127
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
138
})
149

@@ -18,8 +13,7 @@ describe("login", () => {
1813
// Click the submit button and login
1914
await page.click(".submit")
2015
await page.waitForLoadState("networkidle")
21-
// See the editor
22-
const codeServerEditor = await page.isVisible(".monaco-workbench")
23-
expect(codeServerEditor).toBeTruthy()
16+
// Make sure the editor actually loaded
17+
expect(await page.isVisible("div.monaco-workbench"))
2418
})
2519
})

test/e2e/logout.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ import { CODE_SERVER_ADDRESS, PASSWORD } from "../utils/constants"
33

44
describe("logout", () => {
55
beforeEach(async () => {
6-
await jestPlaywright.resetBrowser({
7-
logger: {
8-
isEnabled: (name, severity) => name === "browser",
9-
log: (name, severity, message, args) => console.log(`${name} ${message}`),
10-
},
11-
})
6+
await jestPlaywright.resetBrowser()
127
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
138
})
149

@@ -18,9 +13,8 @@ describe("logout", () => {
1813
// Click the submit button and login
1914
await page.click(".submit")
2015
await page.waitForLoadState("networkidle")
21-
// See the editor
22-
const codeServerEditor = await page.isVisible(".monaco-workbench")
23-
expect(codeServerEditor).toBeTruthy()
16+
// Make sure the editor actually loaded
17+
expect(await page.isVisible("div.monaco-workbench"))
2418

2519
// Click the Application menu
2620
await page.click("[aria-label='Application Menu']")

test/e2e/openHelpAbout.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ describe("Open Help > About", () => {
88
const storageState = JSON.parse(STORAGE) || {}
99
await jestPlaywright.resetContext({
1010
storageState,
11-
logger: {
12-
isEnabled: (name, severity) => name === "browser",
13-
log: (name, severity, message, args) => console.log(`${name} ${message}`),
14-
},
1511
})
1612
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
1713
})

0 commit comments

Comments
 (0)