Adds Card Snapshot (https://github.com/woocommerce/woocommerce-admin/pull/821)
This commit is contained in:
parent
5033a1ba5c
commit
cd00227875
|
@ -0,0 +1,20 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Card it renders correctly 1`] = `
|
||||
<div
|
||||
className="woocommerce-card"
|
||||
>
|
||||
<div
|
||||
className="woocommerce-card__header"
|
||||
>
|
||||
<h2
|
||||
className="woocommerce-card__title woocommerce-card__header-item"
|
||||
>
|
||||
A Card Example
|
||||
</h2>
|
||||
</div>
|
||||
<div
|
||||
className="woocommerce-card__body"
|
||||
/>
|
||||
</div>
|
||||
`;
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import renderer from 'react-test-renderer';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
/**
|
||||
|
@ -12,6 +12,11 @@ import { shallow } from 'enzyme';
|
|||
import Card from '../';
|
||||
|
||||
describe( 'Card', () => {
|
||||
test( 'it renders correctly', () => {
|
||||
const tree = renderer.create( <Card title="A Card Example" /> ).toJSON();
|
||||
expect( tree ).toMatchSnapshot();
|
||||
} );
|
||||
|
||||
test( 'should have correct title', () => {
|
||||
const card = <Card title="A Card Example" />;
|
||||
expect( card.props.title ).toBe( 'A Card Example' );
|
||||
|
|
Loading…
Reference in New Issue