Skip to content

Commit

Permalink
[splendo#9] Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
corrado4eyes committed Dec 3, 2019
1 parent 489f2b9 commit ce403cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hearthstone/__tests__/app.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ConnectedApp, {App} from '../src/App';
import {shallow, ShallowWrapper} from 'enzyme'
import {shallow, mount, ShallowWrapper, ReactWrapper} from 'enzyme'
import { dummyCardArray } from './__mocks__/mockObjects';
import Card from '../src/model/card';
import { RootState, initialState } from '../src/redux/reducers/mainReducer';
Expand All @@ -23,6 +23,10 @@ describe('App', () => {
component.setState({cards: cards})
expect(component).toMatchSnapshot();
});

it('fires dispatchSyncCard onComponentDidMount', () => {
expect(dispatchSyncCard).toHaveBeenCalledTimes(1);
});
});

describe('App(connected)', () => {
Expand All @@ -32,7 +36,7 @@ describe('App', () => {
state.card.cards = dummyCardArray;
state.card.cardSet = cardSet
const store = generateMockStore(state)
const component: ShallowWrapper = shallow(<Provider store={store}><ConnectedApp cardSet={cardSet}/></Provider>);
const component: ReactWrapper = mount(<Provider store={store}><ConnectedApp cardSet={cardSet}/></Provider>);
it('checks the props', () => {
expect(component.find(App).prop('cards')).toBe(dummyCardArray)
});
Expand Down

0 comments on commit ce403cf

Please sign in to comment.