Skip to content

Commit fb3fecf

Browse files
committed
feat: add e2e test for asExternalUri
1 parent 21cb2de commit fb3fecf

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/e2e/asExternalUri.test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as path from "path"
2+
import { getMaybeProxiedCodeServer } from "../utils/helpers"
3+
import { describe, test, expect } from "./baseFixture"
4+
5+
// TODO@jsjoeio - account for proxy
6+
7+
const flags = ["--extensions-dir", path.join(__dirname, "./extensions")]
8+
describe("asExternalUri", flags, {}, () => {
9+
test("should use /proxy/port", async ({ codeServerPage }) => {
10+
// Given
11+
const port = "3000"
12+
const input = `http://localhost:${port}`
13+
const address = await getMaybeProxiedCodeServer(codeServerPage)
14+
const expected = `${address}/proxy/${port}`
15+
16+
// When
17+
await codeServerPage.waitForTestExtensionLoaded()
18+
await codeServerPage.executeCommandViaMenus("code-server: asExternalUri test")
19+
await codeServerPage.page.type(".quick-input-widget", input)
20+
await codeServerPage.page.keyboard.press("Enter")
21+
22+
// Then
23+
const text = await codeServerPage.page.locator("text=output").first().textContent()
24+
expect(text).toBe(`Info: input: ${input} output: ${expected}`)
25+
})
26+
})

0 commit comments

Comments
 (0)