Skip to content

Commit

Permalink
Add a snapshot match test for Table
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnadeluy committed Jun 6, 2024
1 parent 7561080 commit 8be5b66
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/components/Table/table.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';

import { render } from '../../utils/test'
import Table from './index';

describe('Table component', () => {
test('Matches the snapshot', () => {
const { asFragment } = render(
<Table>
<TableHead>
<TableRow>
<TableCell type="th">Header</TableCell>
<TableCell type="th" align="right">Header</TableCell>
<TableCell type="th"></TableCell>
</TableRow>
</TableHead>
<TableBody>
<TableRow>
<TableCell>Example</TableCell>
<TableCell align="right">1000</TableCell>
<TableCell align="center">Center</TableCell>
</TableRow>
<TableRow>
<TableCell>Example</TableCell>
<TableCell align="right">500</TableCell>
<TableCell align="center">Center</TableCell>
</TableRow>
</TableBody>
</Table>
);
expect(asFragment()).toMatchSnapshot();
});
});

0 comments on commit 8be5b66

Please sign in to comment.