Skip to content

Commit 2ecfebc

Browse files
committed
Responding to PR comments from Laura
1 parent 267d4af commit 2ecfebc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/amazonq/test/e2e_new/amazonq/tests/inline.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import '../utils/setup'
66
import { Workbench, EditorView, InputBox, TextEditor, WebviewView, Key } from 'vscode-extension-tester'
77
import { testContext } from '../utils/testContext'
8-
import { createNewTextFile, writeToTextEditor, waitForEditorStabilization } from '../utils/generalUtils'
8+
import { createNewTextFile, writeToTextEditor, waitForInlineGeneration } from '../utils/generalUtils'
99
import assert from 'assert'
1010

1111
describe('Amazon Q Inline Completion / Chat Functionality', function () {
@@ -41,7 +41,7 @@ describe('Amazon Q Inline Completion / Chat Functionality', function () {
4141
await input.sendKeys('Generate the fibonacci sequence through iteration')
4242
await input.sendKeys(Key.ENTER)
4343
// Wait for Amazon Q to finish generating code
44-
await waitForEditorStabilization(textEditor)
44+
await waitForInlineGeneration(textEditor)
4545

4646
const textAfter = await textEditor.getText()
4747
assert(textAfter.length > textBefore.length, 'Amazon Q generated code')

packages/amazonq/test/e2e_new/amazonq/utils/generalUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ export async function writeToTextEditor(textEditor: TextEditor, text: string): P
165165
}
166166

167167
/**
168-
* Waits for editor content to stabilize by checking if line count stops changing
168+
* Waits for Inline Generation by Amazon Q by checking if line count stops changing
169169
* @param editor The TextEditor instance
170170
* @param timeout Maximum time to wait in milliseconds (default: 15000)
171171
* @returns Promise<void>
172172
* @throws Error if timeout is exceeded
173173
*/
174-
export async function waitForEditorStabilization(editor: TextEditor, timeout = 15000): Promise<void> {
174+
export async function waitForInlineGeneration(editor: TextEditor, timeout = 15000): Promise<void> {
175175
const startTime = Date.now()
176176
let previousLines = await editor.getNumberOfLines()
177177
let stableCount = 0
@@ -182,7 +182,7 @@ export async function waitForEditorStabilization(editor: TextEditor, timeout = 1
182182

183183
if (currentLines === previousLines) {
184184
stableCount++
185-
if (stableCount >= 2) {
185+
if (stableCount >= 3) {
186186
return
187187
}
188188
} else {

0 commit comments

Comments
 (0)