Skip to content

Commit 1e1463d

Browse files
committed
update test
1 parent cf70e61 commit 1e1463d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/codewhisperer/service/keyStrokeHandler.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import * as EditorContext from '../../../codewhisperer/util/editorContext'
1919
import { RecommendationHandler } from '../../../codewhisperer/service/recommendationHandler'
2020
import { isInlineCompletionEnabled } from '../../../codewhisperer/util/commonUtil'
2121
import { ClassifierTrigger } from '../../../codewhisperer/service/classifierTrigger'
22+
import { CodeWhispererUserGroupSettings } from '../../../codewhisperer/util/userGroupUtil'
23+
import * as CodeWhispererConstants from '../../../codewhisperer/models/constants'
2224

2325
const performance = globalThis.performance ?? require('perf_hooks').performance
2426

@@ -47,6 +49,7 @@ describe('keyStrokeHandler', function () {
4749
})
4850
afterEach(function () {
4951
sinon.restore()
52+
CodeWhispererUserGroupSettings.instance.reset()
5053
})
5154

5255
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 () {
188191
assert.ok(!startTimerSpy.called)
189192
})
190193

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 () {
192195
const mockEditor = createMockTextEditor('def addTwo', 'test.rb', 'ruby')
193196
const mockEvent: vscode.TextDocumentChangeEvent = createTextDocumentChangeEvent(
194197
mockEditor.document,
195198
new vscode.Range(new vscode.Position(0, 0), new vscode.Position(0, 1)),
196199
'a'
197200
)
201+
CodeWhispererUserGroupSettings.instance.userGroup = CodeWhispererConstants.UserGroup.Control
198202
await KeyStrokeHandler.instance.processKeyStroke(mockEvent, mockEditor, mockClient, config)
199203
assert.ok(startTimerSpy.called)
200204
})

0 commit comments

Comments
 (0)