diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2020-09-21 14:20:38 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 14:20:38 +0900 |
commit | 7b8a96bbf7cb6d28c76c061a6b24a9fa821820b1 (patch) | |
tree | 4d00b60aa59e946f64ea6402ee7c78fc491f6203 /e2e/completion_buffers.test.ts | |
parent | 748ab17dc61a2bb3f1c1e3ea4b43d13ef23d8edf (diff) | |
parent | 9bba3ed79123affc8e557cf4211df51bd375742c (diff) |
Merge pull request #837 from ueokande/use-styled-components
Use styled-components instead of vanilla CSS/SCSS in console
Diffstat (limited to 'e2e/completion_buffers.test.ts')
-rw-r--r-- | e2e/completion_buffers.test.ts | 100 |
1 files changed, 53 insertions, 47 deletions
diff --git a/e2e/completion_buffers.test.ts b/e2e/completion_buffers.test.ts index 57603f6..13d07ea 100644 --- a/e2e/completion_buffers.test.ts +++ b/e2e/completion_buffers.test.ts @@ -72,17 +72,19 @@ describe("completion on buffer/bdelete/bdeletes", () => { await console.inputKeys("buffer "); await eventually(async () => { - const items = await console.getCompletions(); - assert.strictEqual(items.length, 6); - assert.deepStrictEqual(items[0], { type: "title", text: "Buffers" }); - assert.ok(items[1].text.startsWith("1:")); - assert.ok(items[2].text.startsWith("2:")); - assert.ok(items[3].text.startsWith("3:")); - assert.ok(items[4].text.startsWith("4:")); - assert.ok(items[5].text.startsWith("5:")); - - assert.ok(items[3].text.includes("%")); - assert.ok(items[5].text.includes("#")); + const groups = await console.getCompletions(); + assert.strictEqual(groups.length, 1); + assert.strictEqual(groups[0].title, "Buffers"); + + const items = groups[0].items; + assert.ok(items[0].text.startsWith("1:")); + assert.ok(items[1].text.startsWith("2:")); + assert.ok(items[2].text.startsWith("3:")); + assert.ok(items[3].text.startsWith("4:")); + assert.ok(items[4].text.startsWith("5:")); + + assert.ok(items[2].text.includes("%")); + assert.ok(items[4].text.includes("#")); }); }); @@ -91,11 +93,10 @@ describe("completion on buffer/bdelete/bdeletes", () => { await console.inputKeys("buffer title_site2"); await eventually(async () => { - const items = await console.getCompletions(); - assert.deepStrictEqual(items[0], { type: "title", text: "Buffers" }); - assert.ok(items[1].text.startsWith("2:")); - assert.ok(items[1].text.includes("title_site2")); - assert.ok(items[1].text.includes(server.url("/site2"))); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.ok(items[0].text.startsWith("2:")); + assert.ok(items[0].text.includes("title_site2")); }); }); @@ -104,9 +105,9 @@ describe("completion on buffer/bdelete/bdeletes", () => { await console.inputKeys("buffer /site2"); await eventually(async () => { - const items = await console.getCompletions(); - assert.deepStrictEqual(items[0], { type: "title", text: "Buffers" }); - assert.ok(items[1].text.startsWith("2:")); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.ok(items[0].text.startsWith("2:")); }); }); @@ -115,10 +116,11 @@ describe("completion on buffer/bdelete/bdeletes", () => { await console.inputKeys("buffer 2"); await eventually(async () => { - const items = await console.getCompletions(); - assert.strictEqual(items.length, 2); - assert.deepStrictEqual(items[0], { type: "title", text: "Buffers" }); - assert.ok(items[1].text.startsWith("2:")); + const groups = await console.getCompletions(); + const items = groups[0].items; + + assert.strictEqual(items.length, 1); + assert.ok(items[0].text.startsWith("2:")); }); }); @@ -127,11 +129,12 @@ describe("completion on buffer/bdelete/bdeletes", () => { await console.inputKeys("bdelete site"); await eventually(async () => { - const items = await console.getCompletions(); - assert.strictEqual(items.length, 4); - assert.ok(items[1].text.includes("site3")); - assert.ok(items[2].text.includes("site4")); - assert.ok(items[3].text.includes("site5")); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.strictEqual(items.length, 3); + assert.ok(items[0].text.includes("site3")); + assert.ok(items[1].text.includes("site4")); + assert.ok(items[2].text.includes("site5")); }); }); @@ -140,11 +143,12 @@ describe("completion on buffer/bdelete/bdeletes", () => { await console.inputKeys("bdeletes site"); await eventually(async () => { - const items = await console.getCompletions(); - assert.strictEqual(items.length, 4); - assert.ok(items[1].text.includes("site3")); - assert.ok(items[2].text.includes("site4")); - assert.ok(items[3].text.includes("site5")); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.strictEqual(items.length, 3); + assert.ok(items[0].text.includes("site3")); + assert.ok(items[1].text.includes("site4")); + assert.ok(items[2].text.includes("site5")); }); }); @@ -153,13 +157,14 @@ describe("completion on buffer/bdelete/bdeletes", () => { await console.inputKeys("bdelete! site"); await eventually(async () => { - const items = await console.getCompletions(); - assert.strictEqual(items.length, 6); - assert.ok(items[1].text.includes("site1")); - assert.ok(items[2].text.includes("site2")); - assert.ok(items[3].text.includes("site3")); - assert.ok(items[4].text.includes("site4")); - assert.ok(items[5].text.includes("site5")); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.strictEqual(items.length, 5); + assert.ok(items[0].text.includes("site1")); + assert.ok(items[1].text.includes("site2")); + assert.ok(items[2].text.includes("site3")); + assert.ok(items[3].text.includes("site4")); + assert.ok(items[4].text.includes("site5")); }); }); @@ -168,13 +173,14 @@ describe("completion on buffer/bdelete/bdeletes", () => { await console.inputKeys("bdeletes! site"); await eventually(async () => { - const items = await console.getCompletions(); - assert.strictEqual(items.length, 6); - assert.ok(items[1].text.includes("site1")); - assert.ok(items[2].text.includes("site2")); - assert.ok(items[3].text.includes("site3")); - assert.ok(items[4].text.includes("site4")); - assert.ok(items[5].text.includes("site5")); + const groups = await console.getCompletions(); + const items = groups[0].items; + assert.strictEqual(items.length, 5); + assert.ok(items[0].text.includes("site1")); + assert.ok(items[1].text.includes("site2")); + assert.ok(items[2].text.includes("site3")); + assert.ok(items[3].text.includes("site4")); + assert.ok(items[4].text.includes("site5")); }); }); }); |