@@ -2,8 +2,6 @@ import * as path from "path"
22import { getMaybeProxiedCodeServer } from "../utils/helpers"
33import { describe , test , expect } from "./baseFixture"
44
5- // TODO@jsjoeio - account for proxy
6-
75const flags = [ "--extensions-dir" , path . join ( __dirname , "./extensions" ) ]
86describe ( "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