Add failing e2e test

This commit is contained in:
Christopher Schleiden
2023-03-21 11:15:00 -07:00
committed by Josh Gross
parent 60db45e6c8
commit d1baf65c18
+28
View File
@@ -0,0 +1,28 @@
import {complete} from "./complete";
import {hover} from "./hover";
import {registerLogger} from "./log";
import {getPositionFromCursor} from "./test-utils/cursor-position";
import {TestLogger} from "./test-utils/logger";
import {clearCache} from "./utils/workflow-cache";
registerLogger(new TestLogger());
beforeEach(() => {
clearCache();
});
describe("end-to-end", () => {
it("empty workflow completion after hover", async () => {
const input = "|";
// Issue hover first to fill the cache
await hover(...getPositionFromCursor(input));
const result = await complete(...getPositionFromCursor(input));
expect(result).not.toBeUndefined();
expect(result.length).toEqual(8);
const labels = result.map(x => x.label);
expect(labels).toEqual(["concurrency", "defaults", "env", "jobs", "name", "on", "permissions", "run-name"]);
});
});