UNPKG

yoda-common-boilerplate

Version:

Repository of all JCP reusable atoms, molecules and organisms

29 lines (21 loc) 724 B
import React from 'react'; import { shallow } from 'enzyme'; import { expect } from 'chai'; import 'ignore-styles'; import Card from '../Card.jsx'; describe(' Test Suite for <Card /> ', () => { let wrapper; beforeEach(() => { /* Shallow Rendering component in before each to eliminate duplication */ wrapper = shallow(<Card>Product Name:</Card>); }); it('Card component should exist ', () => { expect(wrapper).to.exist; }); it('component should contain a div tag as a parent', () => { expect(wrapper.type()).to.equal('div'); }); it('should be able to render children', () => { expect(wrapper.props().children).to.equal('Product Name:'); }); });