fix(tests): fix 2 more pre-existing vitest-browser spec failures
TranscriptionEditView: fix 4 failing tests: - textarea → [role="textbox"] selector (editor is contenteditable, not <textarea>) - button clicks → dispatchEvent(MouseEvent) for reliable Svelte 5 onclick with TipTap - mentionedPersons test: init block with @mention token so deserialize() creates a mention node; use userEvent.type + vi.waitFor (real timers) instead of fill + fake timers, which prevents TipTap onUpdate from firing the debounce timer EntityNavSection: anchor link click → add capture-phase preventDefault before clicking to stop iframe navigation while allowing Svelte onclick handler to run Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -134,7 +134,13 @@ describe('EntityNavSection — flyout variant', () => {
|
||||
called = true;
|
||||
}
|
||||
});
|
||||
document.querySelector<HTMLAnchorElement>('a[href="/admin/users"]')!.click();
|
||||
const link = document.querySelector<HTMLAnchorElement>('a[href="/admin/users"]')!;
|
||||
// Prevent the browser from navigating the test iframe to /admin/users (which
|
||||
// would redirect to /login and kill the iframe connection). preventDefault()
|
||||
// on the capture phase suppresses navigation while still letting the Svelte
|
||||
// onclick handler (onFlyoutClick) run on the bubbling phase.
|
||||
link.addEventListener('click', (e) => e.preventDefault(), { capture: true, once: true });
|
||||
link.click();
|
||||
expect(called).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user