| 1 | import { expect } from "chai"; |
| 2 | import { EditorView, TextEditor } from "vscode-extension-tester"; |
| 3 | |
| 4 | import { AutocompleteActions } from "../actions/Autocomplete.actions"; |
| 5 | import { GlobalActions } from "../actions/Global.actions"; |
| 6 | import { DEFAULT_TIMEOUT } from "../constants"; |
| 7 | |
| 8 | describe("Autocomplete", () => { |
| 9 | let editor: TextEditor; |
| 10 | |
| 11 | beforeEach(async function () { |
| 12 | this.timeout(DEFAULT_TIMEOUT.XL); |
| 13 | |
| 14 | await GlobalActions.openTestWorkspace(); |
| 15 | ({ editor } = await GlobalActions.createAndOpenNewTextFile()); |
| 16 | }); |
| 17 | |
| 18 | afterEach(async function () { |
| 19 | this.timeout(DEFAULT_TIMEOUT.XL); |
| 20 | await editor.clearText(); |
| 21 | await new EditorView().closeAllEditors(); |
| 22 | }); |
| 23 | |
| 24 | it("Should display completions", async () => { |
| 25 | await AutocompleteActions.testCompletions(editor); |
| 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); |
| 31 | }); |