mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-28 10:20:08 +02:00
437651411f
* Reapply changes from PR #310 * Version 4.1.1 * Update action name * Update test * Resolved broken test
24 lines
572 B
JavaScript
24 lines
572 B
JavaScript
import { expect } from 'chai';
|
|
import general, { defaultState } from './general';
|
|
|
|
describe('reducers/general', () => {
|
|
it('should return same state when no action matches', () => {
|
|
expect(general(defaultState, {})).to.equal(defaultState);
|
|
});
|
|
|
|
describe('SET_IS_LOADING', () => {
|
|
it('sets loading state', () => {
|
|
const expectedState = {
|
|
loading: true,
|
|
};
|
|
|
|
const actualState = general(undefined, {
|
|
type: 'SET_IS_LOADING',
|
|
isLoading: true,
|
|
});
|
|
|
|
expect(expectedState).to.eql(actualState);
|
|
});
|
|
});
|
|
});
|