Skip to content

Commit 7a75bd0

Browse files
committed
feat: add test for VSCODE_PROXY_URI
1 parent a4ed692 commit 7a75bd0

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

test/e2e/asExternalUri.test.ts

+24-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import * as path from "path"
22
import { getMaybeProxiedCodeServer } from "../utils/helpers"
33
import { describe, test, expect } from "./baseFixture"
44

5-
// TODO@jsjoeio - account for proxy
6-
75
const flags = ["--extensions-dir", path.join(__dirname, "./extensions")]
86
describe("asExternalUri", flags, {}, () => {
97
test("should use /proxy/port", async ({ codeServerPage }) => {
@@ -24,3 +22,27 @@ describe("asExternalUri", flags, {}, () => {
2422
expect(text).toBe(`Info: input: ${input} output: ${expected}`)
2523
})
2624
})
25+
26+
describe(
27+
"asExternalUri",
28+
flags,
29+
{ VSCODE_PROXY_URI: "https://{{port}}-main-workspace-name-user-name.coder.com" },
30+
() => {
31+
test("should use VSCODE_PROXY_URI", async ({ codeServerPage }) => {
32+
// Given
33+
const port = "3000"
34+
const input = `http://localhost:${port}`
35+
const expected = `https://${port}-main-workspace-name-user-name.coder.com/`
36+
37+
// When
38+
await codeServerPage.waitForTestExtensionLoaded()
39+
await codeServerPage.executeCommandViaMenus("code-server: asExternalUri test")
40+
await codeServerPage.page.type(".quick-input-widget", input)
41+
await codeServerPage.page.keyboard.press("Enter")
42+
43+
// Then
44+
const text = await codeServerPage.page.locator("text=output").first().textContent()
45+
expect(text).toBe(`Info: input: ${input} output: ${expected}`)
46+
})
47+
},
48+
)

0 commit comments

Comments
 (0)