add tests for completion and fix
This commit is contained in:
parent
567b696cec
commit
40cc5b9175
3 changed files with 126 additions and 2 deletions
27
test/actions/completion.test.js
Normal file
27
test/actions/completion.test.js
Normal file
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
Reference in a new issue