Elffuss BraidHub

kikocis/continue public

627d7d0d1f85 · 1.9 KiBRawPermalink
1import { expect } from "chai";
2import {
3 EditorView,
4 InputBox,
5 Key,
6 TextEditor,
7 Workbench,
8} from "vscode-extension-tester";
9
10import { GlobalActions } from "../actions/Global.actions";
11import { DEFAULT_TIMEOUT } from "../constants";
12
13describe("Prompt file", () => {
14 let editor: TextEditor;
15
16 beforeEach(async function () {
17 this.timeout(DEFAULT_TIMEOUT.XL);
18
19 await GlobalActions.openTestWorkspace();
20 await new Workbench().executeCommand("File: New Untitled Text File");
21 await new Workbench().executeCommand("Change Language Mode");
22 const inputBox = await new InputBox();
23 await inputBox.setText("Prompt Language");
24 await inputBox.confirm();
25 editor = (await new EditorView().openEditor("Untitled-1")) as TextEditor;
26 });
27
28 afterEach(async function () {
29 this.timeout(DEFAULT_TIMEOUT.XL);
30 await editor.clearText();
31 await new EditorView().closeAllEditors();
32 });
33
34 it("Should display intellisense for default context providers and preamble", async () => {
35 // Check that "@" dropdown in body works
36 const providers = [
37 "currentFile",
38 "open",
39 "os",
40 "problems",
41 "repo-map",
42 "terminal",
43 "tree",
44 ];
45 for (const provider of providers) {
46 await editor.typeText("@" + provider.slice(0, 2));
47 await editor.typeText(Key.ENTER);
48 const text = await editor.getText();
49 expect(text).equals("@" + provider);
50 await editor.clearText();
51 }
52
53 // Check that dropdown for properties in preamble works
54 // await editor.typeText(Key.ENTER);
55 // await editor.typeText(Key.ENTER);
56 // await editor.typeText("---");
57 // await editor.typeText(Key.UP);
58 // await editor.typeText(Key.UP);
59 // await editor.typeText(Key.SPACE);
60 // await editor.typeText(Key.BACK_SPACE);
61 // await editor.typeText(Key.ENTER);
62 // const text = await editor.getText();
63 // expect(text).equals("description: \n\n---");
64 }).timeout(DEFAULT_TIMEOUT.XL);
65});