aboutsummaryrefslogtreecommitdiff
path: root/test/background/reducers/find.test.js
blob: 707d73a30bece970739a7e347499cfb57166afe3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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')
  });
});