Skip to content

Commit e208dac

Browse files
committed
test fix
1 parent 5ad855a commit e208dac

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

package-lock.json

Lines changed: 1 addition & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ describe('RecommendationService', () => {
333333
}
334334
})
335335

336-
it('should not make completion request when edit suggestion is active', async () => {
336+
it('should make completion request when edit suggestion is active', async () => {
337337
// Mock EditSuggestionState to return true (edit suggestion is active)
338338
const isEditSuggestionActiveStub = sandbox.stub(EditSuggestionState, 'isEditSuggestionActive').returns(true)
339339

@@ -360,8 +360,8 @@ describe('RecommendationService', () => {
360360
const completionCalls = cs.filter((c) => c.firstArg === completionApi)
361361
const editCalls = cs.filter((c) => c.firstArg === editApi)
362362

363-
assert.strictEqual(cs.length, 1) // Only edit call
364-
assert.strictEqual(completionCalls.length, 0) // No completion calls
363+
assert.strictEqual(cs.length, 2) // Only edit call
364+
assert.strictEqual(completionCalls.length, 1) // No completion calls
365365
assert.strictEqual(editCalls.length, 1) // One edit call
366366

367367
// Verify the stub was called
@@ -370,10 +370,6 @@ describe('RecommendationService', () => {
370370

371371
it('should make completion request when edit suggestion is not active', async () => {
372372
// Mock EditSuggestionState to return false (no edit suggestion active)
373-
const isEditSuggestionActiveStub = sandbox
374-
.stub(EditSuggestionState, 'isEditSuggestionActive')
375-
.returns(false)
376-
377373
const mockResult = {
378374
sessionId: 'test-session',
379375
items: [mockInlineCompletionItemOne],
@@ -400,9 +396,6 @@ describe('RecommendationService', () => {
400396
assert.strictEqual(cs.length, 2) // Both calls
401397
assert.strictEqual(completionCalls.length, 1) // One completion call
402398
assert.strictEqual(editCalls.length, 1) // One edit call
403-
404-
// Verify the stub was called
405-
sinon.assert.calledOnce(isEditSuggestionActiveStub)
406399
})
407400
})
408401
})

0 commit comments

Comments
 (0)