fix(test): #163 add data-payment-item hook so payment-isolation E2E scopes on rendered rows#164
Merged
Merged
Conversation
…copes on rendered rows The payment-isolation "shows only own payments" E2E asserts `hasNoPayments || hasPayments`, counting `[data-payment-item]` for the list branch. PaymentHistory never emitted that attribute, so the test only passed via the empty-state — it went red the moment the shared fixture user acquired a seeded payment row (verified via the failure trace: query returned 200 with one row, component rendered the table, neither test branch matched). Not flake, not a regression from #156 — a latent test-selector gap. Confirmed pre-existing by re-running E2E on the pre-#156 commit (also red). Adds data-payment-item to the desktop table rows and mobile cards so the list branch matches actual rendered payments. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
TortoiseWolfe
added a commit
that referenced
this pull request
Jul 3, 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.
Closes #163. Un-reds
main.Root cause (from the failure trace, not a guess)
The
payment-isolation"shows only own payments" E2E (tests/e2e/security/payment-isolation.spec.ts:157) assertshasNoPayments || hasPayments, where the list branch counts[data-payment-item]. PaymentHistory never emitted that attribute — it renders payments as plain<tr>table rows and mobile cards. So the assertion could only pass through the "No payment history" empty state.The test went red the moment the shared fixture user acquired a seeded
payment_resultsrow (there's currently 1). At that point the component correctly renders the payment table, but neitherhasNoPayments(empty state gone) norhasPayments([data-payment-item]count still 0) is true →expect(false || false).toBe(true)fails.Verified via the captured Playwright trace: the
payment_resultsquery returned 200 with one correctly-scoped row for the primary user, the component rendered the desktop table (not the error or loading state), and there was no auth leak. So this is a stale-selector test gap, not a data, auth, or component fault.Not a regression from #156
Because the failure correlated in time with #156 (auth-redirect basePath fix), I first suspected that PR. Ruled it out with a controlled experiment: re-ran the E2E suite on the pre-#156 commit (b31a8d0) today — it fails the identical assertion on all three browsers. The test was always latently broken; it only passed while the fixture user happened to have zero payments. #156 is exonerated.
The fix
Add
data-payment-itemto the rendered payment rows (desktop table<tr>and mobile card<div>), so the list branch matches actual rendered payments regardless of the fixture user's payment count.🤖 Generated with Claude Code