mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-10-30 02:12:39 +00:00
44 lines
1.1 KiB
JavaScript
Executable File
44 lines
1.1 KiB
JavaScript
Executable File
/**
|
|
* Test store addons
|
|
*/
|
|
|
|
import { browserHistory } from 'react-router-dom';
|
|
import configureStore from '../configureStore';
|
|
|
|
describe('configureStore', () => {
|
|
let store;
|
|
|
|
beforeAll(() => {
|
|
store = configureStore({}, browserHistory);
|
|
});
|
|
|
|
describe('injectedReducers', () => {
|
|
it('should contain an object for reducers', () => {
|
|
expect(typeof store.injectedReducers).toBe('object');
|
|
});
|
|
});
|
|
|
|
describe('injectedSagas', () => {
|
|
it('should contain an object for sagas', () => {
|
|
expect(typeof store.injectedSagas).toBe('object');
|
|
});
|
|
});
|
|
|
|
describe('runSaga', () => {
|
|
it('should contain a hook for `sagaMiddleware.run`', () => {
|
|
expect(typeof store.runSaga).toBe('function');
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('configureStore params', () => {
|
|
it('should call window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__', () => {
|
|
/* eslint-disable no-underscore-dangle */
|
|
const compose = jest.fn();
|
|
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = () => compose;
|
|
configureStore(undefined, browserHistory);
|
|
expect(compose).toHaveBeenCalled();
|
|
/* eslint-enable */
|
|
});
|
|
});
|