From 117656e4a5a84b55cfba0b5b206d34556f46da4a Mon Sep 17 00:00:00 2001 From: corrado4eyes Date: Tue, 3 Dec 2019 14:51:34 +0100 Subject: [PATCH] [#1] Renamed file --- hearthstone/__tests__/app.test.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 hearthstone/__tests__/app.test.tsx diff --git a/hearthstone/__tests__/app.test.tsx b/hearthstone/__tests__/app.test.tsx new file mode 100644 index 00000000..d1a80c21 --- /dev/null +++ b/hearthstone/__tests__/app.test.tsx @@ -0,0 +1,22 @@ +import React from 'react'; +import App from '../src/App'; +import {shallow, ShallowWrapper} from 'enzyme' +import { dummyCardArray } from './__mocks__/mockObjects'; +import Card from '../src/model/card'; + + +describe('App', () => { + const cards: Card[] = dummyCardArray + it('renders n elements in an array', () => { + const component: ShallowWrapper = shallow(); + component.setState({cards: cards}) + const divs: ShallowWrapper = component.find('.card'); + expect(divs).toHaveLength(cards.length); + }); + + it('Snapshot testing', () => { + const component: ShallowWrapper = shallow(); + component.setState({cards: cards}) + expect(component).toMatchSnapshot(); + }); +});