import React from 'react';
import { create } from 'react-test-renderer';
import { shallowJSON } from '../../src';
import {
Empty,
Button,
ListItem,
List,
TableHead,
TableHeadCell,
Table,
TableRow,
TableFoot,
TableCell,
TableBody,
EmptyNamed,
ButtonNamed,
ListItemNamed,
ListNamed,
TableHeadNamed,
TableHeadCellNamed,
TableNamed,
TableRowNamed,
TableFootNamed,
TableCellNamed,
TableBodyNamed,
} from './Memo';
describe('Empty', () => {
it('matches snapshot', () => {
expect(shallowJSON(create().toTree())).toMatchSnapshot();
});
it('matches named snapshot', () => {
expect(shallowJSON(create().toTree())).toMatchSnapshot();
});
});
describe('Button', () => {
it('matches snapshot', () => {
expect(
shallowJSON(create().toTree())
).toMatchSnapshot();
});
it('matches named snapshot', () => {
expect(
shallowJSON(create().toTree())
).toMatchSnapshot();
});
});
describe('List', () => {
it('matches snapshot', () => {
expect(
shallowJSON(
create(
{['A', 'B', 'C'].map((children, index) => (
{children}
))}
).toTree()
)
).toMatchSnapshot();
});
it('matches named snapshot', () => {
expect(
shallowJSON(
create(
{['A', 'B', 'C'].map((children, index) => (
{children}
))}
).toTree()
)
).toMatchSnapshot();
});
});
describe('Table', () => {
it('matches snapshot', () => {
expect(
shallowJSON(
create(
Head A
Head B
Head C
Foot A
Foot B
Foot C
{[
['A', 'B', 'C'],
['X', 'Y', 'Z'],
].map((row, rowIndex) => (
{row.map((cell, cellIndex) => (
{cell}
))}
))}
).toTree()
)
).toMatchSnapshot();
});
it('matches named snapshot', () => {
expect(
shallowJSON(
create(
Head A
Head B
Head C
Foot A
Foot B
Foot C
{[
['A', 'B', 'C'],
['X', 'Y', 'Z'],
].map((row, rowIndex) => (
{row.map((cell, cellIndex) => (
{cell}
))}
))}
).toTree()
)
).toMatchSnapshot();
});
});