diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2022-05-08 13:33:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-08 13:33:46 +0000 |
commit | 9279fff1351406a1f6c37c074cc1997e6a9e97e3 (patch) | |
tree | cc8e53f783efc5eb737af31bb9dd15c9e6474782 /test | |
parent | 4468afca7a8c9893f71f7e042b25f6c46ba49678 (diff) | |
parent | 2a6d6b0967c6f6e269c3eedf4bd6002aee26b9da (diff) |
Merge pull request #1418 from ueokande/await-completions
Await fetching completions done completely
Diffstat (limited to 'test')
-rw-r--r-- | test/console/completion/reducer.test.ts | 16 | ||||
-rw-r--r-- | test/console/components/console/Completion.test.tsx | 14 | ||||
-rw-r--r-- | test/console/components/console/CompletionItem.test.tsx | 4 |
3 files changed, 9 insertions, 25 deletions
diff --git a/test/console/completion/reducer.test.ts b/test/console/completion/reducer.test.ts index 43b9807..865d066 100644 --- a/test/console/completion/reducer.test.ts +++ b/test/console/completion/reducer.test.ts @@ -3,29 +3,13 @@ import reducer, { State, } from "../../../src/console/completion/reducer"; import { - initCompletion, selectNext, selectPrev, setCompletions, setCompletionSource, } from "../../../src/console/completion/actions"; -import CompletionType from "../../../src/shared/CompletionType"; describe("completion reducer", () => { - describe("initCompletion", () => { - it("initializes completions", () => { - const nextState = reducer( - defaultState, - initCompletion([CompletionType.Bookmarks, CompletionType.History]) - ); - - expect(nextState.completionTypes).toEqual([ - CompletionType.Bookmarks, - CompletionType.History, - ]); - }); - }); - describe("setCompletionSource", () => { it("sets a completion source", () => { const nextState = reducer(defaultState, setCompletionSource("open ")); diff --git a/test/console/components/console/Completion.test.tsx b/test/console/components/console/Completion.test.tsx index 7dd634f..dee0e80 100644 --- a/test/console/components/console/Completion.test.tsx +++ b/test/console/components/console/Completion.test.tsx @@ -9,17 +9,17 @@ describe("console/components/console/completion/Completion", () => { { name: "Fruit", items: [ - { caption: "apple" }, - { caption: "banana" }, - { caption: "cherry" }, + { primary: "apple" }, + { primary: "banana" }, + { primary: "cherry" }, ], }, { name: "Element", items: [ - { caption: "argon" }, - { caption: "boron" }, - { caption: "carbon" }, + { primary: "argon" }, + { primary: "boron" }, + { primary: "carbon" }, ], }, ]; @@ -39,7 +39,7 @@ describe("console/components/console/completion/Completion", () => { const items = group.findAllByType(CompletionItem); expect(items).toHaveLength(completions[i].items.length); items.forEach((item, j) => { - expect(item.props.caption).toEqual(completions[i].items[j].caption); + expect(item.props.primary).toEqual(completions[i].items[j].primary); }); }); }); diff --git a/test/console/components/console/CompletionItem.test.tsx b/test/console/components/console/CompletionItem.test.tsx index ae73b21..6e89bc8 100644 --- a/test/console/components/console/CompletionItem.test.tsx +++ b/test/console/components/console/CompletionItem.test.tsx @@ -8,8 +8,8 @@ describe("console/components/console/completion/CompletionItem", () => { <CompletionItem shown={true} highlight={false} - caption="twitter" - url="https://twitter.com/" + primary="twitter" + secondary="https://twitter.com/" /> ).root; const spans = root.findAllByType("span"); |