@@ -93,90 +93,6 @@ suite("Authentication Integration Tests", () => {
9393( vscode . window as any ) . showInputBox = originalShowInputBox ;
9494}
9595} ) ;
96-
97- test . skip ( "should handle login with new URL entry" , async ( ) => {
98- // Test login flow when user enters a new URL
99- // This test doesn't actually verify URL entry handling, just that command accepts a parameter
100- // TODO: Would need UI automation to test the actual URL entry flow
101- } ) ;
102-
103- test . skip ( "should handle login with certificate authentication" , async ( ) => {
104- // Test mTLS authentication flow
105- } ) ;
106-
107- test . skip ( "should normalize URLs during login" , async ( ) => {
108- // Test URL normalization (https:// prefix, trailing slash removal)
109- // This test doesn't actually verify normalization, just that the command accepts URLs
110- // TODO: Would need to mock the actual normalization logic to test properly
111- } ) ;
112-
113- test . skip ( "should store credentials after successful login" , async ( ) => {
114- // Test that credentials are properly stored
115- } ) ;
116-
117- test . skip ( "should update authentication context after login" , async ( ) => {
118- // Test that coder.authenticated context is set
119- } ) ;
120-
121- test . skip ( "should detect owner role and set context" , async ( ) => {
122- // Test that coder.isOwner context is set for owners
123- } ) ;
124-
125- test . skip ( "should handle login cancellation" , async ( ) => {
126- // Test when user cancels login dialog
127- const quickPick = createIntegrationMockQuickPick < vscode . QuickPickItem > ( ) ;
128-
129- // Mock the VS Code window methods
130- const originalCreateQuickPick = vscode . window . createQuickPick ;
131-
132- try {
133- // Setup mock to return our automation-capable object
134- // eslint-disable-next-line @typescript-eslint/no-explicit-any
135- ( vscode . window as any ) . createQuickPick = ( ) => quickPick ;
136-
137- // Start the login command
138- const loginPromise = vscode . commands . executeCommand ( "coder.login" ) ;
139-
140- // Wait for UI to initialize
141- await new Promise ( ( resolve ) => setTimeout ( resolve , 50 ) ) ;
142-
143- // Simulate user cancelling
144- quickPick . simulateHide ( ) ;
145-
146- // Command should complete without throwing
147- try {
148- await loginPromise ;
149- } catch ( error ) {
150- // Expected - command was cancelled
151- }
152-
153- assert . ok ( true , "Login command handles cancellation without throwing" ) ;
154- } finally {
155- // Restore original method
156- // eslint-disable-next-line @typescript-eslint/no-explicit-any
157- ( vscode . window as any ) . createQuickPick = originalCreateQuickPick ;
158- }
159- } ) ;
160-
161- test . skip ( "should handle invalid token error" , async ( ) => {
162- // Test error handling for invalid tokens
163- } ) ;
164-
165- test . skip ( "should handle network errors during login" , async ( ) => {
166- // Test error handling for network issues
167- } ) ;
168-
169- test . skip ( "should handle certificate errors with notification" , async ( ) => {
170- // Test certificate error handling and notifications
171- } ) ;
172-
173- test . skip ( "should support autologin with default URL" , async ( ) => {
174- // Test autologin functionality
175- } ) ;
176-
177- test . skip ( "should refresh workspaces after successful login" , async ( ) => {
178- // Test that workspace list is refreshed after login
179- } ) ;
18096} ) ;
18197
18298suite ( "Logout Flow" , ( ) => {
@@ -196,120 +112,7 @@ suite("Authentication Integration Tests", () => {
196112"Logout command should be available" ,
197113) ;
198114} ) ;
199-
200- test . skip ( "should clear credentials on logout" , async ( ) => {
201- // Ensure extension is activated
202- const extension = vscode . extensions . getExtension ( "coder.coder-remote" ) ;
203- assert . ok ( extension , "Extension should be present" ) ;
204-
205- if ( ! extension . isActive ) {
206- await extension . activate ( ) ;
207- }
208-
209- // Give a small delay for commands to register
210- await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
211-
212- // Test credential clearing
213- // Logout should always succeed even if not logged in
214- try {
215- await vscode . commands . executeCommand ( "coder.logout" ) ;
216- assert . ok ( true , "Logout command executed successfully" ) ;
217- } catch ( error ) {
218- assert . fail ( "Logout should not throw errors" ) ;
219- }
220- } ) ;
221-
222- test . skip ( "should update authentication context on logout" , async ( ) => {
223- // Test that coder.authenticated context is cleared
224- } ) ;
225-
226- test . skip ( "should clear workspace list on logout" , async ( ) => {
227- // Test that workspace providers are cleared
228- } ) ;
229-
230- test . skip ( "should show logout confirmation message" , async ( ) => {
231- // Test logout notification
232- } ) ;
233-
234- test . skip ( "should handle logout when not logged in" , async ( ) => {
235- // Test error handling for logout without login
236- } ) ;
237115} ) ;
238116
239- suite ( "Token Management" , ( ) => {
240- test . skip ( "should validate token with API before accepting" , async ( ) => {
241- // Test token validation during input
242- // This test doesn't actually verify token validation, just that command accepts token parameter
243- // TODO: Would need to mock API validation to test properly
244- } ) ;
245-
246- test . skip ( "should open browser for token generation" , async ( ) => {
247- // Ensure extension is activated
248- const extension = vscode . extensions . getExtension ( "coder.coder-remote" ) ;
249- assert . ok ( extension , "Extension should be present" ) ;
250-
251- if ( ! extension . isActive ) {
252- await extension . activate ( ) ;
253- }
254-
255- // Give a small delay for commands to register
256- await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
257-
258- // Test opening /cli-auth page
259- const originalOpenExternal = vscode . env . openExternal ;
260- let _browserOpened = false ;
261-
262- // Create a mock to simulate cancellation
263- const quickPick = createIntegrationMockQuickPick < vscode . QuickPickItem > ( ) ;
264- const originalCreateQuickPick = vscode . window . createQuickPick ;
265-
266- try {
267- // Mock openExternal
268- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/require-await
269- ( vscode . env as any ) . openExternal = async ( uri :vscode . Uri ) => {
270- if ( uri . toString ( ) . includes ( "/cli-auth" ) ) {
271- _browserOpened = true ;
272- }
273- return true ;
274- } ;
275-
276- // Mock createQuickPick to avoid hanging
277- // eslint-disable-next-line @typescript-eslint/no-explicit-any
278- ( vscode . window as any ) . createQuickPick = ( ) => quickPick ;
279-
280- // Start the login command
281- const loginPromise = vscode . commands . executeCommand (
282- "coder.login" ,
283- "https://test.coder.com" ,
284- ) ;
285-
286- // Wait a bit then cancel to avoid timeout
287- await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
288- quickPick . simulateHide ( ) ;
289-
290- // Wait for command to complete or fail
291- try {
292- await loginPromise ;
293- } catch ( error ) {
294- // Expected to fail without token
295- }
296- } finally {
297- // eslint-disable-next-line @typescript-eslint/no-explicit-any
298- ( vscode . env as any ) . openExternal = originalOpenExternal ;
299- // eslint-disable-next-line @typescript-eslint/no-explicit-any
300- ( vscode . window as any ) . createQuickPick = originalCreateQuickPick ;
301- }
302-
303- // Browser opening might be skipped in test environment
304- assert . ok ( true , "Login command can open browser for token generation" ) ;
305- } ) ;
306-
307- test . skip ( "should handle token refresh" , async ( ) => {
308- // Test token refresh scenarios
309- } ) ;
310-
311- test . skip ( "should configure CLI with token" , async ( ) => {
312- // Test CLI configuration file creation
313- } ) ;
314- } ) ;
117+ suite ( "Token Management" , ( ) => { } ) ;
315118} ) ;