test: add round-trip invariant and update/delete mutation-failure coverage - #3448
Open
lxbme wants to merge 1 commit into
Open
test: add round-trip invariant and update/delete mutation-failure coverage#3448lxbme wants to merge 1 commit into
lxbme wants to merge 1 commit into
Conversation
lxbme
marked this pull request as ready for review
July 27, 2026 02:42
45 tasks
guoqqqi
approved these changes
Jul 27, 2026
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.
Please answer these questions before submitting a pull request, or your PR will get closed.
Why submit this pull request?
What changes will this PR take into?
This closes two more "Test-suite gaps" items of the frontend review in #3417.
1. General round-trip invariant (
e2e/tests/regression/form.round-trip-invariant.spec.ts)There was no general "create → read → no-op edit-save → deep-diff" test — the class of bug that #3414 (SSL mTLS client block wiped on edit-save) belonged to. Existing specs pin specific known losses one field at a time; this is the parametrised guard that catches future ones.
For each resource it seeds a rich record via the Admin API, opens the detail page, clicks Edit then Save without changing anything, reads the record back, and asserts it is unchanged. Both sides are Admin-API-stored values (already gateway-canonicalised), so the comparison only drops the server-managed timestamps and folds any array-form upstream
nodesback to the object-map form — a benign representation reshuffle is not a false failure, but a dropped or emptied field is.Covered: route, service, upstream, consumer, consumer_group. SSL and Secret are deliberately excluded — their private key / manager tokens are write-only (never returned by the API), so a pure no-op save cannot reproduce them; the SSL client-block case is already covered by
ssls.noop-edit-preserves-client.spec.ts, which re-enters the key.Note on the consumer case: it seeds username/desc/labels only. A consumer with a
key-authplugin does not round-trip cleanly — a no-op edit-save comes back with a differentkey(the form appears to drop the write-only key and the gateway regenerates one). This is flagged for separate investigation: if an unrelated edit to a consumer rotates its auth key, existing clients using the old key would break. The harness surfaced it; it is out of scope for this test PR.2. Mutation-failure feedback for update and delete (
e2e/tests/regression/form.mutation-failure-error.spec.ts)The HTTP-error-with-body toast (via the Axios interceptor) was pinned only for route create. Network-level failures already had update/delete/timeout coverage in
network-error.mutation-toast.spec.ts, but the distinct HTTP-500-with-error_msgpath was create-only. Two tests are added: an edit-save that gets a 500, and a delete that gets a 500, both asserting the error toast appears.Related issues
Part of #3417
Checklist:
The round-trip harness's sensitivity was demonstrated during development: the consumer + key-auth case went red on the changed key before it was narrowed to the non-sensitive fields. Verified with
tsc, ESLint, the unit suite, and the full e2e suite.Remaining test-suite-gap items, each larger and out of this PR: cross-browser / pinned-image CI, and the
waitForTimeoutremoval + parallel-safety refactor.