Public: anyone can read this; the crew can change it.
The signed-out home has looks at 360 and 1280 px, light and dark, before and after the speed work #13147
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/13122-the-signed-out-home-has-looks-at-360-and → main 6 commits fork 4 threads · 4 unresolved
2 files
changed +55
−0
test/looks-owner.test.ts +10
| @@ -539,6 +539,16 @@ describe("looks of a public app", () => { | ||
| 539 | 539 | expect(call).toBeDefined(); |
| 540 | 540 | const grant = readGrant(dataDir, new URL(call!.url).searchParams.get("t") ?? "", { app: record, env }); |
| 541 | 541 | expect(grant?.who).toBeUndefined(); |
| 542 | // And the same page in the dark, also with no session (#13122). | |
| 543 | const dark = calls.find( | |
| 544 | (c) => | |
| 545 | c.url.includes(`forge--${opened.value.number}.`) && | |
| 546 | new URL(c.url).searchParams.get("to") === PREVIEW_SIGNED_OUT_PAGE && | |
| 547 | c.width === width && | |
| 548 | c.dark === true, | |
| 549 | ); | |
| 550 | expect(dark).toBeDefined(); | |
| 551 | expect(readGrant(dataDir, new URL(dark!.url).searchParams.get("t") ?? "", { app: record, env })?.who).toBeUndefined(); | |
| 542 | 552 | } |
| 543 | 553 | }, 120_000); |
| 544 | 554 |
test/signed-out-home.looks.test.ts added +45
| @@ -0,0 +1,45 @@ | ||
| 1 | /** | |
| 2 | * The signed-out home holds its shape (#13122). Opened with no session in a | |
| 3 | * real Chromium, nothing moves between first paint and the settled page | |
| 4 | * (layout shift 0). Its pictures, light and dark, as nobody, are held in | |
| 5 | * test/looks-owner.test.ts. | |
| 6 | */ | |
| 7 | import { afterAll, beforeAll, describe, expect, test } from "bun:test"; | |
| 8 | import { mkdtemp, rm } from "node:fs/promises"; | |
| 9 | import { tmpdir } from "node:os"; | |
| 10 | import { join } from "node:path"; | |
| 11 | import { createApp, type App } from "../src/app.ts"; | |
| 12 | import { serve, type Servers } from "../src/http/server.ts"; | |
| 13 | import { findChromium } from "../src/looks/capture.ts"; | |
| 14 | import { PREVIEW_SIGNED_OUT_PAGE } from "../src/spawn/preview-looks.ts"; | |
| 15 | import { chromiumRuns, observeNavigations } from "./helpers/chrome.ts"; | |
| 16 | ||
| 17 | let dir: string; | |
| 18 | let app: App; | |
| 19 | let servers: Servers; | |
| 20 | ||
| 21 | beforeAll(async () => { | |
| 22 | dir = await mkdtemp(join(tmpdir(), "forge-signed-out-")); | |
| 23 | app = createApp({ dataDir: dir, port: 0 }); | |
| 24 | servers = await serve(app); | |
| 25 | }, 60_000); | |
| 26 | afterAll(async () => { | |
| 27 | servers.stop(); | |
| 28 | app.close(); | |
| 29 | await rm(dir, { recursive: true, force: true }); | |
| 30 | }); | |
| 31 | ||
| 32 | const found = findChromium(); | |
| 33 | const chromium = found !== undefined && chromiumRuns(found) ? found : undefined; | |
| 34 | if (chromium === undefined) console.log("SKIPPING: no chromium that starts on this machine, so the shift is not watched"); | |
| 35 | ||
| 36 | describe.skipIf(chromium === undefined)("the signed-out home, watched in Chromium", () => { | |
| 37 | test("no element moves between first paint and the settled page: layout shift 0", async () => { | |
| 38 | const seen = await observeNavigations( | |
| 39 | chromium!, | |
| 40 | [{ url: `${servers.url}/` }, { url: `${servers.url}${PREVIEW_SIGNED_OUT_PAGE}` }], | |
| 41 | { name: "forge_session", value: "not-a-session" }, | |
| 42 | ); | |
| 43 | for (const s of seen) expect([s.url, s.shift]).toEqual([s.url, 0]); | |
| 44 | }, 60_000); | |
| 45 | }); |
new above
offline
This only re-asserts constants from the look table; it would not fail if the look stopped rendering. Fold it into the shift test or drop it.