fix(test): SwapPage fee-discount banner testid drift (#374 verify) #899

Merged
PlasticDigits merged 1 commit from verify/issue-374-banner-testid-fix into main 2026-06-13 04:23:13 +00:00
PlasticDigits commented 2026-06-13 04:20:59 +00:00 (Migrated from gitlab.com)

Summary

Verification of GitLab #374 found SwapPage.feeDiscountRegistryBanner.test.tsx (MR !896) still queried data-testid="fee-discount-registry-warning" while SwapPage.tsx renders swap-fee-discount-registry-warning after the implementation merge — 2/4 banner tests failed on main. This MR aligns the isolated banner test file with the live test id (already used in SwapPage.test.tsx).

Verification checklist (#374)

Acceptance item Result How verified
Registered + registrationQuery.isError → banner; swap enabled PASS SwapPage.test.tsx + SwapPage.feeDiscountRegistryBanner.test.tsx (after fix); util matrix in feeDiscountRegistryWarning.test.ts
Indexer fee_discount_registry_ok: false → banner without per-trader errors PASS Unit/page tests; browser Playwright on LocalTerra (role=status, alert-warning, copy matches FEE_DISCOUNT_REGISTRY_WARNING_TEXT)
Unregistered + healthy LCD → no outage banner; Hold CL8Y CTA PASS SwapPage.test.tsx "Hold CL8Y CTA for unregistered wallet…"
Swap submit non-blocking when warning shown PASS SwapPage.test.tsx + banner test "Swap stays enabled"
Util matrix + page banner visibility tests PASS feeDiscountRegistryWarning.test.ts 10/10; banner suites 7/7 after testid fix
Manual LocalTerra: registered + registry outage PASS make setup-cloud-localterra --fresh --skip-build; dev wallet tier 1; Playwright browser on :5173
Attack: no raw LCD errors in warning copy PASS feeDiscountRegistryWarning.test.ts stable copy assertion

Commands run:

bash scripts/with-node.sh --cwd frontend-dapp -- npm test -- --run \
  src/utils/__tests__/feeDiscountRegistryWarning.test.ts \
  src/pages/SwapPage.feeDiscountRegistryBanner.test.tsx \
  src/pages/SwapPage.test.tsx -t "fee-discount registry"
make verify-issue-365

Follow-ups

  • Consider deduplicating SwapPage.feeDiscountRegistryBanner.test.tsx into SwapPage.test.tsx now that both cover the same matrix with the same test id.

Note

Low Risk
Test-only selector updates with no runtime or swap logic changes.

Overview
Updates SwapPage.feeDiscountRegistryBanner.test.tsx so all four banner assertions use data-testid="swap-fee-discount-registry-warning" instead of the stale fee-discount-registry-warning, matching what SwapPage renders and what SwapPage.test.tsx already expects.

No production or banner behavior changes—only test selectors so the isolated #374 banner suite passes again after the implementation test id rename.

Reviewed by Cursor Bugbot for commit 17453e7a49. Bugbot is set up for automated code reviews on this repo. Configure here.

## Summary Verification of GitLab #374 found `SwapPage.feeDiscountRegistryBanner.test.tsx` (MR !896) still queried `data-testid="fee-discount-registry-warning"` while `SwapPage.tsx` renders `swap-fee-discount-registry-warning` after the implementation merge — 2/4 banner tests failed on `main`. This MR aligns the isolated banner test file with the live test id (already used in `SwapPage.test.tsx`). ## Verification checklist (#374) | Acceptance item | Result | How verified | |-----------------|--------|--------------| | Registered + `registrationQuery.isError` → banner; swap enabled | **PASS** | `SwapPage.test.tsx` + `SwapPage.feeDiscountRegistryBanner.test.tsx` (after fix); util matrix in `feeDiscountRegistryWarning.test.ts` | | Indexer `fee_discount_registry_ok: false` → banner without per-trader errors | **PASS** | Unit/page tests; browser Playwright on LocalTerra (`role=status`, `alert-warning`, copy matches `FEE_DISCOUNT_REGISTRY_WARNING_TEXT`) | | Unregistered + healthy LCD → no outage banner; Hold CL8Y CTA | **PASS** | `SwapPage.test.tsx` "Hold CL8Y CTA for unregistered wallet…" | | Swap submit non-blocking when warning shown | **PASS** | `SwapPage.test.tsx` + banner test "Swap stays enabled" | | Util matrix + page banner visibility tests | **PASS** | `feeDiscountRegistryWarning.test.ts` 10/10; banner suites 7/7 after testid fix | | Manual LocalTerra: registered + registry outage | **PASS** | `make setup-cloud-localterra --fresh --skip-build`; dev wallet tier 1; Playwright browser on `:5173` | | Attack: no raw LCD errors in warning copy | **PASS** | `feeDiscountRegistryWarning.test.ts` stable copy assertion | Commands run: ```bash bash scripts/with-node.sh --cwd frontend-dapp -- npm test -- --run \ src/utils/__tests__/feeDiscountRegistryWarning.test.ts \ src/pages/SwapPage.feeDiscountRegistryBanner.test.tsx \ src/pages/SwapPage.test.tsx -t "fee-discount registry" make verify-issue-365 ``` ## Follow-ups - Consider deduplicating `SwapPage.feeDiscountRegistryBanner.test.tsx` into `SwapPage.test.tsx` now that both cover the same matrix with the same test id. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Test-only selector updates with no runtime or swap logic changes. > > **Overview** > Updates **`SwapPage.feeDiscountRegistryBanner.test.tsx`** so all four banner assertions use `data-testid="swap-fee-discount-registry-warning"` instead of the stale `fee-discount-registry-warning`, matching what **`SwapPage`** renders and what **`SwapPage.test.tsx`** already expects. > > No production or banner behavior changes—only test selectors so the isolated #374 banner suite passes again after the implementation test id rename. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 17453e7a49135a24b5a5b1527b98d99eddbd3961. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
ghost1 commented 2026-06-13 04:21:06 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-13 04:21:10 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-06-13 04:22:25 +00:00 (Migrated from gitlab.com)

Security review — MR !899

Commit reviewed: 17453e7a49135a24b5a5b1527b98d99eddbd3961

Scope: frontend-dapp/src/pages/SwapPage.feeDiscountRegistryBanner.test.tsx — four data-testid selector updates (fee-discount-registry-warning → swap-fee-discount-registry-warning) to match the existing production attribute in SwapPage.tsx (line 1005). No runtime, swap, indexer, or banner-copy logic changes in this diff.

Method: Full MR diff review; traced all four changed lines to test-only findByTestId / queryByTestId calls; confirmed production banner still renders static FEE_DISCOUNT_REGISTRY_WARNING_TEXT with no attacker-controlled interpolation. Checked prior MR notes — no prior security-review threads to re-validate.

Outcome: FINDINGS: 0 medium+

Security review: no medium+ findings on this diff.

Category Result
Injection (XSS, SSRF, path traversal) N/A — no production code or user-input handling changed
Authn / authz N/A
Secret leakage / unsafe logging N/A
Permission boundaries / on-chain roles N/A
Dependency / supply-chain N/A — no manifest or lockfile changes

Inline threads: none (no findings to anchor).

Safe to merge from an application-security perspective for the changed surface.

## Security review — MR !899 **Commit reviewed:** `17453e7a49135a24b5a5b1527b98d99eddbd3961` **Scope:** `frontend-dapp/src/pages/SwapPage.feeDiscountRegistryBanner.test.tsx` — four `data-testid` selector updates (`fee-discount-registry-warning` → `swap-fee-discount-registry-warning`) to match the existing production attribute in `SwapPage.tsx` (line 1005). No runtime, swap, indexer, or banner-copy logic changes in this diff. **Method:** Full MR diff review; traced all four changed lines to test-only `findByTestId` / `queryByTestId` calls; confirmed production banner still renders static `FEE_DISCOUNT_REGISTRY_WARNING_TEXT` with no attacker-controlled interpolation. Checked prior MR notes — no prior security-review threads to re-validate. **Outcome:** `FINDINGS: 0` medium+ Security review: **no medium+ findings** on this diff. | Category | Result | |----------|--------| | Injection (XSS, SSRF, path traversal) | N/A — no production code or user-input handling changed | | Authn / authz | N/A | | Secret leakage / unsafe logging | N/A | | Permission boundaries / on-chain roles | N/A | | Dependency / supply-chain | N/A — no manifest or lockfile changes | **Inline threads:** none (no findings to anchor). Safe to merge from an application-security perspective for the changed surface.
PlasticDigits commented 2026-06-13 04:23:14 +00:00 (Migrated from gitlab.com)

mentioned in commit 3ece932132

mentioned in commit 3ece932132aa865b88987d8cc4078b76897ec40a
PlasticDigits (Migrated from gitlab.com) merged commit 3ece932132 into main 2026-06-13 04:23:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!899
No description provided.