Skip to content

Fix/component unit tests following empty state - #807

Merged
Chucks1093 merged 4 commits into
accesslayerorg:devfrom
Mosas2000:fix/component-unit-tests-following-empty-state
Aug 27, 2026
Merged

Fix/component unit tests following empty state#807
Chucks1093 merged 4 commits into
accesslayerorg:devfrom
Mosas2000:fix/component-unit-tests-following-empty-state

Conversation

@Mosas2000

Copy link
Copy Markdown
Contributor

Key Changes

1. XLM Price Formatter & Unit Tests (#766)

  • Implemented formatXlmPrice in numberFormat.utils.ts to format XLM amounts with two decimal places.
  • Added unit tests in xlmPriceFormatter.test.ts verifying whole numbers (10.00 XLM), fractional values (0.50 XLM), small values (0.001 -> 0.00 XLM), rounding (1000.999 -> 1001.00 XLM), and zero (0.00 XLM).

2. Transaction Type Badge Component & Unit Tests (#765)

  • Introduced TransactionTypeBadge component to render styled badges (Buy in green, Sell in red, and Unknown in grey).
  • Integrated TransactionTypeBadge into TransactionHistory.
  • Added unit tests in TransactionTypeBadge.test.tsx verifying labels, color classes, and fallback behavior for missing/unknown types without throwing errors.

3. Creator Card Component & Unit Tests (#767)

  • Updated CreatorCard to format zero prices as 0.00 XLM, null prices as a dash placeholder (), and holder counts as X holders.
  • Wrapped creator profile names with navigation links pointing to /creator/:id.
  • Added unit tests in CreatorCard.props.test.tsx confirming prop rendering, zero value resilience, dash placeholders, and route link attributes.

4. Following Page Empty State & Unit Tests (#764)

  • Created FollowingPage component rendering a loading skeleton during query fetch and an empty state once the query settles with an empty array.
  • Displayed empty state message: "You are not following anyone yet — discover creators on the marketplace".
  • Included a "Browse Marketplace" button navigating to /creators.
  • Added /following route to routes.tsx and unit tests in FollowingPage.test.tsx.

Verification

  • Unit Tests: All 18 unit tests passed across xlmPriceFormatter.test.ts, TransactionTypeBadge.test.tsx, CreatorCard.props.test.tsx, and FollowingPage.test.tsx.
  • Lint & Build: Executed pnpm check (eslint . && tsc -b && vite build) with zero linting or TypeScript compilation errors.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Mosas2000 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit ee9e195 into accesslayerorg:dev Aug 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment