Skip to content

Commit

Permalink
Same fix for upload tests
Browse files Browse the repository at this point in the history
  • Loading branch information
code-asher committed Sep 19, 2024
1 parent 1676fd9 commit dea5e8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 0 additions & 2 deletions test/e2e/downloads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
// Action
await codeServerPage.openContextMenu("text=unique-file.txt")

await codeServerPage.page.waitForSelector(".context-view-block")
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true)
})

Expand Down Expand Up @@ -73,7 +72,6 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
// Action
await codeServerPage.openContextMenu("text=unique-file.txt")

await codeServerPage.page.waitForSelector(".context-view-block")
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false)
})

Expand Down
1 change: 1 addition & 0 deletions test/e2e/models/CodeServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ export class CodeServerPage {
const el = await this.page.waitForSelector(selector)
await el.click({ button: "left" })
await this.page.keyboard.press("Shift+F10")
await this.page.waitForSelector(".context-view-block")
}

/**
Expand Down
11 changes: 3 additions & 8 deletions test/e2e/uploads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ describe("Uploads (enabled)", ["--disable-workspace-trust"], {}, () => {
await fs.mkdir(tmpDirPath)

// Action
const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")')
await fileInExplorer.click({
button: "right",
})
await codeServerPage.openContextMenu('span:has-text("test-directory")')

expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(true)
})

Expand All @@ -44,10 +42,7 @@ describe("Uploads (disabled)", ["--disable-workspace-trust", "--disable-file-upl
await fs.mkdir(tmpDirPath)

// Action
const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")')
await fileInExplorer.click({
button: "right",
})
await codeServerPage.openContextMenu('span:has-text("test-directory")')

expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(false)
})
Expand Down

0 comments on commit dea5e8d

Please sign in to comment.