mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-12 18:46:35 +02:00
24 lines
558 B
JavaScript
24 lines
558 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('LOADING', () => {
|
|
it('sets loading state', () => {
|
|
const expectedState = {
|
|
loading: true,
|
|
};
|
|
|
|
const actualState = general(undefined, {
|
|
type: 'LOADING',
|
|
isLoading: true,
|
|
});
|
|
|
|
expect(expectedState).to.eql(actualState);
|
|
});
|
|
});
|
|
});
|