@@ -11,8 +11,10 @@ import * as path from 'path';
1111import parse from 'json-to-ast' ;
1212import { createCodeLensForPluginNodes } from '../codelens' ;
1313import { handleStartNotification } from '../notifications' ;
14- import { handleStatusBarUpdate } from '../statusbar' ;
14+ import { handleStatusBarUpdate , statusBarLoop } from '../statusbar' ;
1515import { testDevProxyInstall } from '../constants' ;
16+ import * as sinon from 'sinon' ;
17+ import * as detect from '../detect' ;
1618
1719suite ( 'extension' , ( ) => {
1820
@@ -487,6 +489,22 @@ suite('statusbar', () => {
487489 const actual = updatedStatusBar . text ;
488490 assert . strictEqual ( actual , expected ) ;
489491 } ) ;
492+
493+ test ( 'should show radio tower icon when devproxy is running' , async ( ) => {
494+ const stub = sinon . stub ( detect , 'isDevProxyRunning' ) . resolves ( true ) ;
495+ const context = await vscode . extensions . getExtension ( 'garrytrinder.dev-proxy-toolkit' ) ?. activate ( ) as vscode . ExtensionContext ;
496+ const statusBar = vscode . window . createStatusBarItem (
497+ vscode . StatusBarAlignment . Right ,
498+ 100
499+ ) ;
500+ await statusBarLoop ( context , statusBar ) ;
501+
502+ const expected = '$(radio-tower) Dev Proxy 0.14.1' ;
503+ const actual = statusBar . text ;
504+ stub . restore ( ) ;
505+ assert . strictEqual ( actual , expected ) ;
506+ } ) ;
507+
490508} ) ;
491509
492510suite ( 'schema' , ( ) => {
@@ -550,6 +568,6 @@ suite('schema', () => {
550568 const expected = 0 ;
551569 const actual = diagnostics . length ;
552570 assert . deepStrictEqual ( actual , expected ) ;
553- } ) ;
571+ } ) ;
554572
555573} ) ;
0 commit comments