@@ -19,6 +19,8 @@ import * as EditorContext from '../../../codewhisperer/util/editorContext'
19
19
import { RecommendationHandler } from '../../../codewhisperer/service/recommendationHandler'
20
20
import { isInlineCompletionEnabled } from '../../../codewhisperer/util/commonUtil'
21
21
import { ClassifierTrigger } from '../../../codewhisperer/service/classifierTrigger'
22
+ import { CodeWhispererUserGroupSettings } from '../../../codewhisperer/util/userGroupUtil'
23
+ import * as CodeWhispererConstants from '../../../codewhisperer/models/constants'
22
24
23
25
const performance = globalThis . performance ?? require ( 'perf_hooks' ) . performance
24
26
@@ -47,6 +49,7 @@ describe('keyStrokeHandler', function () {
47
49
} )
48
50
afterEach ( function ( ) {
49
51
sinon . restore ( )
52
+ CodeWhispererUserGroupSettings . instance . reset ( )
50
53
} )
51
54
52
55
it ( 'Whatever the input is, should skip when automatic trigger is turned off, should not call invokeAutomatedTrigger' , async function ( ) {
@@ -188,13 +191,14 @@ describe('keyStrokeHandler', function () {
188
191
assert . ok ( ! startTimerSpy . called )
189
192
} )
190
193
191
- it ( 'Should start idle trigger timer when inputing non-special characters for non-classifier language ' , async function ( ) {
194
+ it ( 'Should start idle trigger timer when inputing non-special characters for not all classifier languages for non-classifier group ' , async function ( ) {
192
195
const mockEditor = createMockTextEditor ( 'def addTwo' , 'test.rb' , 'ruby' )
193
196
const mockEvent : vscode . TextDocumentChangeEvent = createTextDocumentChangeEvent (
194
197
mockEditor . document ,
195
198
new vscode . Range ( new vscode . Position ( 0 , 0 ) , new vscode . Position ( 0 , 1 ) ) ,
196
199
'a'
197
200
)
201
+ CodeWhispererUserGroupSettings . instance . userGroup = CodeWhispererConstants . UserGroup . Control
198
202
await KeyStrokeHandler . instance . processKeyStroke ( mockEvent , mockEditor , mockClient , config )
199
203
assert . ok ( startTimerSpy . called )
200
204
} )
0 commit comments