mirror of
https://github.com/react95-io/React95.git
synced 2026-04-26 03:00:18 -04:00
add TableBody tests
This commit is contained in:
28
src/components/TableBody/TableBody.spec.js
Normal file
28
src/components/TableBody/TableBody.spec.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
|
||||
import { renderWithTheme } from '../../../test/utils';
|
||||
|
||||
import TableBody from './TableBody';
|
||||
|
||||
describe('<TableBody />', () => {
|
||||
it('renders TableBody', () => {
|
||||
const { container } = renderWithTheme(<TableBody />);
|
||||
const list = container.firstChild;
|
||||
|
||||
expect(list).toBeInTheDocument();
|
||||
});
|
||||
it('renders tbody element', () => {
|
||||
const { container } = renderWithTheme(<TableBody />);
|
||||
|
||||
expect(container.querySelector('tbody')).toBeInTheDocument();
|
||||
});
|
||||
it('renders children', () => {
|
||||
const textContent = 'Hi there!';
|
||||
const { getByText } = renderWithTheme(
|
||||
<TableBody>
|
||||
<span>{textContent}</span>
|
||||
</TableBody>
|
||||
);
|
||||
expect(getByText(textContent)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user