mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
16 lines
462 B
TypeScript
16 lines
462 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import { Tab, TabView, TabViewProps } from './TabView';
|
|
|
|
const makeView = (props: Partial<TabViewProps> = {}) =>
|
|
render(
|
|
<TabView {...props}>
|
|
<Tab title="Tab 1">{() => <div>tab 1</div>}</Tab>
|
|
<Tab title="Tab 2">{() => <div>tab 2</div>}</Tab>,
|
|
</TabView>
|
|
);
|
|
|
|
it('renders tab content correctly', () => {
|
|
makeView();
|
|
|
|
expect(screen.getAllByText(/tab [1-2]/)).toHaveLength(2);
|
|
});
|