import * as React from 'react'; import { mount } from 'enzyme'; import Card from '../Card'; import CardHeader from '../CardHeader'; import CardBody from '../CardBody'; import { Action } from '../../../types'; describe(' Test Suit', () => { it('should verify that Card has
tag for title', () => { const cardWrapper = mount( Online store dashboard - Card

View a summary of your online store’s performance.

); expect(cardWrapper.find('div').length).toBe(4); }); it('should verify sectioned when it is not set', () => { const cardWrapper = mount( Online store dashboard - Card

View a summary of your online store’s performance.

); expect(cardWrapper.prop('sectioned')).toBeFalsy(); cardWrapper.setProps({ sectioned: false }); expect(cardWrapper.prop('sectioned')).toBe(false); }); it('should verify when actions is called', () => { const spy = jest.fn(); const action: Action = { content: 'Action Content', onAction: () => { spy(); }, }; const cardWrapper = mount( ); cardWrapper.find('button').at(1).simulate('click'); expect(spy).toHaveBeenCalled(); }); });