Skip to content

Commit

Permalink
[splendo#1] Added test for app.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
corrado4eyes committed Dec 3, 2019
1 parent b1903e4 commit c94f949
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions hearthstone/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from '../src/App';
import {shallow, ShallowWrapper} from 'enzyme'
import { dummyCardArray } from './__mocks__/mockObjects';
import Card from '../src/model/card';


describe('App', () => {
it(('renders n elements in an array'))
const cards: Card[] = dummyCardArray
it('renders n elements in an array', () => {
const component: ShallowWrapper = shallow(<App/>);
component.setState({cards: cards})
const divs: ShallowWrapper = component.find('.card');
expect(divs).toHaveLength(cards.length);
});

it('Snapshot testing', () => {
const component: ShallowWrapper = shallow(<App/>);
component.setState({cards: cards})
expect(component).toMatchSnapshot();
});
});

0 comments on commit c94f949

Please sign in to comment.