From 24e72aa6e079009d4c24c7f6be6bfb82c21e6643 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Wed, 7 Mar 2018 20:54:28 +0900 Subject: add global find keyword --- test/background/reducers/find.test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/background/reducers/find.test.js (limited to 'test/background/reducers/find.test.js') diff --git a/test/background/reducers/find.test.js b/test/background/reducers/find.test.js new file mode 100644 index 0000000..707d73a --- /dev/null +++ b/test/background/reducers/find.test.js @@ -0,0 +1,19 @@ +import { expect } from "chai"; +import actions from 'background/actions'; +import findReducer from 'background/reducers/find'; + +describe("find reducer", () => { + it('return the initial state', () => { + let state = findReducer(undefined, {}); + expect(state).to.have.deep.property('keyword', null); + }); + + it('return next state for FIND_SET_KEYWORD', () => { + let action = { + type: actions.FIND_SET_KEYWORD, + keyword: 'cherry', + }; + let state = findReducer(undefined, action); + expect(state).to.have.deep.property('keyword', 'cherry') + }); +}); -- cgit v1.2.3