Skip to content

Commit 5cd1797

Browse files
committed
addressed more comments
1 parent 7b1843a commit 5cd1797

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

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

1011
describe('Amazon Q Inline Completion / Chat Functionality', function () {
1112
// this timeout is the general timeout for the entire test suite
@@ -29,7 +30,7 @@ describe('Amazon Q Inline Completion / Chat Functionality', function () {
2930
it('Inline Test', async () => {
3031
await writeToTextEditor(textEditor, 'Select Me')
3132
const text = await textEditor.getText()
32-
expect(text).equals('Select Me')
33+
assert.equal(text, 'Select Me')
3334
await textEditor.clearText()
3435

3536
await workbench.executeCommand('Amazon Q: Inline Chat')

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ export async function createNewTextFile(workbench: Workbench, editorView: Editor
167167
await workbench.executeCommand('Create: New File...')
168168
await (await InputBox.create()).selectQuickPick('Text File')
169169
await sleep(1000)
170-
const textEditor = (await editorView.openEditor('Untitled-1')) as TextEditor
170+
const editor = await editorView.openEditor('Untitled-1')
171+
if (!editor || !(editor instanceof TextEditor)) {
172+
throw new Error('Failed to open text editor')
173+
}
174+
const textEditor = editor as TextEditor
171175
return textEditor
172176
}
173177

0 commit comments

Comments
 (0)