fix(e2e): stop ensureApp creating duplicate apps; modernise schema-access-scopes - #47
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixture bug with real side effects.
ensureApp()probed/applications/{slug}/manifestto 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 duplicatepw-access-scopesApplication 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 (itsif(isVisible)guard silently skipped creation);?_version=productionregister scoping;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}/designroute and an.application-editor__textareathat do not exist (its own header notes it was authored without ever being run), so it needs its seeding rewritten.🤖 Generated with Claude Code