diff --git a/src/components/Tabs/Tabs.test.tsx b/src/components/Tabs/Tabs.test.tsx index 629d54d0..d4c97f61 100644 --- a/src/components/Tabs/Tabs.test.tsx +++ b/src/components/Tabs/Tabs.test.tsx @@ -27,6 +27,8 @@ describe('Tabs', () => { // Verify default tab content is visible expect(screen.getByText('Overview content')).toBeVisible(); + expect(screen.getByRole('tabpanel', { name: 'Overview' })).toBeInTheDocument(); + expect(screen.queryByRole('tabpanel', { name: 'Browse lots' })).not.toBeInTheDocument(); }); test('renders ReactNode in tab', () => { const componentTabs = [ @@ -66,6 +68,8 @@ describe('Tabs', () => { await userEvent.click(screen.getByRole('tab', { name: /Browse/i })); expect(screen.getByText('Browse lots content')).toBeVisible(); + expect(screen.getByRole('tabpanel', { name: 'Browse lots' })).toBeInTheDocument(); + expect(screen.queryByRole('tabpanel', { name: 'Overview' })).not.toBeInTheDocument(); }); test('calls onTabClick when a tab is clicked', async () => { const onTabClickMock = vitest.fn(); diff --git a/src/components/Tabs/TabsContent.tsx b/src/components/Tabs/TabsContent.tsx index 3f176929..1420aa20 100644 --- a/src/components/Tabs/TabsContent.tsx +++ b/src/components/Tabs/TabsContent.tsx @@ -36,7 +36,6 @@ const TabsContent = forwardRef( {...commonProps} ref={ref} tabIndex={-1} - aria-hidden > {children}