Skip to content

test: address the sample's api/state from its document base, not its thread URL - #7023

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7018
Nov 24, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-7018

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Since #6799, the sample frame's URL carries the open thread (?thread=<id>), so _read_by_the_sample in tests/journeys/test_render_read_state.py built …/?thread=<id>api/state from child.url. That requested the page document, and five journeys failed parsing it as JSON (Unexpected UTF-8 BOM). The helper now resolves api/state against the frame's document.baseURI, as tests/browser/test_render_controls.py already does, so a query on the page URL no longer changes the address. #6799 meant the address bar to name the thread. This change accepts that and leaves the tests' assertions as they were.

Run locally with -n0, all five failed on main (e80dd78be) with the BOM error and all five pass with this change:

  • test_render_read_state.py::test_a_sample_in_a_native_modal_escapes_inherited_inertness
  • test_render_read_state.py::test_clipped_sample_cannot_acknowledge_child_viewport
  • test_render_read_state.py::test_offscreen_sample_cannot_acknowledge_child_viewport
  • test_render_sample_visibility.py::test_narrowing_a_partially_clipped_sample_does_not_acknowledge_hidden_words
  • test_render_sample_visibility.py::test_sample_exposure_preserves_parent_declared_occlusion

Pull requests don't run journeys/, so this PR's CI won't exercise them.

Closes #7018 — automated triage

Since #6799, the sample frame's URL ends in `?thread=<id>`, so appending
`api/state` to it requested the page document, and five journeys failed
parsing that document as JSON. `_read_by_the_sample` now resolves
`api/state` against the frame's `document.baseURI`, as
`tests/browser/test_render_controls.py` already does. The behavior the
tests protect is unchanged.

Closes #7018
@leaf-agent
leaf-agent merged commit d2d927d into main Nov 24, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7018 branch November 24, 2026 17:37
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.

test_render_read_state and test_render_sample_visibility: api/state returns a BOM document since #6799 named the thread in the URL

1 participant