Changesets · Branches · Tags · Compare
| Changeset | 3efa2290798ded6ceee4b0393d48576fc6b6b441574a477822c1efa608d962f2 |
|---|---|
| Author | shamanic <shamanicbeatbox@gmail.com> · 2025-06-07 05:03 +01:00 |
| Committer | shamanic <shamanicbeatbox@gmail.com> · 2025-06-07 05:03 +01:00 |
| Parents | 951aa1c26a3e |
2 files changed
modified extensions/vscode/e2e/actions/Autocomplete.actions.ts +14 −1
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import { expect } from "chai"; |
| 2 | -import { TextEditor } from "vscode-extension-tester"; | |
| 2 | +import { TextEditor, VSBrowser, Workbench } from "vscode-extension-tester"; | |
| 3 | 3 | |
| 4 | 4 | import { DEFAULT_TIMEOUT } from "../constants"; |
| 5 | 5 | import { AutocompleteSelectors } from "../selectors/Autocomplete.selectors"; |
| @@ -29,4 +29,17 @@ | ||
| 29 | 29 | ); |
| 30 | 30 | expect(ghostText1).to.equal(messagePair1.llmResponse); |
| 31 | 31 | } |
| 32 | + | |
| 33 | + public static async forceCompletion(editor: TextEditor): Promise<string> { | |
| 34 | + await editor.setText("def main():\n "); | |
| 35 | + await editor.moveCursor(2, 5); | |
| 36 | + | |
| 37 | + await new Workbench().executeCommand("Continue: Force Autocomplete"); | |
| 38 | + | |
| 39 | + const ghostText = await TestUtils.waitForSuccess(() => | |
| 40 | + AutocompleteSelectors.getGhostTextContent(VSBrowser.instance.driver) | |
| 41 | + ); | |
| 42 | + | |
| 43 | + return ghostText; | |
| 44 | + } | |
| 32 | 45 | } |
modified extensions/vscode/e2e/tests/Autocomplete.test.ts +5 −0
| @@ -1,3 +1,4 @@ | ||
| 1 | +import { expect } from "chai"; | |
| 1 | 2 | import { EditorView, TextEditor } from "vscode-extension-tester"; |
| 2 | 3 | |
| 3 | 4 | import { AutocompleteActions } from "../actions/Autocomplete.actions"; |
| @@ -23,4 +24,8 @@ | ||
| 23 | 24 | it("Should display completions", async () => { |
| 24 | 25 | await AutocompleteActions.testCompletions(editor); |
| 25 | 26 | }).timeout(DEFAULT_TIMEOUT.XL); |
| 27 | + it("Should force a completion using the command", async () => { | |
| 28 | + const ghostText = await AutocompleteActions.forceCompletion(editor); | |
| 29 | + expect(ghostText).to.not.be.empty; | |
| 30 | + }).timeout(DEFAULT_TIMEOUT.XL); | |
| 26 | 31 | }); |