From beef517c2323e8f4f9ea47509ae178b05be033af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Tue, 1 Dec 2026 14:07:07 +0100 Subject: [PATCH] Tests: the lightbox viewer's first open waits for its chunk; reference index lists the performance spec and the lab helper Co-Authored-By: Claude Opus 5.5 --- docs/agent/reference-site/INDEX.md | 4 +++- scripts/reference-index.mjs | 2 ++ test/lightbox.test.ts | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/agent/reference-site/INDEX.md b/docs/agent/reference-site/INDEX.md index 35fbfdd..b159347 100644 --- a/docs/agent/reference-site/INDEX.md +++ b/docs/agent/reference-site/INDEX.md @@ -374,7 +374,7 @@ export const Pages: CollectionConfig = { { name: 'layout', type: 'blocks', blocks: pageBlocks, minRows: 1 }, buildSummaryField(), // aiSummary — GEO (llms.txt, MCP) buildNoindexField(), - { name: 'slugHistory', type: 'array', admin: { components: rowLabel('slug', 'Old address'), readOnly: true }, fields: [{ name: 'slug', type: 'text' }], labels: { plural: 'Old addresses', singular: 'Old address' } }, + { name: 'slugHistory', type: 'array', admin: { components: rowLabel('slug', 'Old address'), readOnly: true }, fields: [{ name: 'slug', type: 'text', index: true }], labels: { plural: 'Old addresses', singular: 'Old address' } }, ], hooks: { afterChange: [revalidate.afterChange], @@ -1136,6 +1136,8 @@ Rules: AGENT.md §8a. | `e2e/mail-relay-fixture.ts` | test fixture, on only with E2E_MAIL_RELAY_URL: points the mail service's client at the stand-in the spec starts; never in a real site (a real site names no address) (below) | | `e2e/mail-relay-setup.ts` | for the mail-service spec: empties the SMTP fields and the stored token, so the next e-mail enrols and goes through the mail service (local database only) (below) | | `e2e/mail-relay.spec.ts` | the mail service on a built site: the state block in the panel, the first e-mail through the public confirm route, no token in anything the browser receives | +| `e2e/perf-lab.mjs` | the lab measurement of one page (Lighthouse's phone and desktop profiles, Web Vitals observers, bytes per type) — used by the performance spec and `pnpm perf:measure`; the iapl-performance skill ships the same file | +| `e2e/performance.spec.ts` | the performance budgets (run by `pnpm e2e:built` in both bundlers): every page type on a throttled phone and a desktop — LCP, CLS, TBT, the response to a tap, JS / CSS / font bytes, requests, render-blocking, third parties before consent — and the MongoDB queries of one render (docs/performance.md) | | `e2e/routes.snapshot.json` | every public route of the site (REST, GraphQL, Next route files) with one line saying who may use it and why — the judged list `routes:check` compares with | | `e2e/routes.ts` | `routes:check`: the site's public routes against e2e/routes.snapshot.json (`pnpm payload run e2e/routes.ts [update]`; from the repository `pnpm routes:check`) (below) | | `e2e/sign-in-answers.spec.ts` | built-site test (pnpm e2e:built, 1.17.2): a locked staff account gets the wrong-password answer over REST and GraphQL (accounts.lockedAnswer); the plugin's panel actions refuse another origin and take the site's own (adminSameOrigin) | diff --git a/scripts/reference-index.mjs b/scripts/reference-index.mjs index 6866ced..ce001f0 100644 --- a/scripts/reference-index.mjs +++ b/scripts/reference-index.mjs @@ -66,6 +66,8 @@ export const DESCRIPTIONS = { 'e2e/late-staff.spec.ts': 'the account rules on a BUILT site (run by `pnpm e2e:built` after a webpack and a Turbopack build): a staff collection a later plugin adds, staff collections whose accounts can hold `admin`, and copies of staff collections — a visitor account gets nothing, nobody raises its own role or makes an admin, a copy is never wider than the plugin\'s rule', 'e2e/global-setup.ts': 'Playwright global setup: resets the test admins and clears their stored 2FA attempt counts before every run, so specs do not depend on run order', 'e2e/two-factor-setup.spec.ts': 'browser check of "2FA setup required": the first admin of a fresh site, a new editor, the administrator\'s reset on the account page', + 'e2e/performance.spec.ts': 'the performance budgets (run by `pnpm e2e:built` in both bundlers): every page type on a throttled phone and a desktop — LCP, CLS, TBT, the response to a tap, JS / CSS / font bytes, requests, render-blocking, third parties before consent — and the MongoDB queries of one render (docs/performance.md)', + 'e2e/perf-lab.mjs': 'the lab measurement of one page (Lighthouse\'s phone and desktop profiles, Web Vitals observers, bytes per type) — used by the performance spec and `pnpm perf:measure`; the iapl-performance skill ships the same file', 'e2e/smoke.spec.ts': 'the smoke tests every release must pass: pages, showcase, forms (also a file sent by e-mail), sitemap, SEO/GEO, headers, consent, 2FA', 'e2e/mail-relay-fixture.ts': 'test fixture, on only with E2E_MAIL_RELAY_URL: points the mail service\'s client at the stand-in the spec starts; never in a real site (a real site names no address)', 'e2e/mail-relay-setup.ts': 'for the mail-service spec: empties the SMTP fields and the stored token, so the next e-mail enrols and goes through the mail service (local database only)', diff --git a/test/lightbox.test.ts b/test/lightbox.test.ts index da27cae..2524981 100644 --- a/test/lightbox.test.ts +++ b/test/lightbox.test.ts @@ -107,6 +107,19 @@ describe('lightbox helpers', () => { }) describe('lightbox behaviour', () => { + test('the viewer is loaded on the first open (a separate chunk since 1.18.0), then opens at once', async () => { + render(gallery()) + click(triggers()[0]) + expect(dialog()).toBeNull() // the first open waits for the viewer's code + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 0)) + }) + expect(dialog()).not.toBeNull() + click(dialog()!.querySelector('[data-ipal="lightbox-close"]')) + click(triggers()[1]) + expect(dialog()).not.toBeNull() // loaded: every later open is immediate + }) + test('nothing in the DOM until opened; triggers are labelled buttons', () => { render(gallery()) expect(dialog()).toBeNull()