@@ -17,7 +17,7 @@ describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
17
17
const url = new URL ( codeServerPage . page . url ( ) )
18
18
expect ( url . pathname ) . toBe ( route )
19
19
20
- // TODO@jsjoeio
20
+ // TODO@jsjoeio
21
21
// now that we are in a proper browser instead of scraping the HTML we
22
22
// could possibly intercept requests to make sure assets are loading from
23
23
// the right spot.
@@ -73,43 +73,33 @@ describe(
73
73
} ,
74
74
)
75
75
76
- describe (
77
- "VS Code Routes with no workspace or folder" ,
78
- [ "--disable-workspace-trust" ] ,
79
- { } ,
80
- async ( ) => {
81
- test ( "should redirect to last query folder/workspace" , async ( { codeServerPage } ) => {
82
- const folder = process . env . CODE_FOLDER_DIR
83
- const workspace = process . env . CODE_WORKSPACE_DIR
84
- await codeServerPage . navigate ( `/?folder=${ folder } &workspace=${ workspace } ` )
76
+ describe ( "VS Code Routes with no workspace or folder" , [ "--disable-workspace-trust" ] , { } , async ( ) => {
77
+ test ( "should redirect to last query folder/workspace" , async ( { codeServerPage } ) => {
78
+ const folder = process . env . CODE_FOLDER_DIR
79
+ const workspace = process . env . CODE_WORKSPACE_DIR
80
+ await codeServerPage . navigate ( `/?folder=${ folder } &workspace=${ workspace } ` )
85
81
86
- // If you visit again without query parameters it will re-attach them by
87
- // redirecting. It should always redirect to the same route.
88
- for ( const route of routes ) {
89
- await codeServerPage . navigate ( route )
90
- const url = new URL ( codeServerPage . page . url ( ) )
91
- expect ( url . pathname ) . toBe ( route )
92
- expect ( url . search ) . toBe ( `?folder=${ folder } &workspace=${ workspace } ` )
93
- }
94
- } )
95
- } ,
96
- )
82
+ // If you visit again without query parameters it will re-attach them by
83
+ // redirecting. It should always redirect to the same route.
84
+ for ( const route of routes ) {
85
+ await codeServerPage . navigate ( route )
86
+ const url = new URL ( codeServerPage . page . url ( ) )
87
+ expect ( url . pathname ) . toBe ( route )
88
+ expect ( url . search ) . toBe ( `?folder=${ folder } &workspace=${ workspace } ` )
89
+ }
90
+ } )
91
+ } )
97
92
98
- describe (
99
- "VS Code Routes with no workspace or folder" ,
100
- [ "--disable-workspace-trust" ] ,
101
- { } ,
102
- async ( ) => {
103
- test ( "should not redirect if ew passed in" , async ( { codeServerPage } ) => {
104
- const folder = process . env . CODE_FOLDER_DIR
105
- const workspace = process . env . CODE_WORKSPACE_DIR
106
- await codeServerPage . navigate ( `/?folder=${ folder } &workspace=${ workspace } ` )
93
+ describe ( "VS Code Routes with no workspace or folder" , [ "--disable-workspace-trust" ] , { } , async ( ) => {
94
+ test ( "should not redirect if ew passed in" , async ( { codeServerPage } ) => {
95
+ const folder = process . env . CODE_FOLDER_DIR
96
+ const workspace = process . env . CODE_WORKSPACE_DIR
97
+ await codeServerPage . navigate ( `/?folder=${ folder } &workspace=${ workspace } ` )
107
98
108
- // Closing the folder should stop the redirecting.
109
- await codeServerPage . navigate ( "/?ew=true" )
110
- let url = new URL ( codeServerPage . page . url ( ) )
111
- expect ( url . pathname ) . toBe ( "/" )
112
- expect ( url . search ) . toBe ( "?ew=true" )
113
- } )
114
- } ,
115
- )
99
+ // Closing the folder should stop the redirecting.
100
+ await codeServerPage . navigate ( "/?ew=true" )
101
+ let url = new URL ( codeServerPage . page . url ( ) )
102
+ expect ( url . pathname ) . toBe ( "/" )
103
+ expect ( url . search ) . toBe ( "?ew=true" )
104
+ } )
105
+ } )
0 commit comments