Skip to content

fix: add handle for resolveExternalUri #5624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Oct 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add test for VSCODE_PROXY_URI
  • Loading branch information
jsjoeio committed Oct 13, 2022
commit 7a75bd08007b226ee6d31d9a9ef0e23165deb938
26 changes: 24 additions & 2 deletions test/e2e/asExternalUri.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import * as path from "path"
import { getMaybeProxiedCodeServer } from "../utils/helpers"
import { describe, test, expect } from "./baseFixture"

// TODO@jsjoeio - account for proxy

const flags = ["--extensions-dir", path.join(__dirname, "./extensions")]
describe("asExternalUri", flags, {}, () => {
test("should use /proxy/port", async ({ codeServerPage }) => {
Expand All @@ -24,3 +22,27 @@ describe("asExternalUri", flags, {}, () => {
expect(text).toBe(`Info: input: ${input} output: ${expected}`)
})
})

describe(
"asExternalUri",
flags,
{ VSCODE_PROXY_URI: "https://{{port}}-main-workspace-name-user-name.coder.com" },
() => {
test("should use VSCODE_PROXY_URI", async ({ codeServerPage }) => {
// Given
const port = "3000"
const input = `http://localhost:${port}`
const expected = `https://${port}-main-workspace-name-user-name.coder.com/`

// When
await codeServerPage.waitForTestExtensionLoaded()
await codeServerPage.executeCommandViaMenus("code-server: asExternalUri test")
await codeServerPage.page.type(".quick-input-widget", input)
await codeServerPage.page.keyboard.press("Enter")

// Then
const text = await codeServerPage.page.locator("text=output").first().textContent()
expect(text).toBe(`Info: input: ${input} output: ${expected}`)
})
},
)