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:
2026-04-02 19:28:46 +02:00
parent 6de7f5a9b5
commit e5614ccf30
3 changed files with 1 additions and 8 deletions

View File

@@ -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>

View File

@@ -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', () => {

View File

@@ -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"] *' });