search.spec: Fehl-Klick entfernt — Reload IST der Weg zurück in den Lesemodus
Der Spec klickte nach page.reload() den Mode-Toggle „um den Edit-Modus zu verlassen" — nach dem Reload ist die Seite aber schon im Lesemodus (React- State resettet), der Klick wechselte also HINEIN. Das passierte jahrelang folgenlos, weil der Fokus auf dem Toggle-Button blieb und „/" die Suche öffnete. Seit dem Editor-Auto-Fokus (PR #140) landet der Fokus im Editor und „/" wird dort zu Text — je nach Ausgang des Rennens gegen den rAF- verzögerten Fokus mal grün (Läufe 381/385), mal rot (383/387/389/390). Fix: den Klick streichen; „/" läuft im Lesemodus als globaler Shortcut. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0155v2aT8AG1kZDQEZiCLBWC
This commit is contained in:
parent
d07f8bb8e1
commit
dff4bf8994
@ -39,8 +39,13 @@ test('search finds page content, highlights it, and is keyboard-operable', async
|
||||
await page.keyboard.type(`the unique ${word} lives in this body`);
|
||||
await page.reload();
|
||||
await expect(page.locator('.editor-content')).toContainText(word);
|
||||
// Leave edit mode so "/" is a shortcut, not editor input.
|
||||
await page.locator('.editor-page__mode-toggle').click();
|
||||
// The reload already landed back in read mode (the mode state resets), so
|
||||
// "/" acts as the global shortcut here. This spec used to click the mode
|
||||
// toggle again "to leave edit mode" — which actually RE-ENTERED it; that
|
||||
// passed only while entering edit mode left focus on the toggle button.
|
||||
// Since the editor grabs focus on entering edit mode (PR #140), "/" would
|
||||
// become ordinary editor input there, racing the deferred focus — the
|
||||
// intermittent-then-persistent failure of this pack.
|
||||
|
||||
// Open search with the "/" shortcut.
|
||||
await page.keyboard.press('/');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user