Skip to content

fix(e2e): stop ensureApp creating duplicate apps; modernise schema-access-scopes - #47

Merged
rubenvdlinde merged 1 commit into
developmentfrom
wip/e2e-fixture-idempotency
Jul 28, 2026
Merged

fix(e2e): stop ensureApp creating duplicate apps; modernise schema-access-scopes#47
rubenvdlinde merged 1 commit into
developmentfrom
wip/e2e-fixture-idempotency

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Fixture bug with real side effects. ensureApp() probed /applications/{slug}/manifest to decide whether the fixture app existed. That 404s for an app that exists but has no resolvable manifest, so the check said "absent" for an app that was right there and every run POSTed the wizard again. Result: four duplicate pw-access-scopes Application objects after three runs (with only one register), polluting the shared instance — and re-creating an app whose register already exists makes the wizard hang ~180s then 500, blowing the test timeout instead of reporting anything useful. Now matched off the applications list. Duplicates cleaned out.

schema-access-scopes brought up to date with what the designer actually does (still quarantined pending a green run):

  • ensureApp() instead of the removed flat "Add application" form (its if(isVisible) guard silently skipped creation);
  • ?_version=production register scoping;
  • namespaced schema slugs for API lookups and row matches;
  • Add-schema locators scoped to the dialog;
  • putSchema() writes by numeric id — OpenRegister is read-by-slug/write-by-id, so the old slug PUT seeded nothing and the scenarios asserted against an unchanged schema.

component-blocks and form-editor-logic keep their quarantine with accurate in-file reasons: the former navigates to random non-existent app slugs and needs real fixtures; the latter drives a /applications/{slug}/design route and an .application-editor__textarea that do not exist (its own header notes it was authored without ever being run), so it needs its seeding rewritten.

🤖 Generated with Claude Code

…cess-scopes

ensureApp() probed `/applications/{slug}/manifest` to decide whether the fixture
app existed. That 404s for an app that exists but has no resolvable manifest, so
the check reported "absent" for an app that was right there and every run POSTed
the wizard again. Found FOUR duplicate `pw-access-scopes` Application objects
after three runs (only one register), and re-creating an app whose register
already exists takes the wizard ~180s before failing 500 — which blows the test
timeout instead of reporting anything. Use the applications LIST and match on
slug instead. Duplicates cleaned out of the shared instance.

schema-access-scopes is brought up to date with what the designer actually does
now, though it stays quarantined pending a green run:
  - ensureApp() instead of the removed flat "Add application" form (whose
    if(isVisible) guard silently skipped creation);
  - `?_version=production` so it targets the app's per-version register;
  - namespaced schema slugs for every API lookup and row match;
  - Add-schema locators scoped to the dialog (the page is schema-bound, so an
    unscoped getByLabel(/slug/i) is ambiguous);
  - putSchema() writes by numeric id — OpenRegister is read-by-slug/write-by-id,
    so the old slug PUT seeded nothing and the scenarios asserted against an
    unchanged schema.

component-blocks and form-editor-logic keep their quarantine, now with accurate
reasons recorded in-file: the former navigates to random non-existent app slugs
and needs real fixtures; the latter drives a `/applications/{slug}/design` route
and a Raw-JSON textarea that do not exist (its header notes it was authored
without ever being run), so it needs its seeding rewritten, not a locator tweak.
@rubenvdlinde
rubenvdlinde merged commit 8b0a777 into development Jul 28, 2026
@rubenvdlinde
rubenvdlinde deleted the wip/e2e-fixture-idempotency branch July 28, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants