@engie-group/fluid-design-system-react
Version:
Fluid Design System React
35 lines (29 loc) • 899 B
JSX
import renderer from 'react-test-renderer';
import React from 'react';
import { NJCardBody as FluidLib } from '../../../../lib/index';
import { NJCardBody as Source } from '../../../../src/components/card/NJCardBody';
let container;
beforeEach(() => {
container = document.createElement('div');
document.body.appendChild(container);
});
afterEach(() => {
document.body.removeChild(container);
container = null;
});
it('renders correctly using global library', () => {
const tree = renderer
.create(<FluidLib className="classTest" heading="Title" paragraph="Paragraph" />)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('render all props', () => {
let tree = renderer
.create(
<Source className="classTest" heading="Title" paragraph="Paragraph">
<div>un test de children</div>
</Source>
)
.toJSON();
expect(tree).toMatchSnapshot();
});