From 40cc5b9175f08f66c9c6a9d6efad59bf47cea307 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 1 Oct 2017 08:32:55 +0900 Subject: add tests for completion and fix --- test/actions/completion.test.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/actions/completion.test.js (limited to 'test/actions/completion.test.js') diff --git a/test/actions/completion.test.js b/test/actions/completion.test.js new file mode 100644 index 0000000..da88f53 --- /dev/null +++ b/test/actions/completion.test.js @@ -0,0 +1,27 @@ +import { expect } from "chai"; +import actions from '../../src/actions'; +import * as completionActions from '../../src/actions/completion'; + +describe("completion actions", () => { + describe('setItems', () => { + it('create COMPLETION_SET_ITEMS action', () => { + let action = completionActions.setItems([1, 2, 3]); + expect(action.type).to.equal(actions.COMPLETION_SET_ITEMS); + expect(action.groups).to.deep.equal([1, 2, 3]); + }); + }); + + describe('selectNext', () => { + it('create COMPLETION_SELECT_NEXT action', () => { + let action = completionActions.selectNext(); + expect(action.type).to.equal(actions.COMPLETION_SELECT_NEXT); + }); + }); + + describe('selectPrev', () => { + it('create COMPLETION_SELECT_PREV action', () => { + let action = completionActions.selectPrev(); + expect(action.type).to.equal(actions.COMPLETION_SELECT_PREV); + }); + }); +}); -- cgit v1.2.3