2 changed files with 19 additions and 16 deletions
@ -0,0 +1,19 @@ |
|||||
|
import 'react-native'; |
||||
|
import initStore from '../src/redux/CreateStore'; |
||||
|
import {appInit} from '../src/redux/actions/SystemActions'; |
||||
|
import { APP_INIT } from '../src/redux/types/SystemTypes'; |
||||
|
import configureMockStore from 'redux-mock-store'; |
||||
|
import thunk from 'redux-thunk'; |
||||
|
|
||||
|
const flushPromises = () => new Promise(setImmediate); |
||||
|
const middlewares = [thunk]; |
||||
|
const mockStore = configureMockStore(middlewares); |
||||
|
|
||||
|
test('starts redux store', () => { |
||||
|
const localStore = mockStore(); |
||||
|
return localStore.dispatch(appInit()) |
||||
|
.then( () => { |
||||
|
const actualAction = localStore.getActions()[0]; |
||||
|
expect(actualAction.type).toEqual(APP_INIT); |
||||
|
}) |
||||
|
}); |
@ -1,16 +0,0 @@ |
|||||
import 'react-native'; |
|
||||
import React from 'react'; |
|
||||
import initStore from '../src/redux/CreateStore'; |
|
||||
import appInit from '../src/redux/actions/SystemActions'; |
|
||||
import { APP_INIT } from '../src/edux/types/SystemTypes'; |
|
||||
|
|
||||
const flushPromises = () => new Promise(setImmediate); |
|
||||
|
|
||||
test('starts redux store', () => { |
|
||||
const reduxStore = initStore(); |
|
||||
reduxStore.dispatch(appInit()) |
|
||||
.then(() => { |
|
||||
const actualActions = reduxStore.getActions().map(action = action.type); |
|
||||
expect(actualActions).to.eql(APP_INIT); |
|
||||
}); |
|
||||
}); |
|
Loading…
Reference in new issue