refactor(onboarding): remove aria-hidden workaround from progress sidebar
Replace getByText with getByRole(heading) in page test to disambiguate the duplicate "Haushalt benennen" text between sidebar and form. Revert defaultIgnore change in test-setup.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
<!-- Desktop progress sidebar — hidden on mobile -->
|
||||
<aside
|
||||
class="hidden md:flex w-[300px] flex-shrink-0 flex-col bg-[var(--color-surface)] border-r border-[var(--color-border)] p-[40px_28px]"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<ProgressSidebar currentStep={1} />
|
||||
</aside>
|
||||
|
||||
@@ -9,7 +9,7 @@ vi.mock('$app/forms', () => ({
|
||||
describe('household setup page', () => {
|
||||
it('renders the form heading', () => {
|
||||
render(Page);
|
||||
expect(screen.getByText('Haushalt benennen')).toBeInTheDocument();
|
||||
expect(screen.getByRole('heading', { name: 'Haushalt benennen' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the household name input', () => {
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
import { configure } from '@testing-library/dom';
|
||||
|
||||
// Exclude elements inside aria-hidden containers from text queries,
|
||||
// so that visually-hidden sidebars (e.g. ProgressSidebar in onboarding pages)
|
||||
// don't create duplicate text matches when the same text appears in the main content.
|
||||
configure({ defaultIgnore: 'script, style, [aria-hidden="true"] *' });
|
||||
|
||||
Reference in New Issue
Block a user