Skip to content

Commit ce403cf

Browse files
committed
[splendo#9] Updated test
1 parent 489f2b9 commit ce403cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hearthstone/__tests__/app.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ConnectedApp, {App} from '../src/App';
3-
import {shallow, ShallowWrapper} from 'enzyme'
3+
import {shallow, mount, ShallowWrapper, ReactWrapper} from 'enzyme'
44
import { dummyCardArray } from './__mocks__/mockObjects';
55
import Card from '../src/model/card';
66
import { RootState, initialState } from '../src/redux/reducers/mainReducer';
@@ -23,6 +23,10 @@ describe('App', () => {
2323
component.setState({cards: cards})
2424
expect(component).toMatchSnapshot();
2525
});
26+
27+
it('fires dispatchSyncCard onComponentDidMount', () => {
28+
expect(dispatchSyncCard).toHaveBeenCalledTimes(1);
29+
});
2630
});
2731

2832
describe('App(connected)', () => {
@@ -32,7 +36,7 @@ describe('App', () => {
3236
state.card.cards = dummyCardArray;
3337
state.card.cardSet = cardSet
3438
const store = generateMockStore(state)
35-
const component: ShallowWrapper = shallow(<Provider store={store}><ConnectedApp cardSet={cardSet}/></Provider>);
39+
const component: ReactWrapper = mount(<Provider store={store}><ConnectedApp cardSet={cardSet}/></Provider>);
3640
it('checks the props', () => {
3741
expect(component.find(App).prop('cards')).toBe(dummyCardArray)
3842
});

0 commit comments

Comments
 (0)