@@ -7,20 +7,21 @@ import assert from 'assert'
77import sinon from 'sinon'
88import { initMessageHandler } from '../../../applicationcomposer/messageHandlers/initMessageHandler'
99import { createTemplate , createWebviewContext } from '../utils'
10+ import { env } from '../../../shared'
1011
11- //eslint-disable-next-line aws-toolkits/no-only-in-tests
12- describe . only ( 'initMessageHandler' , function ( ) {
13- for ( const _ of Array . from ( { length : 1000 } , ( i ) => i ) ) {
14- it ( 'not connected to codewhisperer' , async function ( ) {
15- const panel = await createTemplate ( )
16- const postMessageSpy = sinon . spy ( panel . webview , 'postMessage' )
17- const context = await createWebviewContext ( {
18- panel,
19- } )
20- await initMessageHandler ( context )
21- assert . ok ( postMessageSpy . calledOnce )
22- assert . deepStrictEqual ( postMessageSpy . getCall ( 0 ) . args [ 0 ] . isConnectedToCodeWhisperer , false )
23- postMessageSpy . restore ( )
12+ describe ( 'initMessageHandler' , function ( ) {
13+ it ( 'not connected to codewhisperer' , async function ( ) {
14+ if ( env . isMinVscode ( '1.89.0' ) ) {
15+ this . skip ( )
16+ }
17+ const panel = await createTemplate ( )
18+ const postMessageSpy = sinon . spy ( panel . webview , 'postMessage' )
19+ const context = await createWebviewContext ( {
20+ panel,
2421 } )
25- }
22+ await initMessageHandler ( context )
23+ assert . ok ( postMessageSpy . calledOnce )
24+ assert . deepStrictEqual ( postMessageSpy . getCall ( 0 ) . args [ 0 ] . isConnectedToCodeWhisperer , false )
25+ postMessageSpy . restore ( )
26+ } )
2627} )
0 commit comments