Refresh explorer after creating file

The watcher seems to not be catching this...unsure if it is a bug yet.
This commit is contained in:
Asher 2024-06-10 12:37:40 -08:00
parent abe158412c
commit ccc5f82193
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
2 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
const workspaceDir = await codeServerPage.workspaceDir const workspaceDir = await codeServerPage.workspaceDir
const tmpFilePath = path.join(workspaceDir, "unique-file.txt") const tmpFilePath = path.join(workspaceDir, "unique-file.txt")
await fs.writeFile(tmpFilePath, "hello world") await fs.writeFile(tmpFilePath, "hello world")
await codeServerPage.executeCommandViaMenus("Refresh Explorer")
// Action // Action
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt") const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
@ -30,6 +31,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
const fileName = "unique-file-save-as.txt" const fileName = "unique-file-save-as.txt"
const tmpFilePath = path.join(workspaceDir, fileName) const tmpFilePath = path.join(workspaceDir, fileName)
await fs.writeFile(tmpFilePath, "Hello World") await fs.writeFile(tmpFilePath, "Hello World")
await codeServerPage.executeCommandViaMenus("Refresh Explorer")
// Action // Action
await codeServerPage.page.waitForSelector(`text=${fileName}`) await codeServerPage.page.waitForSelector(`text=${fileName}`)
@ -71,6 +73,7 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
const workspaceDir = await codeServerPage.workspaceDir const workspaceDir = await codeServerPage.workspaceDir
const tmpFilePath = path.join(workspaceDir, "unique-file.txt") const tmpFilePath = path.join(workspaceDir, "unique-file.txt")
await fs.writeFile(tmpFilePath, "Hello World") await fs.writeFile(tmpFilePath, "Hello World")
await codeServerPage.executeCommandViaMenus("Refresh Explorer")
// Action // Action
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt") const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
@ -87,6 +90,7 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
const fileName = "unique-file-save-as.txt" const fileName = "unique-file-save-as.txt"
const tmpFilePath = path.join(workspaceDir, fileName) const tmpFilePath = path.join(workspaceDir, fileName)
await fs.writeFile(tmpFilePath, "Hello World") await fs.writeFile(tmpFilePath, "Hello World")
await codeServerPage.executeCommandViaMenus("Refresh Explorer")
// Action // Action
await codeServerPage.page.waitForSelector(`text=${fileName}`) await codeServerPage.page.waitForSelector(`text=${fileName}`)

View File

@ -14,6 +14,7 @@ describe("Uploads (enabled)", ["--disable-workspace-trust"], {}, () => {
const workspaceDir = await codeServerPage.workspaceDir const workspaceDir = await codeServerPage.workspaceDir
const tmpDirPath = path.join(workspaceDir, "test-directory") const tmpDirPath = path.join(workspaceDir, "test-directory")
await fs.mkdir(tmpDirPath) await fs.mkdir(tmpDirPath)
await codeServerPage.executeCommandViaMenus("Refresh Explorer")
// Action // Action
const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")') const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")')
@ -42,6 +43,7 @@ describe("Uploads (disabled)", ["--disable-workspace-trust", "--disable-file-upl
const workspaceDir = await codeServerPage.workspaceDir const workspaceDir = await codeServerPage.workspaceDir
const tmpDirPath = path.join(workspaceDir, "test-directory") const tmpDirPath = path.join(workspaceDir, "test-directory")
await fs.mkdir(tmpDirPath) await fs.mkdir(tmpDirPath)
await codeServerPage.executeCommandViaMenus("Refresh Explorer")
// Action // Action
const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")') const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")')