@trellixio/roaster-coffee
Version:
Beans' product component library
10 lines (9 loc) • 447 B
JavaScript
import React from 'react';
import { render } from '@testing-library/react';
export function itRendersChildren(Component, requiredProps) {
it('renders children', () => {
const { queryAllByText } = render(React.createElement(Component, Object.assign({}, requiredProps),
React.createElement("span", { className: "test-children" }, "test-children")));
expect(queryAllByText('test-children')).toHaveLength(1);
});
}