Repository navigation
test: read How it works' own heading from its header, not every h1 on the page - #6525
Merged
Merged
Conversation
… the page #6459 shows each prompt Leaf sends a model in a Markdown preview on How it works, and the turn-end check's prompt opens with `# Turn-end check`, which the preview draws as an h1, as GitHub draws a file's heading. The product-route journey asserted that the page holds exactly one h1, so it failed strict mode. It now reads the h1 in the page's own header (#top), which every product source carries; what it protects, that each route draws its authored title heading, is unchanged, and the preview keeps drawing the file's headings as written. Closes #6519
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.
test_every_product_route_is_a_live_leaf_pagenow reads each product page's heading from the page's own header (#top h1) instead of asserting that the page holds a singleh1. Since #6459, How it works shows each prompt Leaf sends a model in anlf-text-document preview="markdown", and the turn-end check's prompt (skills/leaf/references/turn-end-check.md) opens with# Turn-end check, which the preview draws as a secondh1. That made the strictpage.locator("h1")match two elements.The repair keeps both #6459's intent and the preview's behavior: a Markdown preview draws a file's headings at the levels the file wrote, as GitHub draws a file, and Leaf's other embedded documents (a thread message's Markdown, an
lf-sample's page) keep their own headings too. Shifting the preview's heading levels would add a rewrite pass over rendered Markdown to satisfy a test. Every file indocs/carries itsh1inheader#top, so the assertion still protects what it did: each route draws its authored title heading.Verification: the test failed on
dd38dcb16with the strict-mode violation the issue quotes, and passes with this change (uv run pytest "tests/journeys/test_site.py::test_every_product_route_is_a_live_leaf_page").Closes #6519 — automated triage