Skip to content

test: name the component for a link in the div that closes its paragraph - #518

Merged
JuroOravec merged 1 commit into
mainfrom
test/paragraph-root-after-p-closes
Oct 28, 2026
Merged

JuroOravec merged 1 commit into
mainfrom
test/paragraph-root-after-p-closes

Conversation

@JuroOravec

@JuroOravec JuroOravec commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

This fixes a test on main that #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 names Paragraph, 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.py gets 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.
  • The citry, citry_ui and pygments_citry suites otherwise pass. This was the only failure.

No changelog entry: this changes only a test.

🤖 Generated with Claude Code

#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
JuroOravec force-pushed the test/paragraph-root-after-p-closes branch from c68ce3d to ec21d02 Compare October 28, 2026 19:54
@JuroOravec
JuroOravec merged commit be2d3da into main Oct 28, 2026
0 of 20 checks passed
@JuroOravec
JuroOravec deleted the test/paragraph-root-after-p-closes branch October 28, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant