mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-19 14:06:33 +02:00
Add tests for clearItems
This commit is contained in:
parent
a57eb3e689
commit
35cabbe985
|
@ -1055,6 +1055,31 @@ describe('choices', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('clearItems', () => {
|
||||
let storeDispatchStub;
|
||||
|
||||
beforeEach(() => {
|
||||
storeDispatchStub = stub();
|
||||
instance._store.dispatch = storeDispatchStub;
|
||||
|
||||
output = instance.clearItems();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
instance._store.dispatch.reset();
|
||||
});
|
||||
|
||||
it('returns this', () => {
|
||||
expect(output).to.eql(instance);
|
||||
});
|
||||
|
||||
it('dispatches clearItems action', () => {
|
||||
expect(storeDispatchStub.lastCall.args[0]).to.eql({
|
||||
type: ACTION_TYPES.CLEAR_ITEMS,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('clearStore', () => {
|
||||
let storeDispatchStub;
|
||||
|
||||
|
|
Loading…
Reference in a new issue