Add test coverage for search highlight persistence (#14047, #9802)#14049
Add test coverage for search highlight persistence (#14047, #9802)#14049
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
FWIW I have find this problem and this fix by looking at some more ideas to improve search user experience as we discussed. I assumed something was not correct, and found that. This is the required change to follow up on my other ideas. I'll share at next meeting what this enable. |
|
Tested the interaction with text fragments from #14003 (context: #13123). This PR does not worsen the text fragment situation. On fuse.js sites, the This fix correctly preserves the JS |
|
This needs to be looked at in addition to other one |
|
Other PR for this: #13442 |
Complements the persistence test by confirming that quarto-hrChanged does clear marks after the 1000ms registration delay elapses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR #13442 removed scroll-based highlight clearing. This commit adds Playwright tests verifying: scroll events never clear marks, query-change clearing still works, and no marks appear without ?q= parameter. Restores test fixture files dropped during rebase (source files were in the skipped JS fix commit). Updates changelog to credit @jtbayly and reference both #9802 and #14047. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
85b9c91 to
a5434e6
Compare
The previous test dispatched quarto-hrChanged/quarto-sectionChanged custom events, which were leftovers from when search code listened to those events. Since #13442 removed those listeners entirely, dispatching those events tested nothing. Replace with actual scroll behavior which is the real user scenario from #14047. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace .aa-DetachedSearchButton and .aa-Input with ARIA role
locators (getByRole('button'), getByRole('searchbox')). These are
resilient to Algolia autocomplete class name changes and follow
Playwright best practices used elsewhere in the test suite.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR #13442 by @jtbayly removed scroll-based search highlight clearing, fixing
both #9802 (highlights cleared on scroll) and #14047 (highlights cleared by
layout events before user sees them).
This PR adds Playwright test coverage and a changelog entry for the expected behavior:
?q=parameterCloses #14047