Skip to content

Commit 2bf0a0e

Browse files
committed
refactor: fix tests to check visibility correctly
1 parent 2665a4f commit 2bf0a0e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

test/e2e/globalSetup.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ test.describe("globalSetup", () => {
2020
test("should keep us logged in using the storageState", options, async ({ page }) => {
2121
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
2222
// Make sure the editor actually loaded
23-
expect(await page.isVisible("div.monaco-workbench"))
23+
expect(await page.isVisible("div.monaco-workbench")).toBe(true)
2424
})
2525
})

test/e2e/login.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test.describe("login", () => {
2424
await page.click(".submit")
2525
await page.waitForLoadState("networkidle")
2626
// Make sure the editor actually loaded
27-
expect(await page.isVisible("div.monaco-workbench"))
27+
expect(await page.isVisible("div.monaco-workbench")).toBe(true)
2828
})
2929

3030
test("should see an error message for missing password", options, async ({ page }) => {

test/e2e/logout.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ test.describe("logout", () => {
1717
await page.click(".submit")
1818
await page.waitForLoadState("networkidle")
1919
// Make sure the editor actually loaded
20-
expect(await page.isVisible("div.monaco-workbench"))
20+
expect(await page.isVisible("div.monaco-workbench")).toBe(true)
2121

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

2525
// See the Log out button
2626
const logoutButton = "a.action-menu-item span[aria-label='Log out']"
27-
expect(await page.isVisible(logoutButton))
27+
expect(await page.isVisible(logoutButton)).toBe(true)
2828

2929
await page.hover(logoutButton)
3030
// TODO(@jsjoeio)

test/e2e/openHelpAbout.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@ test.describe("Open Help > About", () => {
2121
async ({ page }) => {
2222
await page.goto(CODE_SERVER_ADDRESS, { waitUntil: "networkidle" })
2323
// Make sure the editor actually loaded
24-
expect(await page.isVisible("div.monaco-workbench"))
24+
expect(await page.isVisible("div.monaco-workbench")).toBe(true)
2525

2626
// Click the Application menu
2727
await page.click("[aria-label='Application Menu']")
2828
// See the Help button
2929
const helpButton = "a.action-menu-item span[aria-label='Help']"
30-
expect(await page.isVisible(helpButton))
30+
expect(await page.isVisible(helpButton)).toBe(true)
3131

3232
// Hover the helpButton
3333
await page.hover(helpButton)
3434

3535
// see the About button and click it
3636
const aboutButton = "a.action-menu-item span[aria-label='About']"
37-
expect(await page.isVisible(aboutButton))
37+
expect(await page.isVisible(aboutButton)).toBe(true)
3838
// NOTE: it won't work unless you hover it first
3939
await page.hover(aboutButton)
4040
await page.click(aboutButton)
4141

4242
const codeServerText = "text=code-server"
43-
expect(await page.isVisible(codeServerText))
43+
expect(await page.isVisible(codeServerText)).toBe(true)
4444
},
4545
)
4646
})

0 commit comments

Comments
 (0)