test(frontend): SwapPage stale-submit regression for #356 #861

Merged
PlasticDigits merged 1 commit from local1/356-impl-submit-gating into main 2026-06-10 11:19:01 +00:00
PlasticDigits commented 2026-06-10 11:09:38 +00:00 (Migrated from gitlab.com)

Summary

Core submit–quote alignment for #356 is on main (5a25419, merge 49fdaf9). This MR adds the remaining acceptance-criteria regression: a SwapPage component test proving the Swap button stays Calculating… / disabled while typed pay amount ≠ debounced sim key, then re-enables after debounce settles.

Also crosslinks the test in skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md.

Test plan

  • cd frontend-dapp && npx vitest run src/utils/quoteDebounce.test.ts src/hooks/useSubmitAlignedSimQuote.test.ts src/pages/SwapPage.test.tsx -t "356"
  • Manual: Swap → type amount, append digit before quote settles → button disabled until refresh

Note

Low Risk
Test and documentation only; no production swap or submit logic changes.

Overview
Adds a SwapPage component regression for GitLab #356: after a debounced quote settles, typing another digit must keep Swap on Calculating… and disabled until the debounced sim key catches up, then re-enable.

The test uses fake timers and SIM_QUOTE_DEBOUNCE_MS with a connected wallet and mocked pair sim. skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md now lists this case under unit tests for the stale-submit gate.

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

## Summary Core submit–quote alignment for #356 is on `main` (`5a25419`, merge `49fdaf9`). This MR adds the remaining acceptance-criteria regression: a **SwapPage component test** proving the Swap button stays **Calculating…** / disabled while typed pay amount ≠ debounced sim key, then re-enables after debounce settles. Also crosslinks the test in `skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md`. ## Test plan - [ ] `cd frontend-dapp && npx vitest run src/utils/quoteDebounce.test.ts src/hooks/useSubmitAlignedSimQuote.test.ts src/pages/SwapPage.test.tsx -t "356"` - [ ] Manual: Swap → type amount, append digit before quote settles → button disabled until refresh <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Test and documentation only; no production swap or submit logic changes. > > **Overview** > Adds a **SwapPage** component regression for GitLab **#356**: after a debounced quote settles, typing another digit must keep **Swap** on **Calculating…** and disabled until the debounced sim key catches up, then re-enable. > > The test uses fake timers and `SIM_QUOTE_DEBOUNCE_MS` with a connected wallet and mocked pair sim. **`skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md`** now lists this case under unit tests for the stale-submit gate. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5781ad10438b381c97f56a8d698314506b5e4075. 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-10 11:09:46 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-10 11:09:52 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-06-10 11:09:57 +00:00 (Migrated from gitlab.com)

mentioned in issue #356

mentioned in issue #356
PlasticDigits (Migrated from gitlab.com) merged commit 43d749cf98 into main 2026-06-10 11:19:01 +00:00
PlasticDigits commented 2026-06-10 11:19:03 +00:00 (Migrated from gitlab.com)

mentioned in commit 43d749cf98

mentioned in commit 43d749cf98fe840872f48440ad122e23556cc706
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!861
No description provided.