diff options
| author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-03-07 21:34:37 +0900 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-07 21:34:37 +0900 | 
| commit | d2a3c6cdd4d6ca564d9a80d281ba14648ffcc6eb (patch) | |
| tree | 0de3603c8cffef056584413ef8a5a0dc051b8d8f /test | |
| parent | 72bf3cc2bdcc63864e064a64f7459aba004f4538 (diff) | |
| parent | 92f8365be7127c3fa0276b1a6e890571f634622e (diff) | |
Merge pull request #355 from ueokande/search-across-pages
Search across pages
Diffstat (limited to 'test')
| -rw-r--r-- | test/background/actions/find.test.js | 13 | ||||
| -rw-r--r-- | test/background/reducers/find.test.js | 19 | ||||
| -rw-r--r-- | test/content/reducers/find.test.js | 2 | 
3 files changed, 33 insertions, 1 deletions
diff --git a/test/background/actions/find.test.js b/test/background/actions/find.test.js new file mode 100644 index 0000000..467604f --- /dev/null +++ b/test/background/actions/find.test.js @@ -0,0 +1,13 @@ +import { expect } from "chai"; +import actions from 'background/actions'; +import * as findActions from 'background/actions/find'; + +describe("find actions", () => { +  describe("setKeyword", () => { +    it('create FIND_SET_KEYWORD action', () => { +      let action = findActions.setKeyword('banana'); +      expect(action.type).to.equal(actions.FIND_SET_KEYWORD); +      expect(action.keyword).to.equal('banana'); +    }); +  }); +}); 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') +  }); +}); diff --git a/test/content/reducers/find.test.js b/test/content/reducers/find.test.js index 93625da..908b01b 100644 --- a/test/content/reducers/find.test.js +++ b/test/content/reducers/find.test.js @@ -5,7 +5,7 @@ import findReducer from 'content/reducers/find';  describe("find reducer", () => {    it('return the initial state', () => {      let state = findReducer(undefined, {}); -    expect(state).to.have.property('keyword', ''); +    expect(state).to.have.property('keyword', null);      expect(state).to.have.property('found', false);    });  | 
