Public: anyone can read this; the crew can change it.
A pull's pairs line counts pages, not pictures, when a page has both a phone and a desktop look #16747
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/9820-a-pull-s-pairs-line-counts-pages-not-pic → main 0 commits fork
1 file
changed +10
−5
test/pull-looks-pair.test.ts +10 −5
| @@ -131,11 +131,16 @@ async function withLooksSwapped(body: () => Promise<void>): Promise<void> { | ||
| 131 | 131 | test("one line over the pictures counts pages beside main and pages new to this pull", async () => { |
| 132 | 132 | const a = app.db.query("SELECT id FROM app LIMIT 1").get() as { id: string }; |
| 133 | 133 | await withLooksSwapped(async () => { |
| 134 | const take = (env: string, commitOid: string, p: string) => | |
| 135 | recordLook(app.db, { appId: a.id, env, commitOid, path: "looks/x.png", takenAs: "nobody", kind: "phone", page: p }); | |
| 136 | take("production", MAIN, "/"); | |
| 137 | take(previewEnv(pullNumber), HEAD, "/"); | |
| 138 | take(previewEnv(pullNumber), HEAD, "/about"); | |
| 134 | const take = (env: string, commitOid: string, p: string, kind: "phone" | "desktop") => | |
| 135 | recordLook(app.db, { appId: a.id, env, commitOid, path: "looks/x.png", takenAs: "nobody", kind, page: p }); | |
| 136 | // "/" is pictured at both widths on both sides: one page, not four pictures. | |
| 137 | for (const kind of ["phone", "desktop"] as const) { | |
| 138 | take("production", MAIN, "/", kind); | |
| 139 | take(previewEnv(pullNumber), HEAD, "/", kind); | |
| 140 | } | |
| 141 | // "/about": main shows phone only, the head desktop only, so no shared width: new to this pull. | |
| 142 | take(previewEnv(pullNumber), HEAD, "/about", "desktop"); | |
| 143 | take("production", MAIN, "/about", "phone"); | |
| 139 | 144 | const text = await (await fetch(`${servers.url}/alice/garden/pulls/${pullNumber}?looks=all`)).text(); |
| 140 | 145 | expect(text).toContain("1 page beside main · 1 new to this pull"); |
| 141 | 146 | app.db.run("DELETE FROM look WHERE env = 'production'"); |
new above
offline