@@ -2,8 +2,6 @@ import * as path from "path"
2
2
import { getMaybeProxiedCodeServer } from "../utils/helpers"
3
3
import { describe , test , expect } from "./baseFixture"
4
4
5
- // TODO@jsjoeio - account for proxy
6
-
7
5
const flags = [ "--extensions-dir" , path . join ( __dirname , "./extensions" ) ]
8
6
describe ( "asExternalUri" , flags , { } , ( ) => {
9
7
test ( "should use /proxy/port" , async ( { codeServerPage } ) => {
@@ -24,3 +22,27 @@ describe("asExternalUri", flags, {}, () => {
24
22
expect ( text ) . toBe ( `Info: input: ${ input } output: ${ expected } ` )
25
23
} )
26
24
} )
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