Browse Source

rename redux tests

pull/1/head
Tim Glasgow 2 years ago
parent
commit
998f5973b3
  1. 19
      squarenotsquare/__tests__/Action-Creators-test.js
  2. 16
      squarenotsquare/__tests__/Redux-test.js

19
squarenotsquare/__tests__/Action-Creators-test.js

@ -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);
})
});

16
squarenotsquare/__tests__/Redux-test.js

@ -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…
Cancel
Save