Public: anyone can read this; the crew can change it.
Full suite red: test/looks-owner.test.ts #12773
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/12745-full-suite-red-test-looks-owner-test-ts → main 1 commit fork
1 file
changed +10
−19
test/looks-owner.test.ts +10 −19
| @@ -299,6 +299,16 @@ describe("the forge's own owner looks, over the preview seed", () => { | ||
| 299 | 299 | await rm(dataDir, { recursive: true, force: true }); |
| 300 | 300 | }); |
| 301 | 301 | |
| 302 | test("the seeded repository has the forks the Iterations page draws, each with a build of its own (#9182)", async () => { | |
| 303 | const admin = getUserByName(app.db, PREVIEW_ADMIN)!; | |
| 304 | const repo = getRepo(app.db, PREVIEW_ADMIN, PREVIEW_REPO)!; | |
| 305 | const drawn = await iterationsOf({ app, auth: { user: admin } }, repo); | |
| 306 | expect(drawn?.forks.length).toBeGreaterThanOrEqual(4); | |
| 307 | expect(drawn!.forks.filter((f) => f.forkOf !== null).length).toBe(PREVIEW_FORKS.length); | |
| 308 | expect(drawn!.forks.some((f) => f.forkOf === `preview-ada/${PREVIEW_REPO}`)).toBe(true); | |
| 309 | expect(drawn!.forks.filter((f) => f.forkOf !== null).every((f) => f.builds.length > 0)).toBe(true); | |
| 310 | }); | |
| 311 | ||
| 302 | 312 | const asOwner = async (path: string) => { |
| 303 | 313 | const said = `u1|trevato|admin|${String(Date.now() + 60_000)}`; |
| 304 | 314 | const res = await fetch(`${s.url}${path}`, { |
| @@ -548,23 +558,4 @@ describe("the Iterations page of the seeded fork family (#9182)", () => { | ||
| 548 | 558 | expect(PREVIEW_ITERATIONS_PAGE).toBe("/preview-admin/sample/iterations"); |
| 549 | 559 | expect(looks.map((l) => l.kind).sort()).toEqual(["desktop", "phone"]); |
| 550 | 560 | }); |
| 551 | ||
| 552 | test("the seeded repository has the forks the page draws, each with a build of its own", async () => { | |
| 553 | const dir = await mkdtemp(join(tmpdir(), "forge-iterations-seed-")); | |
| 554 | const app = createApp({ dataDir: dir, port: 0 }); | |
| 555 | try { | |
| 556 | const seeded = await seedPreview(app, { FORGE_APP_ENV: "preview" }); | |
| 557 | if (!seeded.ok) throw new Error(seeded.error); | |
| 558 | const admin = getUserByName(app.db, PREVIEW_ADMIN)!; | |
| 559 | const repo = getRepo(app.db, PREVIEW_ADMIN, PREVIEW_REPO)!; | |
| 560 | const drawn = await iterationsOf({ app, auth: { user: admin } }, repo); | |
| 561 | expect(drawn?.forks.length).toBeGreaterThanOrEqual(4); | |
| 562 | expect(drawn!.forks.filter((f) => f.forkOf !== null).length).toBe(PREVIEW_FORKS.length); | |
| 563 | expect(drawn!.forks.some((f) => f.forkOf === `preview-ada/${PREVIEW_REPO}`)).toBe(true); | |
| 564 | expect(drawn!.forks.filter((f) => f.forkOf !== null).every((f) => f.builds.length > 0)).toBe(true); | |
| 565 | } finally { | |
| 566 | app.close(); | |
| 567 | await rm(dir, { recursive: true, force: true }); | |
| 568 | } | |
| 569 | }, 30_000); | |
| 570 | 561 | }); |
new above
offline