@@ -8,7 +8,7 @@ import { LanguageClient } from 'vscode-languageclient'
88import { AuthUtil } from 'aws-core-vscode/codewhisperer'
99import { registerMessageListeners } from '../../../../../src/lsp/chat/messages'
1010import { AmazonQChatViewProvider } from '../../../../../src/lsp/chat/webviewProvider'
11- import { secondaryAuth , authConnection , AuthFollowUpType } from 'aws-core-vscode/amazonq'
11+ import { AuthFollowUpType } from 'aws-core-vscode/amazonq'
1212import { messages } from 'aws-core-vscode/shared'
1313
1414describe ( 'registerMessageListeners' , ( ) => {
@@ -49,7 +49,7 @@ describe('registerMessageListeners', () => {
4949
5050 describe ( 'AUTH_FOLLOW_UP_CLICKED' , ( ) => {
5151 let mockAuthUtil : AuthUtil
52- let deleteConnectionStub : sinon . SinonStub
52+ let logoutStub : sinon . SinonStub
5353 let reauthenticateStub : sinon . SinonStub
5454
5555 const authFollowUpClickedCommand = 'authFollowUpClicked'
@@ -75,14 +75,12 @@ describe('registerMessageListeners', () => {
7575 }
7676
7777 beforeEach ( ( ) => {
78- deleteConnectionStub = sandbox . stub ( ) . resolves ( )
7978 reauthenticateStub = sandbox . stub ( ) . resolves ( )
79+ logoutStub = sandbox . stub ( ) . resolves ( )
8080
8181 mockAuthUtil = {
8282 reauthenticate : reauthenticateStub ,
83- secondaryAuth : {
84- deleteConnection : deleteConnectionStub ,
85- } as unknown as secondaryAuth . SecondaryAuth < authConnection . Connection > ,
83+ logout : logoutStub ,
8684 } as unknown as AuthUtil
8785
8886 sandbox . replaceGetter ( AuthUtil , 'instance' , ( ) => mockAuthUtil )
@@ -97,7 +95,7 @@ describe('registerMessageListeners', () => {
9795 } )
9896
9997 sinon . assert . calledOnce ( reauthenticateStub )
100- sinon . assert . notCalled ( deleteConnectionStub )
98+ sinon . assert . notCalled ( logoutStub )
10199 } )
102100
103101 it ( 'handles full authentication request' , async ( ) => {
@@ -109,7 +107,7 @@ describe('registerMessageListeners', () => {
109107 } )
110108
111109 sinon . assert . notCalled ( reauthenticateStub )
112- sinon . assert . calledOnce ( deleteConnectionStub )
110+ sinon . assert . calledOnce ( logoutStub )
113111 } )
114112
115113 it ( 'logs error if re-authentication fails' , async ( ) => {
@@ -123,7 +121,7 @@ describe('registerMessageListeners', () => {
123121 it ( 'logs error if full authentication fails' , async ( ) => {
124122 await testFailure ( {
125123 authType : 'full-auth' ,
126- stubToReject : deleteConnectionStub ,
124+ stubToReject : logoutStub ,
127125 errorMessage : 'Failed to authenticate' ,
128126 } )
129127 } )
0 commit comments