UNPKG

@swrve/core

Version:

Core set of Swrve UI Components

74 lines (69 loc) 1.93 kB
import React from 'react' import { render } from '@testing-library/react' import Table from '../table' import Body from '../body' import Row from '../row' import Cell from '../cell' describe('<Table/>', () => { it('should render', () => { const { container } = render(<Table />) expect(container).toMatchSnapshot() }) it('should render a striped table when type is passed as striped', () => { const { container } = render( <Table type="striped"> <Body> <Row> <Cell>{'Cell One'}</Cell> <Cell>{'Cell Two'}</Cell> <Cell>{'Cell Three'}</Cell> </Row> <Row> <Cell>{'Cell Four'}</Cell> <Cell>{'Cell Five'}</Cell> <Cell>{'Cell Six'}</Cell> </Row> </Body> </Table> ) expect(container).toMatchSnapshot() }) it('should render a dark table when type is passed as dark', () => { const { container } = render( <Table type="dark"> <Body> <Row> <Cell>{'Cell One'}</Cell> <Cell>{'Cell Two'}</Cell> <Cell>{'Cell Three'}</Cell> </Row> <Row> <Cell>{'Cell Four'}</Cell> <Cell>{'Cell Five'}</Cell> <Cell>{'Cell Six'}</Cell> </Row> </Body> </Table> ) expect(container).toMatchSnapshot() }) it('should render a light table when type is passed as light', () => { const { container } = render( <Table type="light"> <Body> <Row> <Cell>{'Cell One'}</Cell> <Cell>{'Cell Two'}</Cell> <Cell>{'Cell Three'}</Cell> </Row> <Row> <Cell>{'Cell Four'}</Cell> <Cell>{'Cell Five'}</Cell> <Cell>{'Cell Six'}</Cell> </Row> </Body> </Table> ) expect(container).toMatchSnapshot() }) })