Conversation
- Add trading pair utility with base/quote asset determination logic - Change market orders tabs from Open/Matched to Buy/Sell/Matched - Fix Max button not updating when quote asset changes (reactivity bug) - Clear price/amount when changing quote asset to avoid mistakes - Persist pair flip state when navigating Form→Review→Form - Improve order settings UI: smaller headings, clickable labels, help text - Add cursor-pointer to settings cog button
- Click sell order → opens buy form with matching price/amount - Click buy order → opens sell form with matching price/amount - Add URL params support (type, quote, price, amount) to order form - Fix price calculation for buy vs sell orders (quote per base) - Add helper functions for order stats that handle both directions - Fix bug in trading-pair.ts keyword tiebreaker logic - Add unit tests for trading-pair utilities (15 tests)
- Update market order selectors for Buy/Sell/Matched tabs - Add tests for clicking orders to navigate to compose form - Add skipped tests for URL param reading (HashRouter investigation needed)
- Add useEffect to sync URL params on direct navigation (fixes page.goto) - Guard against division by zero when price is "0" in Max button calculation - Enable previously skipped URL param E2E tests (now passing) - Add form state verification to click-to-navigate tests
- Move getOrderPricePerUnit, getOrderBaseAmount, getOrderQuoteAmount, getMatchPricePerUnit to shared utility - Add unit tests for all order calculation helpers (10 new tests) - Reduces code duplication and enables better test coverage
The openTab selector was incorrectly aliased to "Sell" for backward compatibility with orders page. This broke dispenser tests which still use Open/Dispensed tabs. Fixed by: - openTab now correctly matches "Open" button (for dispensers) - dispensedTab uses consistent button locator pattern - Removed misleading "legacy alias" comment
After wallet import, React state updates may still be pending when navigation to /index occurs. The previous test checked for addressText immediately, but the address container only renders after wallet context finishes initializing (not during "Loading wallet data..." state). Changed to wait for the address container element ([aria-label="Current address"]) with a longer timeout, which is a reliable indicator that wallet data has fully propagated through React state.
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.
Summary
Changes
src/utils/trading-pair.ts- New utility for base/quote asset determinationsrc/utils/__tests__/trading-pair.test.ts- Unit tests for trading pair utilitysrc/pages/market/orders/[baseAsset]/[quoteAsset].tsx- Buy/Sell/Matched tabs, click-to-fillsrc/pages/compose/order/form.tsx- URL params, reactivity fix, UX improvementssrc/pages/compose/order/index.tsx- Pass URL params to formsrc/pages/settings/order-settings.tsx- UI polishTest plan
npx vitest run src/utils/__tests__/trading-pair.test.ts- all 15 tests should pass