Add new regression tests for React SDK#1556
Conversation
… approach to check through the UI instead of API call.
…ared transaction id
albertoelias-crossmint
left a comment
There was a problem hiding this comment.
looks good, left some comments
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/wallets/quickstart-devkit/e2e/helpers/wallet.ts
Line: 76:76
Comment:
Console log message says "Failed" but uses success emoji ✅ - should use ❌ or ⚠️
```suggestion
console.log("⚠️ Failed to get wallet balance, retrying...");
```
How can I resolve this? If you propose a fix, please make it concise. |
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/wallets/quickstart-devkit/components/balance.tsx
Line: 66:92
Comment:
**Redundant ternary — both branches are identical**
After the refactor from USDC to USDXM, the Stellar and non-Stellar branches (lines 66-92) now render exactly the same JSX. The `wallet?.chain === "stellar"` ternary can be collapsed into a single block:
```suggestion
<div className="flex justify-between items-center">
<div className="flex items-center gap-2">
<Image src="/usdc.svg" alt="USDXM" width={24} height={24} />
<p className="font-medium">USDXM</p>
</div>
<div className="text-gray-700 font-medium" data-testid="usdxm-balance">
${" "}
{formatBalance(
balances?.tokens?.find((t) => t.symbol?.toLowerCase() === "usdxm")?.amount ?? "0"
)}
</div>
</div>
```
How can I resolve this? If you propose a fix, please make it concise. |
|
Can you specify in the PR description what are we adding tests for and which chains? 🙏 |
Additional Comments (2)
Now that Stellar is included in
The e2e test Consider adding a Stellar check: Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/wallets/quickstart-devkit/components/approval-test.tsx
Line: 11:12
Comment:
**Stellar wallets misclassified as EVM**
Now that Stellar is included in `TEST_CONFIGURATIONS`, these boolean checks cause problems for Stellar wallets. When `wallet?.chain === "stellar"`, `isEVMWallet` is `true` and `isSolanaWallet` is `false`. This means:
1. The token select defaults to `"eth"` (line 16) instead of a Stellar-appropriate token
2. The recipient placeholder shows `"0x..."` (line 233) instead of a Stellar address format
3. `isValidAddress` (line 35) uses EVM's `isAddress()`, which rejects valid Stellar addresses like `CANKOZR2...`
The e2e test `"should create and approve a prepared transaction"` now runs against Stellar configs and passes a Stellar recipient address. When the component calls `handleCreatePreparedTransaction`, `isValidAddress` will return `false`, causing the transaction to fail with "Invalid recipient address."
Consider adding a Stellar check:
```
const isEVMWallet = wallet?.chain !== "solana" && wallet?.chain !== "stellar";
const isSolanaWallet = wallet?.chain === "solana";
const isStellarWallet = wallet?.chain === "stellar";
```
How can I resolve this? If you propose a fix, please make it concise.
After the changes, both the Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/wallets/quickstart-devkit/components/balance.tsx
Line: 66:92
Comment:
**Stellar/non-Stellar branches are now identical**
After the changes, both the `wallet?.chain === "stellar"` branch (lines 67-78) and the `else` branch (lines 79-91) render the exact same JSX — same alt text, same label, same `data-testid`, and same balance lookup logic. The ternary is unnecessary and can be simplified to a single block.
```suggestion
<div className="flex justify-between items-center">
<div className="flex items-center gap-2">
<Image src="/usdc.svg" alt="USDXM" width={24} height={24} />
<p className="font-medium">USDXM</p>
</div>
<div className="text-gray-700 font-medium" data-testid="usdxm-balance">
${" "}
{formatBalance(
balances?.tokens?.find((t) => t.symbol?.toLowerCase() === "usdxm")?.amount ?? "0"
)}
</div>
</div>
```
How can I resolve this? If you propose a fix, please make it concise. |
|
From the PR description:
I guess it's
?? |
Yes, you are correct, just typo, I fixed it |
Description
Chains / chain architectures tested
Flows covered
Test plan
All tests should work
Package updates