diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-09-21 11:15:53 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-09-21 12:50:31 +0900 |
commit | 8bfa19885bc84e5b75009b24050be8304d52d3b2 (patch) | |
tree | 35207302ae9c37b3e41a81ff0d6e09fcafeda4cb /e2e/completion.test.ts | |
parent | e4a9c831381a9c90ca0d44844d103b9c83a56c8d (diff) |
Fix e2e tests
Diffstat (limited to 'e2e/completion.test.ts')
-rw-r--r-- | e2e/completion.test.ts | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/e2e/completion.test.ts b/e2e/completion.test.ts index bc065d3..c0e7052 100644 --- a/e2e/completion.test.ts +++ b/e2e/completion.test.ts @@ -28,33 +28,24 @@ describe("general completion test", () => { page = await Page.navigateTo(webdriver, "about:blank"); }); - it("should all commands on empty line", async () => { + it("should shows all commands on empty line", async () => { const console = await page.showConsole(); - const items = await console.getCompletions(); - assert.strictEqual(items.length, 12); - assert.deepStrictEqual(items[0], { - type: "title", - text: "Console Command", - }); - assert.ok(items[1].text.startsWith("set")); - assert.ok(items[2].text.startsWith("open")); - assert.ok(items[3].text.startsWith("tabopen")); + const groups = await console.getCompletions(); + assert.strictEqual(groups.length, 1); + assert.strictEqual(groups[0].title, "Console Command"); + assert.strictEqual(groups[0].items.length, 11); }); - it("should only commands filtered by prefix", async () => { + it("should shows commands filtered by prefix", async () => { const console = await page.showConsole(); await console.inputKeys("b"); - const items = await console.getCompletions(); - assert.strictEqual(items.length, 4); - assert.deepStrictEqual(items[0], { - type: "title", - text: "Console Command", - }); - assert.ok(items[1].text.startsWith("buffer")); - assert.ok(items[2].text.startsWith("bdelete")); - assert.ok(items[3].text.startsWith("bdeletes")); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.ok(items[0].text.startsWith("buffer")); + assert.ok(items[1].text.startsWith("bdelete")); + assert.ok(items[2].text.startsWith("bdeletes")); }); // > byffer @@ -65,21 +56,24 @@ describe("general completion test", () => { const console = await page.showConsole(); await console.inputKeys("b"); await eventually(async () => { - const items = await console.getCompletions(); - assert.strictEqual(items.length, 4); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.strictEqual(items.length, 3); }); await console.sendKeys(Key.TAB); await eventually(async () => { - const items = await console.getCompletions(); - assert.ok(items[1].highlight); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.ok(items[0].highlight); assert.strictEqual(await console.currentValue(), "buffer"); }); await console.sendKeys(Key.TAB, Key.TAB); await eventually(async () => { - const items = await console.getCompletions(); - assert.ok(items[3].highlight); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.ok(items[2].highlight); assert.strictEqual(await console.currentValue(), "bdeletes"); }); @@ -90,8 +84,9 @@ describe("general completion test", () => { await console.sendKeys(Key.SHIFT, Key.TAB); await eventually(async () => { - const items = await console.getCompletions(); - assert.ok(items[3].highlight); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.ok(items[2].highlight); assert.strictEqual(await console.currentValue(), "bdeletes"); }); }); |