@navinc/base-react-components
Version:
Nav's Pattern Library
20 lines (18 loc) • 576 B
JavaScript
import React from 'react'
import { render } from '@testing-library/react'
import Text from './text.js'
import TabGroup from './tab-group.js'
describe('TabGroup', () => {
it('renders the tab group', () => {
const { getByTestId } = render(<TabGroup />)
expect(getByTestId('tab-group'))
})
it('renders a tab for each child element', () => {
const { getByText } = render(
<TabGroup>
{[<Text key="first">first</Text>, <Text key="second">second</Text>, <Text key="third">third</Text>]}
</TabGroup>
)
expect(getByText('third'))
})
})