fix(access-editor): a newly typed group scope saved as null; un-quarantine the suite - #51
Merged
Merged
Conversation
…ntine the suite
A taggable NcSelect emits BOTH `@tag` (the raw typed string) and `@input` (the
new selection). In that `@input` payload the freshly created entry is the raw
STRING, not a `{ value, label }` option — so onGroupsChange's blind `o.value`
mapped it to undefined, which persisted as null, clobbering the correct value
`@tag` had just stored. Scoping an operation to any group that is not already in
the list — the normal case, since the options come from the current user's own
groups — therefore wrote `"read": [null]` instead of `["vets"]`. Accept both
shapes and drop empties. Live-verified: staged `groups: ["vets"]`, PUT 200 with
`authorization {"read":["vets"],"update":["@Creator"]}`, persisted in the DB.
schema-access-scopes is UN-QUARANTINED: 6/6, green on two consecutive runs
including one started from the previous run's dirty state.
Test-side, three things were wrong beyond #41's blockers:
- per-operation rows were matched with `hasText: /^read$/`, but a row's text is
its heading PLUS its controls, so nothing ever matched — match the <h4>;
- the taggable select renders its "create" option asynchronously, so pressing
Enter straight after fill() committed nothing and the group was dropped;
- `waitForLoadState('networkidle')` does not wait for the save XHR, so the API
assertions raced it and read the schema's previous contents — a WORKING save
looked like a failure. Post-save reads now poll (saveAndAwait).
Plus a baseline reset per run, because scenario 4 seeds `update: ['@Creator']`
and the leftovers made scenario 2 red on every rerun.
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.
Product bug. A taggable
NcSelectemits both@tag(raw typed string) and@input(new selection). In that@inputpayload the freshly created entry is the raw string, not a{value,label}option — soonGroupsChange's blindo.valuemapped it toundefined, persisted asnull, clobbering the correct value@taghad just stored. Scoping an operation to any group not already in the list — the normal case, since the options come from the current user's own groups — wrote"read": [null]instead of["vets"].Live-verified after the fix: staged
groups: ["vets"]→PUT 200withauthorization {"read":["vets"],"update":["@creator"]}→ persisted in the DB.schema-access-scopesun-quarantined — 6/6, green on two consecutive runs, the first starting from the previous run's dirty state.Three test-side defects beyond #41's blockers:
hasText: /^read$/, but a row's text is its heading plus its controls, so nothing matched — match the<h4>;fill()committed nothing and the group was silently dropped;waitForLoadState('networkidle')does not wait for the save XHR, so API assertions raced it and read the previous contents — a working save looked like a failure. Post-save reads now poll.Plus a per-run baseline reset: scenario 4 seeds
update: ['@creator'], and the leftovers turned scenario 2 red on every rerun.🤖 Generated with Claude Code