From abe5d6210267699172e6f6476613cced40cfd977 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 9 Jun 2026 19:21:58 +0200 Subject: [PATCH] fix(test): update JourneyEditor spec to use getByText after listbox role downgrade Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/geschichte/JourneyEditor.svelte.spec.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/geschichte/JourneyEditor.svelte.spec.ts b/frontend/src/lib/geschichte/JourneyEditor.svelte.spec.ts index 7aa12599..496f0358 100644 --- a/frontend/src/lib/geschichte/JourneyEditor.svelte.spec.ts +++ b/frontend/src/lib/geschichte/JourneyEditor.svelte.spec.ts @@ -150,7 +150,7 @@ describe('JourneyEditor — add document', () => { await userEvent.click(page.getByText('Brief hinzufügen')); await userEvent.fill(page.getByRole('combobox'), 'Karl'); await new Promise((r) => setTimeout(r, 350)); // wait debounce - await userEvent.click(page.getByRole('option', { name: /Brief von Karl/ })); + await userEvent.click(page.getByText(/Brief von Karl/)); expect(globalThis.fetch).toHaveBeenCalledWith( expect.stringContaining('/items'), @@ -386,7 +386,10 @@ describe('JourneyEditor — duplicate document aria-disabled', () => { await userEvent.fill(page.getByRole('combobox'), 'Karl'); await new Promise((r) => setTimeout(r, 350)); - const option = page.getByRole('option', { name: /Brief von Karl/ }); - await expect.element(option).toHaveAttribute('aria-disabled', 'true'); + const option = page + .getByText(/Brief von Karl/) + .element() + .closest('li')!; + expect(option.getAttribute('aria-disabled')).toBe('true'); }); });