Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,11 @@ once per worker for the ordinary layer, clones that initialized page for each te
writes the document as v1, copies the example media that document names, adds
the publishing note and any requested comments, then serves the directory with the
real HTTP handler and page key. Handed an example's path rather than its markup it
also lays in the log that example ships, and sets the cursor past it: a page is
what its markup and its standing log make together, and a thread — or a widget a
message carries — exists nowhere else. Pass the markup where the log would be
noise for the subject, and say which in a comment. Reach its page directory through `serve.page_dir`
also lays in the external data and event log the example ships, and sets the cursor
past the log. Use `serve(example, seed_log=False)` when only the shipped conversation
would be noise; the external data still belongs to the example. A page is what its
markup and standing log make together, and a thread — or a widget a message carries —
exists nowhere else. Reach its page directory through `serve.page_dir`
when a test needs to publish v2 or inspect the log; do not construct a parallel
directory whose relationship to the served URL is implicit. `page_dir` in
`interact_support.py` owns command-level files without starting a browser and clones
Expand Down
4 changes: 2 additions & 2 deletions tests/test_render_controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3073,7 +3073,7 @@ def test_the_ring_reading_names_every_way_a_box_can_draw_nothing_past_its_edge(
stop would pass the other three and prove nothing.
"""
example = next(e for e in EXAMPLES if e.stem == "release-notes")
url = serve(example.read_text(), comments=2)
url = serve(example, comments=2, seed_log=False)
page, errors = open_page(browser, url)
page.locator(".lf-sug-accept").first.focus()
# The probe's control must begin clear of the viewport edge. Its subject is each
Expand Down Expand Up @@ -3135,7 +3135,7 @@ def test_the_ring_reading_tells_a_ring_from_the_layers_other_outlines(browser, s
The real ring goes last, as the control: without it a reading that claimed nothing at
all would pass the three cases above and prove only that it was silent."""
example = next(e for e in EXAMPLES if e.stem == "release-notes")
url = serve(example.read_text(), comments=2)
url = serve(example, comments=2, seed_log=False)
page, errors = open_page(browser, url)
page.locator(".lf-sug-accept").first.focus()

Expand Down
4 changes: 3 additions & 1 deletion tests/test_render_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ def test_a_reload_mid_flight_never_wedges_round_trip(browser, serve):
on one; the assertion is Traffic's books balancing, and then `round_trip`
returning on a page whose only unfinished trip ended at the reload."""
gallery = next(p for p in EXAMPLES if p.stem == "gallery")
url = serve(gallery.read_text())
# The example itself, so the data its markup selects is laid in beside it; its
# conversation is not, because the asks the cascade answers are the markup's.
url = serve(gallery, seed_log=False)
# The console is not the subject here: a reload mid-post leaves Chrome's own
# "Failed to load resource" behind, which is the navigation working.
page, _ = open_page(browser, url)
Expand Down
10 changes: 6 additions & 4 deletions tests/test_render_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -2480,11 +2480,11 @@ def test_the_specimen_gutter_is_painted_in_both_schemes(browser, serve):


@pytest.mark.parametrize(
"html",
[SPECIMEN_PAGE, *(p.read_text() for p in SPECIMEN_EXAMPLES)],
"source",
[SPECIMEN_PAGE, *SPECIMEN_EXAMPLES],
ids=["fixture", *(p.stem for p in SPECIMEN_EXAMPLES)],
)
def test_the_gutter_runs_beside_the_exhibit_and_no_further(html, browser, serve):
def test_the_gutter_runs_beside_the_exhibit_and_no_further(source, browser, serve):
"""The gutter marks what is quoted and nothing else, at both ends, and two separate
things had to be true for that. The "quoted ·" note over the bar is the theme's word
*about* the region rather than a word in it, and the bar opened at the note, drawing
Expand All @@ -2508,7 +2508,9 @@ def test_the_gutter_runs_beside_the_exhibit_and_no_further(html, browser, serve)
where the next one gets caught."""
from PIL import Image # a dev dependency already, for the demo recorder

page, errors = open_page(browser, serve(html))
# The examples by path, so each is served with the data its markup selects; their
# conversations are left off, since the bar is drawn around what the markup exhibits.
page, errors = open_page(browser, serve(source, seed_log=False))
assert errors == []
scale = page.evaluate("() => devicePixelRatio")
# Rendered, not merely present. A specimen inside a tab panel the page is not
Expand Down
Loading