@@ -7,16 +7,12 @@ import * as vscode from 'vscode'
77import assert from 'assert'
88import * as sinon from 'sinon'
99import {
10- CodeWhispererStatusBarManager ,
1110 InlineCompletionService ,
1211 ReferenceInlineProvider ,
1312 RecommendationHandler ,
14- CodeSuggestionsState ,
1513 ConfigurationEntry ,
1614 CWInlineCompletionItemProvider ,
1715 session ,
18- AuthUtil ,
19- listCodeWhispererCommandsId ,
2016 DefaultCodeWhispererClient ,
2117} from 'aws-core-vscode/codewhisperer'
2218import { createMockTextEditor , resetCodeWhispererGlobalVariables , createMockDocument } from 'aws-core-vscode/test'
@@ -175,81 +171,3 @@ describe('CWInlineCompletionProvider', function () {
175171 } )
176172 } )
177173} )
178-
179- describe ( 'codewhisperer status bar' , function ( ) {
180- let sandbox : sinon . SinonSandbox
181- let statusBar : TestStatusBar
182- let service : InlineCompletionService
183-
184- class TestStatusBar extends CodeWhispererStatusBarManager {
185- constructor ( ) {
186- super ( )
187- }
188-
189- getStatusBar ( ) {
190- return this . statusBar
191- }
192- }
193-
194- beforeEach ( async function ( ) {
195- await resetCodeWhispererGlobalVariables ( )
196- sandbox = sinon . createSandbox ( )
197- statusBar = new TestStatusBar ( )
198- service = new InlineCompletionService ( statusBar )
199- } )
200-
201- afterEach ( function ( ) {
202- sandbox . restore ( )
203- } )
204-
205- it ( 'shows correct status bar when auth is not connected' , async function ( ) {
206- sandbox . stub ( AuthUtil . instance , 'isConnectionValid' ) . returns ( false )
207- sandbox . stub ( AuthUtil . instance , 'isConnectionExpired' ) . returns ( false )
208-
209- await service . refreshStatusBar ( )
210-
211- const actualStatusBar = statusBar . getStatusBar ( )
212- assert . strictEqual ( actualStatusBar . text , '$(chrome-close) Amazon Q' )
213- assert . strictEqual ( actualStatusBar . command , listCodeWhispererCommandsId )
214- assert . deepStrictEqual ( actualStatusBar . backgroundColor , new vscode . ThemeColor ( 'statusBarItem.errorBackground' ) )
215- } )
216-
217- it ( 'shows correct status bar when auth is connected' , async function ( ) {
218- sandbox . stub ( AuthUtil . instance , 'isConnectionValid' ) . returns ( true )
219- sandbox . stub ( CodeSuggestionsState . instance , 'isSuggestionsEnabled' ) . returns ( true )
220-
221- await service . refreshStatusBar ( )
222-
223- const actualStatusBar = statusBar . getStatusBar ( )
224- assert . strictEqual ( actualStatusBar . text , '$(debug-start) Amazon Q' )
225- assert . strictEqual ( actualStatusBar . command , listCodeWhispererCommandsId )
226- assert . deepStrictEqual ( actualStatusBar . backgroundColor , undefined )
227- } )
228-
229- it ( 'shows correct status bar when auth is connected but paused' , async function ( ) {
230- sandbox . stub ( AuthUtil . instance , 'isConnectionValid' ) . returns ( true )
231- sandbox . stub ( CodeSuggestionsState . instance , 'isSuggestionsEnabled' ) . returns ( false )
232-
233- await service . refreshStatusBar ( )
234-
235- const actualStatusBar = statusBar . getStatusBar ( )
236- assert . strictEqual ( actualStatusBar . text , '$(debug-pause) Amazon Q' )
237- assert . strictEqual ( actualStatusBar . command , listCodeWhispererCommandsId )
238- assert . deepStrictEqual ( actualStatusBar . backgroundColor , undefined )
239- } )
240-
241- it ( 'shows correct status bar when auth is expired' , async function ( ) {
242- sandbox . stub ( AuthUtil . instance , 'isConnectionValid' ) . returns ( false )
243- sandbox . stub ( AuthUtil . instance , 'isConnectionExpired' ) . returns ( true )
244-
245- await service . refreshStatusBar ( )
246-
247- const actualStatusBar = statusBar . getStatusBar ( )
248- assert . strictEqual ( actualStatusBar . text , '$(debug-disconnect) Amazon Q' )
249- assert . strictEqual ( actualStatusBar . command , listCodeWhispererCommandsId )
250- assert . deepStrictEqual (
251- actualStatusBar . backgroundColor ,
252- new vscode . ThemeColor ( 'statusBarItem.warningBackground' )
253- )
254- } )
255- } )
0 commit comments