Skip to content

Comments

feat/PRO-3752/add-test-ids-pulse#418

Merged
RanaBug merged 2 commits intostagingfrom
feat/PRO-3752/add-test-ids-pulse
Oct 1, 2025
Merged

feat/PRO-3752/add-test-ids-pulse#418
RanaBug merged 2 commits intostagingfrom
feat/PRO-3752/add-test-ids-pulse

Conversation

@RanaBug
Copy link
Collaborator

@RanaBug RanaBug commented Oct 1, 2025

Description

  • Add data test id to Pulse for automated tests

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Summary by CodeRabbit

  • New Features
    • No user-facing feature changes.
  • Tests
    • Added extensive data-testid attributes across buy/sell flows, search and token lists, price displays, transaction details/status, toast notifications, and common controls (refresh/close) to improve automated testing and observability.
  • Chores
    • Minor structural and import/order adjustments to support testability hooks with no impact on UI or behavior.

@RanaBug RanaBug requested a review from IAmKio October 1, 2025 16:07
@RanaBug RanaBug self-assigned this Oct 1, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

Walkthrough

Added data-testid attributes across Pulse UI components to improve testability; one public API change: TokenListProps now includes handleTokenSelect and optional searchType. An import in ChainOverlay was reordered. No control-flow, logic, or behavior changes.

Changes

Cohort / File(s) Summary of changes
App & Misc Buttons
src/apps/pulse/components/App/HomeScreen.tsx, src/apps/pulse/components/Misc/Close.tsx, src/apps/pulse/components/Misc/Refresh.tsx, src/apps/pulse/components/Misc/Tooltip.tsx, src/apps/pulse/components/Toast/PulseToast.tsx
Added data-testid attributes to search/refresh wrappers, close/refresh buttons, tooltip container, and toast container/close button. No behavior changes.
Buy Flow
src/apps/pulse/components/Buy/Buy.tsx, src/apps/pulse/components/Buy/BuyButton.tsx, src/apps/pulse/components/Buy/PayingToken.tsx, src/apps/pulse/components/Buy/PreviewBuy.tsx
Added data-testid attributes to token selector, token display, amount input, icons, error/warning areas, balance, confirm/refresh/escape controls. Rendering unchanged.
Sell Flow
src/apps/pulse/components/Sell/Sell.tsx, src/apps/pulse/components/Sell/SellButton.tsx, src/apps/pulse/components/Sell/PreviewSell.tsx
Added data-testid attributes across token selectors, placeholders, warnings, summary visuals, percentage buttons, confirm/controls; minor wrapper additions only.
Search & Lists
src/apps/pulse/components/Search/Search.tsx, src/apps/pulse/components/Search/PortfolioTokenList.tsx, src/apps/pulse/components/Search/TokenList.tsx, src/apps/pulse/components/Search/ChainOverlay.tsx
Widespread data-testid additions for loading/error/empty states, list containers, rows, icons, and sort buttons. Replaced a fragment with a container in PortfolioTokenList. Reordered an import in ChainOverlay. Public API change: TokenListProps now adds handleTokenSelect: (item: Asset) => void and optional searchType?: SearchType.
Price Display
src/apps/pulse/components/Price/TokenPrice.tsx, src/apps/pulse/components/Price/TokenPriceChange.tsx
Added data-testid="pulse-token-price" to price render branches and data-testid="pulse-token-price-change" to price-change container. No logic changes.
Transaction UI
src/apps/pulse/components/Transaction/TransactionDetails.tsx, src/apps/pulse/components/Transaction/TransactionStatus.tsx, src/apps/pulse/components/Transaction/TransactionStatusButton.tsx, src/apps/pulse/components/Transaction/TransactionStatusContainer.tsx, src/apps/pulse/components/Transaction/TransactionErrorBox.tsx
Added data-testid attributes to containers, titles, close/esc buttons, summary, token info, progress steps, error box, status text, and done/confirm controls. Added some non-functional wrapper divs; behavior unchanged.

Sequence Diagram(s)

(no diagram)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • IAmKio
  • mightyboothkl

Poem

A rabbit hops through code and light,
Leaves tiny tags so tests take flight.
Buttons, tokens, tooltips — all in line,
Findable paths, each little sign.
Hop on, tiny tests — success in sight. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning While the description section summarizes the change and the types of changes are correctly marked, the “How Has This Been Tested?” section is left empty, providing no information about the testing environment, commands run, or verification steps, and the screenshots section is also blank. This omission leaves reviewers without the context needed to confirm that the new test IDs function as intended. Please populate the testing section with specific details on how you verified the test IDs (for example, test frameworks or commands used, environment setup, and example assertions), and either remove or explain the absence of screenshots if visual confirmation is not applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title “feat/PRO-3752/add-test-ids-pulse” concisely identifies the primary change—adding test IDs to the Pulse components—and directly corresponds to the main intent of the changeset without introducing unrelated information. It clearly reflects the core update and is specific enough for a reviewer scanning the history to understand what was modified.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/PRO-3752/add-test-ids-pulse

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4534329 and dd3261b.

⛔ Files ignored due to path filters (1)
  • src/apps/pulse/components/Transaction/tests/__snapshots__/TransactionErrorBox.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • src/apps/pulse/components/Transaction/TransactionDetails.tsx (10 hunks)
  • src/apps/pulse/components/Transaction/TransactionErrorBox.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/apps/pulse/components/Transaction/TransactionErrorBox.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/apps/pulse/components/Transaction/TransactionDetails.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: lint
  • GitHub Check: unit-tests
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 1, 2025

Deploying x with  Cloudflare Pages  Cloudflare Pages

Latest commit: dd3261b
Status: ✅  Deploy successful!
Preview URL: https://a6e8847a.x-e62.pages.dev
Branch Preview URL: https://feat-pro-3752-add-test-ids-p.x-e62.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/apps/pulse/components/Transaction/TransactionDetails.tsx (2)

283-307: Add data-testid forwarding in TransactionErrorBox
TransactionErrorBoxProps doesn’t include data-testid and the component doesn’t spread extra props—extend its props (for example by adding a rest parameter) and spread them on the root <div> so the data-testid passed from the parent is rendered.


216-277: Add and forward data-testid in ProgressStep

ProgressStepProps (src/apps/pulse/types/types.ts) currently lacks 'data-testid' and the component signature in src/apps/pulse/components/Transaction/ProgressStep.tsx doesn’t accept or spread extra props, so none of the data-testid attributes passed from TransactionDetails will be rendered. Add 'data-testid'?: string to ProgressStepProps, destructure it (e.g. ‘data-testid’: dataTestId, …rest) in the component, and apply it to the root <div> (e.g. <div data-testid={dataTestId} {...rest} className="flex…">) to ensure tests can locate each step.

🧹 Nitpick comments (3)
src/apps/pulse/components/Transaction/TransactionDetails.tsx (1)

159-203: Consider sanitizing dynamic test IDs.

The dynamic test IDs at lines 161 and 186 incorporate token.name, which may contain spaces, special characters, or be very long. This could create fragile or invalid test selectors.

Consider one of these approaches:

  1. Sanitize the token name (e.g., replace spaces with hyphens, remove special chars)
  2. Use token.symbol or token.address instead, which are typically more stable identifiers

Example:

-        data-testid={`pulse-transaction-details-summary-${isBuy ? 'buy' : 'sell'}-${isBuy ? buyToken?.name : sellToken?.name}`}
+        data-testid={`pulse-transaction-details-summary-${isBuy ? 'buy' : 'sell'}-${isBuy ? buyToken?.symbol : sellToken?.symbol}`}
src/apps/pulse/components/Sell/Sell.tsx (1)

167-255: Consider sanitizing the dynamic test ID.

At line 181, the test ID incorporates token.name which may contain spaces or special characters, potentially creating fragile selectors.

Consider using token.symbol instead:

-                data-testid={`pulse-sell-token-selected-${token.chainId}-${token.name}`}
+                data-testid={`pulse-sell-token-selected-${token.chainId}-${token.symbol}`}

Otherwise, the token selector test IDs are well-structured and comprehensive.

src/apps/pulse/components/Sell/PreviewSell.tsx (1)

463-541: Consider sanitizing the dynamic test ID.

At line 470, the test ID incorporates sellToken.name which may contain spaces or special characters.

Consider using sellToken.symbol for more stable selectors:

-            data-testid={`pulse-preview-sell-selling-token-${sellToken.chainId}-${sellToken.name}`}
+            data-testid={`pulse-preview-sell-selling-token-${sellToken.chainId}-${sellToken.symbol}`}

The remaining test IDs in this section are clean and appropriate.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2acbe4 and 4534329.

⛔ Files ignored due to path filters (14)
  • src/apps/pulse/components/App/tests/__snapshots__/AppWrapper.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/App/tests/__snapshots__/HomeScreen.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Buy/tests/__snapshots__/Buy.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Buy/tests/__snapshots__/BuyButton.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Buy/tests/__snapshots__/PreviewBuy.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Search/tests/__snapshots__/PortfolioTokenList.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Search/tests/__snapshots__/Search.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Sell/tests/__snapshots__/PreviewSell.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Sell/tests/__snapshots__/Sell.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Sell/tests/__snapshots__/SellButton.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Transaction/tests/__snapshots__/TransactionDetails.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Transaction/tests/__snapshots__/TransactionInfo.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Transaction/tests/__snapshots__/TransactionStatus.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pulse/components/Transaction/tests/__snapshots__/TransactionStatusContainer.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (22)
  • src/apps/pulse/components/App/HomeScreen.tsx (2 hunks)
  • src/apps/pulse/components/Buy/Buy.tsx (6 hunks)
  • src/apps/pulse/components/Buy/BuyButton.tsx (1 hunks)
  • src/apps/pulse/components/Buy/PayingToken.tsx (1 hunks)
  • src/apps/pulse/components/Buy/PreviewBuy.tsx (4 hunks)
  • src/apps/pulse/components/Misc/Close.tsx (1 hunks)
  • src/apps/pulse/components/Misc/Refresh.tsx (1 hunks)
  • src/apps/pulse/components/Misc/Tooltip.tsx (1 hunks)
  • src/apps/pulse/components/Price/TokenPrice.tsx (2 hunks)
  • src/apps/pulse/components/Price/TokenPriceChange.tsx (1 hunks)
  • src/apps/pulse/components/Search/ChainOverlay.tsx (1 hunks)
  • src/apps/pulse/components/Search/PortfolioTokenList.tsx (8 hunks)
  • src/apps/pulse/components/Search/Search.tsx (2 hunks)
  • src/apps/pulse/components/Search/TokenList.tsx (6 hunks)
  • src/apps/pulse/components/Sell/PreviewSell.tsx (9 hunks)
  • src/apps/pulse/components/Sell/Sell.tsx (5 hunks)
  • src/apps/pulse/components/Sell/SellButton.tsx (1 hunks)
  • src/apps/pulse/components/Toast/PulseToast.tsx (2 hunks)
  • src/apps/pulse/components/Transaction/TransactionDetails.tsx (10 hunks)
  • src/apps/pulse/components/Transaction/TransactionStatus.tsx (1 hunks)
  • src/apps/pulse/components/Transaction/TransactionStatusButton.tsx (2 hunks)
  • src/apps/pulse/components/Transaction/TransactionStatusContainer.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-03-28T09:22:22.712Z
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.

Applied to files:

  • src/apps/pulse/components/Search/TokenList.tsx
🧬 Code graph analysis (4)
src/apps/pulse/components/Sell/Sell.tsx (1)
src/utils/number.tsx (1)
  • formatExponentialSmallNumber (119-149)
src/apps/pulse/components/Search/PortfolioTokenList.tsx (1)
src/utils/number.tsx (2)
  • formatExponentialSmallNumber (119-149)
  • limitDigitsNumber (42-69)
src/apps/pulse/components/Transaction/TransactionDetails.tsx (2)
src/apps/pulse/components/Misc/Esc.tsx (1)
  • Esc (7-36)
src/apps/pulse/components/Misc/CloseButton.tsx (1)
  • CloseButton (7-46)
src/apps/pulse/components/Search/Search.tsx (2)
src/apps/pulse/components/Misc/Close.tsx (1)
  • Close (3-16)
src/apps/pulse/components/Search/ChainSelect.tsx (1)
  • ChainSelectButton (3-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: unit-tests
  • GitHub Check: lint
  • GitHub Check: build
🔇 Additional comments (61)
src/apps/pulse/components/Misc/Close.tsx (1)

11-11: Test id addition looks good. Adds a stable selector without changing runtime behavior.

src/apps/pulse/components/Search/ChainOverlay.tsx (1)

5-5: Import reorder acknowledged. Keeps dependencies organized with no impact on execution.

src/apps/pulse/components/Misc/Refresh.tsx (1)

26-26: Refresh selector addition approved. Provides deterministic testing hook while preserving existing logic.

src/apps/pulse/components/Toast/PulseToast.tsx (1)

42-42: LGTM! Test IDs appropriately added.

The data-testid attributes are correctly placed on the toast container and close button, following a consistent naming pattern that aligns with the PR's testability objectives.

Also applies to: 54-54

src/apps/pulse/components/Misc/Tooltip.tsx (1)

87-87: LGTM! Test ID correctly added.

The data-testid attribute is appropriately placed on the outer container, maintaining consistency with the naming pattern used across other Pulse components.

src/apps/pulse/components/Transaction/TransactionStatus.tsx (1)

133-133: LGTM! Test ID correctly added.

The data-testid attribute is appropriately placed on the root animated container, following the consistent "pulse-{component}" naming convention used throughout the PR.

src/apps/pulse/components/Transaction/TransactionStatusContainer.tsx (1)

20-30: LGTM! Test IDs appropriately added.

The data-testid attributes are correctly placed on both the container and the status text element, providing granular test targeting capabilities while maintaining consistent naming conventions.

src/apps/pulse/components/Sell/SellButton.tsx (1)

123-123: LGTM! Test ID correctly added.

The data-testid attribute is appropriately placed on the sell button, maintaining consistency with the naming pattern used across the Pulse components.

src/apps/pulse/components/Buy/PayingToken.tsx (1)

35-38: LGTM! Test ID added for automated testing.

The data-testid attribute has been correctly added to enable test automation. The dynamic identifier pattern using chainId and token name is consistent with the broader PR strategy.

src/apps/pulse/components/Transaction/TransactionStatusButton.tsx (2)

96-99: LGTM! Test ID added for the starting transaction message.

The data-testid attribute enables test automation for the transaction starting state.


111-111: LGTM! Test ID added for the transaction status button.

The data-testid attribute enables test automation for the interactive status button.

src/apps/pulse/components/Buy/PreviewBuy.tsx (4)

351-354: LGTM! Test ID added for the refresh button wrapper.

The data-testid attribute enables test automation for the refresh functionality.


367-370: LGTM! Test ID added for the escape button wrapper.

The data-testid attribute enables test automation for the close/escape functionality.


393-396: LGTM! Test ID added for the buying token container.

The dynamic data-testid pattern using chainId and token name is consistent with similar components in this PR.


529-529: LGTM! Test ID added for the confirm button.

The data-testid attribute enables test automation for the critical transaction confirmation action.

src/apps/pulse/components/Price/TokenPrice.tsx (1)

14-21: LGTM! Consistent test ID added across all rendering paths.

The data-testid attribute has been added to all three rendering branches with the same identifier, ensuring consistent test selectors regardless of the price value formatting.

Also applies to: 25-32, 42-45

src/apps/pulse/components/Price/TokenPriceChange.tsx (1)

50-50: LGTM! Test ID added for the price change indicator.

The data-testid attribute enables test automation for the price change display, complementing the test ID added to TokenPrice.tsx.

src/apps/pulse/components/Transaction/TransactionDetails.tsx (6)

136-158: LGTM! Clear and descriptive test IDs added.

The test IDs for the container, title, and close button wrapper are well-named and follow a consistent pattern.


159-203: Verify dynamic test IDs handle special characters safely.

The dynamic test IDs at lines 161 and 186 interpolate token names directly. If token names contain spaces, special characters, or unusual Unicode, these test IDs may be difficult to target reliably in automated tests.

Consider sanitizing token names in test IDs (e.g., replacing spaces with hyphens, removing special characters) or using static identifiers where possible.


205-281: LGTM! Progress step test IDs are well-structured.

Test IDs clearly distinguish between buy and sell flows with -completed-buy and -completed-sell suffixes.


309-321: LGTM! Done button test IDs added correctly.


136-158: LGTM! Clean testability additions.

The data-testid attributes for the container, title, and close button wrapper are well-placed and follow a consistent naming convention.


309-321: LGTM! Done button test IDs added correctly.

The done button container and button itself have appropriate test IDs.

src/apps/pulse/components/Sell/PreviewSell.tsx (6)

422-454: LGTM! Preview container and control test IDs are clear.


463-620: LGTM! Token section test IDs provide comprehensive coverage.

Test IDs clearly distinguish between selling and receiving tokens, with separate IDs for amounts and USD values.


673-731: LGTM! Transaction state test IDs cover all error and status scenarios.


422-454: LGTM! Preview container and control test IDs are well-placed.


547-620: LGTM! Receiving token section test IDs are well-structured.

The test IDs for the USDC receiving section are comprehensive and consistent.


672-732: LGTM! Error states and action button test IDs are comprehensive.

All transaction states (error, waiting, rejected, confirm) have appropriate test IDs for thorough testing coverage.

src/apps/pulse/components/App/HomeScreen.tsx (3)

801-823: LGTM! HomeScreen test IDs added for key interactive elements.

Test IDs for search and refresh buttons are appropriately named and consistent with the overall pattern.

Also applies to: 892-909


801-822: LGTM! Search button test ID added.


892-909: LGTM! Refresh button test ID added.

src/apps/pulse/components/Buy/BuyButton.tsx (2)

122-133: LGTM! Buy button test ID added correctly.


122-145: LGTM! Buy button test ID added.

src/apps/pulse/components/Search/Search.tsx (6)

303-345: LGTM! Test identifiers added correctly.

The data-testid attributes enhance testability without altering any behavior. The identifiers are descriptive and follow a consistent naming pattern across the search modal UI elements.


303-342: LGTM! Test IDs added consistently.

The data-testid attributes have been added to key UI elements (loading wrapper, refresh button, chain selector, esc button) without altering behavior or structure.


303-305: LGTM!

The loading spinner wrapper with data-testid supports automated testing without altering behavior.


310-319: LGTM!

The refresh button wrapper with data-testid enables UI testing without changing functionality.


334-334: LGTM!

The chain selector data-testid attribute supports testing without impacting behavior.


339-344: LGTM!

The Esc button wrapper with data-testid supports automated testing without affecting functionality.

src/apps/pulse/components/Search/PortfolioTokenList.tsx (7)

81-300: LGTM! Comprehensive test coverage added.

The data-testid attributes are well-structured and provide granular test hooks across all states (loading, error, no data, empty, and populated list). The dynamic test-ids on token rows correctly encode chainId and name for precise identification.


81-300: LGTM! Comprehensive test coverage added.

Data-testid attributes have been systematically added across all states (loading, error, no data, empty) and token list elements. The fragment-to-div change at line 176 is appropriate to support the container testid without affecting rendering.


81-96: LGTM!

The loading state wrappers with data-testid attributes enable granular testing without changing behavior.


104-120: LGTM!

The error state wrappers with data-testid attributes support automated testing without impacting functionality.


127-143: LGTM!

The no-data state wrappers with data-testid attributes enable UI testing without altering behavior.


150-171: LGTM!

The empty state wrappers with data-testid attributes support automated testing without changing functionality.


176-300: LGTM!

The token list container and item-level data-testid attributes enable fine-grained UI testing without impacting behavior. The dynamic test IDs incorporating blockchain and token name support robust test selectors.

src/apps/pulse/components/Buy/Buy.tsx (9)

428-629: LGTM! Test identifiers added appropriately.

The data-testid attributes provide clear test hooks for the buy flow, including dynamic identifiers for selected tokens that encode chainId and name. No behavior changes introduced.


428-629: LGTM! Test IDs cover key user interactions.

Data-testid attributes added to critical elements (token selector, amount input, error messages, wallet balance) with appropriate dynamic values for selected tokens. No behavioral changes introduced.


428-428: LGTM!

The token selector button data-testid attribute supports automated testing without changing behavior.


439-439: LGTM!

The dynamic data-testid incorporating chainId and token name enables robust test selectors without impacting functionality.


565-565: LGTM!

The amount input data-testid attribute supports UI testing without altering behavior.


595-599: LGTM!

The warning icon data-testid attribute enables automated testing without changing functionality.


609-609: LGTM!

The error message data-testid attribute supports UI testing without impacting behavior.


618-622: LGTM!

The wallet icon data-testid attribute enables automated testing without changing functionality.


629-629: LGTM!

The wallet balance data-testid attribute supports UI testing without altering behavior.

src/apps/pulse/components/Sell/Sell.tsx (2)

256-350: LGTM! Clean test ID additions for input and display elements.

The data-testid attributes for the amount input, token symbol, warning indicators, and balance display are properly placed.


352-420: LGTM! Percentage buttons have well-sanitized test IDs.

The percentage button test IDs use toLowerCase() for consistency, which is a good practice.

src/apps/pulse/components/Search/TokenList.tsx (3)

3-4: LGTM!

The import additions and reordering support the component's rendering logic without changing behavior.

Also applies to: 7-8, 11-11


13-17: LGTM!

The updated TokenListProps with handleTokenSelect and searchType enables parent components to handle token selection and pass search context, supporting the testability enhancements across the PR.


75-75: LGTM!

The data-testid attributes on sort controls and token items enable automated testing without impacting functionality. The dynamic token item test IDs support robust test selectors.

Also applies to: 88-88, 102-102, 115-115, 139-139

Comment on lines 302 to 307
{status === 'Transaction Failed' && (
<TransactionErrorBox technicalDetails={technicalDetails} />
<TransactionErrorBox
technicalDetails={technicalDetails}
data-testid="pulse-transaction-details-error-box"
/>
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

Verify that TransactionErrorBox accepts the data-testid prop.

TransactionErrorBox receives a data-testid prop at line 305. Please confirm that this component properly accepts and applies the prop to its root element.


🏁 Script executed:

#!/bin/bash
# Verify that TransactionErrorBox component accepts and uses data-testid prop

# Find the TransactionErrorBox component definition
ast-grep --pattern $'export default function TransactionErrorBox($PROPS) {
  $$$
}'

# Also check for interface/type definitions
rg -nP --type=tsx --type=ts -C5 'interface\s+TransactionErrorBoxProps|type\s+TransactionErrorBoxProps'

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Locate TransactionErrorBox component file
COMP_FILE=$(rg -l "TransactionErrorBox" -g "*.tsx" -g "*.ts" | head -n1)
echo "Component file: $COMP_FILE"

# Show first 200 lines to find definition and props
echo "--- File head ---"
sed -n '1,200p' "$COMP_FILE"

# Look for props interface/type
echo "--- Props interface/type ---"
rg -nP --type=ts --type=tsx -C3 'interface\s+TransactionErrorBoxProps|type\s+TransactionErrorBoxProps' "$COMP_FILE"

# Check if data-testid is applied in JSX
echo "--- data-testid usage ---"
rg -n "data-testid" -C3 "$COMP_FILE"

Length of output: 4504


🏁 Script executed:

#!/bin/bash
# List files in the Transaction component directory
echo "Directory contents:"
ls src/apps/pulse/components/Transaction

# Try to find the TransactionErrorBox component file
echo "Matching files:"
ls src/apps/pulse/components/Transaction | grep -i TransactionErrorBox

# Display the first 200 lines of the component file if found
COMP=src/apps/pulse/components/Transaction/TransactionErrorBox.tsx
if [ -f "$COMP" ]; then
  echo "--- File head ($COMP) ---"
  sed -n '1,200p' "$COMP"
  echo "--- Props interface/type in file ---"
  rg -nP --type=ts --type=tsx -C3 'interface\s+TransactionErrorBoxProps|type\s+TransactionErrorBoxProps' "$COMP"
  echo "--- data-testid usage ---"
  rg -n "data-testid" -C3 "$COMP"
else
  echo "Component file not found at $COMP"
fi

Length of output: 3223


Extend TransactionErrorBox to accept and apply data-testid
The component currently only destructures technicalDetails and ignores extra props. In src/apps/pulse/components/Transaction/TransactionErrorBox.tsx, update the props interface (e.g. extend React.HTMLAttributes<HTMLDivElement> or add data-testid?: string), include ...props in the function signature, and spread {...props} onto the root <div> so the data-testid="pulse-transaction-details-error-box" passed from TransactionDetails.tsx is applied.

🤖 Prompt for AI Agents
In src/apps/pulse/components/Transaction/TransactionErrorBox.tsx around the
component definition, the props only destructure technicalDetails and drop
incoming attributes so data-testid from the parent is ignored; update the props
type to extend React.HTMLAttributes<HTMLDivElement> (or add data-testid?:
string), change the function signature to accept ...props (e.g. ({
technicalDetails, ...props })), and spread {...props} onto the root <div> so the
data-testid="pulse-transaction-details-error-box" passed from
TransactionDetails.tsx is applied.

@github-actions github-actions bot temporarily deployed to Preview (staging) October 1, 2025 16:33 Inactive
@RanaBug RanaBug merged commit b6c418e into staging Oct 1, 2025
6 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 5, 2025
3 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 18, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants