Skip to content

Commit

Permalink
Update tabsList.test.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth committed Feb 18, 2025
1 parent a2e12ab commit f19bd90
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/components/tabs/tabsList/tabsList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ import { render, screen } from '@testing-library/react';
import { type ITabsListProps, Tabs } from '../../tabs';

describe('<Tabs.List /> component', () => {
const createTestComponent = (props: Partial<ITabsListProps>) => {
const completeProps: ITabsListProps = { ...props };
const createTestComponent = (props?: Partial<ITabsListProps>) => {
const completeProps: ITabsListProps = {
...props,
};

return (
<Tabs.Root>
<Tabs.List {...completeProps} />
</Tabs.Root>
);
};

it('should render multiple tab triggers without crashing', () => {
it('renders multiple tab triggers', () => {
const children = [
<Tabs.Trigger key="1" label="Tab 1" value="1" />,
<Tabs.Trigger key="2" label="Tab 2" value="2" />,
Expand All @@ -22,7 +25,7 @@ describe('<Tabs.List /> component', () => {
expect(screen.getByText('Tab 2')).toBeInTheDocument();
});

it('should render null when only a single tab trigger is present', () => {
it('renders null when only a single tab trigger is present', () => {
const children = <Tabs.Trigger label="Tab 1" value="1" />;
render(createTestComponent({ children }));

Expand Down

0 comments on commit f19bd90

Please sign in to comment.