Skip to content

Commit 015eb76

Browse files
committed
remove usage of usergroup from tests
1 parent 2268750 commit 015eb76

File tree

4 files changed

+5
-40
lines changed

4 files changed

+5
-40
lines changed

packages/amazonq/test/unit/codewhisperer/commands/onAcceptance.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as vscode from 'vscode'
88
import * as sinon from 'sinon'
99
import {
1010
onAcceptance,
11-
UserGroup,
1211
AcceptedSuggestionEntry,
1312
session,
1413
CodeWhispererTracker,
@@ -17,8 +16,6 @@ import {
1716
} from 'aws-core-vscode/codewhisperer'
1817
import { resetCodeWhispererGlobalVariables, createMockTextEditor } from 'aws-core-vscode/test'
1918
import { assertTelemetryCurried } from 'aws-core-vscode/test'
20-
import { globals } from 'aws-core-vscode/shared'
21-
import { extensionVersion } from 'aws-core-vscode/shared'
2219

2320
describe('onAcceptance', function () {
2421
describe('onAcceptance', function () {
@@ -73,11 +70,6 @@ describe('onAcceptance', function () {
7370
})
7471

7572
it('Should report telemetry that records this user decision event', async function () {
76-
await globals.globalState.update('CODEWHISPERER_USER_GROUP', {
77-
group: UserGroup.Control,
78-
version: extensionVersion,
79-
})
80-
8173
const testStartUrl = 'testStartUrl'
8274
sinon.stub(AuthUtil.instance, 'startUrl').value(testStartUrl)
8375
const mockEditor = createMockTextEditor()

packages/amazonq/test/unit/codewhisperer/service/keyStrokeHandler.test.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ import {
1313
resetCodeWhispererGlobalVariables,
1414
} from 'aws-core-vscode/test'
1515
import * as EditorContext from 'aws-core-vscode/codewhisperer'
16-
import * as CodeWhispererConstants from 'aws-core-vscode/codewhisperer'
1716
import {
1817
ConfigurationEntry,
1918
DocumentChangedSource,
2019
KeyStrokeHandler,
2120
DefaultDocumentChangedType,
2221
RecommendationService,
23-
CodeWhispererUserGroupSettings,
2422
ClassifierTrigger,
2523
isInlineCompletionEnabled,
2624
RecommendationHandler,
@@ -52,7 +50,6 @@ describe('keyStrokeHandler', function () {
5250
})
5351
afterEach(function () {
5452
sinon.restore()
55-
CodeWhispererUserGroupSettings.instance.reset()
5653
})
5754

5855
it('Whatever the input is, should skip when automatic trigger is turned off, should not call invokeAutomatedTrigger', async function () {
@@ -145,19 +142,13 @@ describe('keyStrokeHandler', function () {
145142
}
146143
})
147144

148-
async function testShouldInvoke(
149-
input: string,
150-
shouldTrigger: boolean,
151-
rightContext: string = '',
152-
userGroup: CodeWhispererConstants.UserGroup = CodeWhispererConstants.UserGroup.Control
153-
) {
145+
async function testShouldInvoke(input: string, shouldTrigger: boolean, rightContext: string = '') {
154146
const mockEditor = createMockTextEditor(rightContext, 'test.js', 'javascript', 0, 0)
155147
const mockEvent: vscode.TextDocumentChangeEvent = createTextDocumentChangeEvent(
156148
mockEditor.document,
157149
new vscode.Range(new vscode.Position(0, 0), new vscode.Position(0, 1)),
158150
input
159151
)
160-
CodeWhispererUserGroupSettings.instance.userGroup = userGroup
161152
await KeyStrokeHandler.instance.processKeyStroke(mockEvent, mockEditor, mockClient, config)
162153
assert.strictEqual(
163154
invokeSpy.called,

packages/amazonq/test/unit/codewhisperer/tracker/codewhispererTracker.test.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@
66
import assert from 'assert'
77
import * as sinon from 'sinon'
88
import { assertTelemetryCurried } from 'aws-core-vscode/test'
9-
import {
10-
AuthUtil,
11-
CodeWhispererTracker,
12-
UserGroup,
13-
CodeWhispererUserGroupSettings,
14-
} from 'aws-core-vscode/codewhisperer'
9+
import { AuthUtil, CodeWhispererTracker } from 'aws-core-vscode/codewhisperer'
1510
import { resetCodeWhispererGlobalVariables, createAcceptedSuggestionEntry } from 'aws-core-vscode/test'
16-
import { globals, extensionVersion } from 'aws-core-vscode/shared'
11+
import { globals } from 'aws-core-vscode/shared'
1712

1813
describe('codewhispererTracker', function () {
1914
describe('enqueue', function () {
@@ -86,20 +81,7 @@ describe('codewhispererTracker', function () {
8681
})
8782

8883
describe('emitTelemetryOnSuggestion', function () {
89-
beforeEach(function () {
90-
CodeWhispererUserGroupSettings.instance.reset()
91-
})
92-
93-
afterEach(function () {
94-
CodeWhispererUserGroupSettings.instance.reset()
95-
})
96-
9784
it('Should call recordCodewhispererUserModification with suggestion event', async function () {
98-
await globals.globalState.update('CODEWHISPERER_USER_GROUP', {
99-
group: UserGroup.CrossFile,
100-
version: extensionVersion,
101-
})
102-
10385
const testStartUrl = 'testStartUrl'
10486
sinon.stub(AuthUtil.instance, 'startUrl').value(testStartUrl)
10587
const suggestion = createAcceptedSuggestionEntry()

packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('crossFileContextUtil', function () {
127127
})
128128
})
129129

130-
describe('partial support - control group', function () {
130+
describe.skip('partial support - control group', function () {
131131
const fileExtLists: string[] = []
132132

133133
before(async function () {
@@ -158,7 +158,7 @@ describe('crossFileContextUtil', function () {
158158
})
159159
})
160160

161-
describe('partial support - crossfile group', function () {
161+
describe.skip('partial support - crossfile group', function () {
162162
const fileExtLists: string[] = []
163163

164164
before(async function () {

0 commit comments

Comments
 (0)