test(flow): the Desk strip asserts the thumbnail, and says why it moved

design-dev's test read 'the originals shown small (no generated thumbnail)',
which was true when written and is precisely what the operator rejected: four
images per booth on the page he opens first was the heaviest surface in the
service.

Declared rather than quietly edited, per the rule that an existing assertion is
not changed to make a change pass. The behaviour genuinely changed, on his own
instruction to swap all four small surfaces in one commit.

Worth recording in the docstring: the URL carries ?thumb=1 from the EXTENSION
alone, with no disk read, so a tiny stub fixture still gets the parameter and
the route serves the original when there is nothing worth generating. The URL
never depends on what is on disk.

39/39 falsifiers proved across both mutation tables.
This commit is contained in:
vh
2026-09-23 10:57:04 -07:00
parent 9aa91d5dc7
commit ff35023377
+14 -3
View File
@@ -389,8 +389,18 @@ def test_a_damaged_bench_registry_says_so_rather_than_rendering_empty(tmp_path):
def test_a_row_previews_four_images_keeps_blur_and_counts_flags(tmp_path):
"""The originals shown small (no generated thumbnail), the first four in
item order, a blurred one still blurred. The flag count is on the row."""
"""The first four in item order, a blurred one still blurred, the flag
count on the row.
⚠ THE SOURCE CHANGED AFTER R2 AND THE ASSERTION MOVED WITH IT. This
originally read "the originals shown small (no generated thumbnail)", which
was true when written and is what the operator rejected: the strip is four
images per booth on the page he opens first, and on the live set that was
the heaviest surface in the service. The strip now asks for `?thumb=1`.
The URL carries `?thumb=1` from the extension alone, without a disk read —
so a tiny stub like this fixture still gets the parameter, and the route
simply serves the original when there is nothing worth generating."""
from booth.app import set_blurred
b = _booth(tmp_path, "g", {f"{n}.png": PNG for n in "abcde"})
set_blurred(b, "b.png", True)
@@ -399,7 +409,8 @@ def test_a_row_previews_four_images_keeps_blur_and_counts_flags(tmp_path):
body = _client(tmp_path).get("/").text
row = re.search(r'<article class="desk-row[^"]*" data-booth="g".*?</article>', body, re.S).group(0)
imgs = re.findall(r'<img class="([^"]*)" loading="lazy" src="/b/g/([^"]+)"', row)
assert imgs == [("", "a.png"), ("blurred-thumb", "b.png"), ("", "c.png"), ("", "d.png")]
assert imgs == [("", "a.png?thumb=1"), ("blurred-thumb", "b.png?thumb=1"),
("", "c.png?thumb=1"), ("", "d.png?thumb=1")]
assert "2 flagged" in row