Repository navigation
test: name the component for a link in the div that closes its paragraph - #518
Merged
Merged
Conversation
#510 marks the elements the browser places at a component's top level, including a `<div>` that closes an open `<p>`. So in `<p>text<div><a ...></a></div></p>` a finding on the link inside the `<div>` names the component. The test still expected the older result, where only the `<p>` was marked. A second test keeps the case that test was written for: a child component's `<div>` closes the parent's `<p>`, so the browser moves the parent's link out of every root, and the report must not name a component. Co-Authored-By: Claude Opus 5.5 <[email protected]>
JuroOravec
force-pushed
the
test/paragraph-root-after-p-closes
branch
from
October 28, 2026 19:54
c68ce3d to
ec21d02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a test on
mainthat #510 broke. #510's CI runs were cancelled rather than run to the end, so it merged without them.The template is
<p>text<div><a href="javascript:void(0)">x</a></div></p>. The browser closes the<p>when the<div>starts, so the<div>becomes a second top-level element of the component. Since #510, Citry marks it as one of the component's roots (<div data-cid-...>), the way the browser reads it. A finding on the link inside it now namesParagraph, not "settled render output".That is the more accurate answer: in the browser's tree, the link sits inside an element the component rendered at its top level. The test in
test_output_policy.pygets a new name and the new expected message.The old test was there to show that the report follows the browser's tree, not the nesting in the source. The new input cannot show that, because the
<p>and the<div>carry the same marker. So a second test covers it: a child component's<div>closes the parent's<p>, and the browser moves the parent's link out of every root. Each component's roots are marked separately, so in the source the link still sits inside the parent's<p>. The report names "settled render output", not the parent.Checks run locally against a build of
main(e1c370f):test_output_policy.py: 22 tests pass.citry,citry_uiandpygments_citrysuites otherwise pass. This was the only failure.No changelog entry: this changes only a test.
🤖 Generated with Claude Code