| 5 | import type {TableProps} from '../Table' |
| 6 | |
| 7 | function createTable({columns, rows}: {columns: Array<string>; rows: Array<Array<string>>}) { |
| 8 | return ( |
| 9 | <Table> |
| 10 | <Table.Head> |
| 11 | <Table.Row> |
| 12 | {columns.map(column => { |
| 13 | return <Table.Header key={column}>{column}</Table.Header> |
| 14 | })} |
| 15 | </Table.Row> |
| 16 | </Table.Head> |
| 17 | <Table.Body> |
| 18 | {rows.map((row, index) => { |
| 19 | return ( |
| 20 | <Table.Row key={index}> |
| 21 | {row.map(cell => ( |
| 22 | <Table.Cell key={cell}>{cell}</Table.Cell> |
| 23 | ))} |
| 24 | </Table.Row> |
| 25 | ) |
| 26 | })} |
| 27 | </Table.Body> |
| 28 | </Table> |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | describe('Table', () => { |
| 33 | it('should render an element with role="table" semantics', () => { |