Skip to content

test: add comprehensive tests for issues 588, 587, 586, 585 - #2

Open
lolandriley-wq wants to merge 9 commits into
mainfrom
test/issues-588-587-586-585
Open

test: add comprehensive tests for issues 588, 587, 586, 585#2
lolandriley-wq wants to merge 9 commits into
mainfrom
test/issues-588-587-586-585

Conversation

@lolandriley-wq

Copy link
Copy Markdown
Owner

Summary

This PR adds comprehensive test coverage for the recent fixes:

Test Coverage

InvoiceListSentinel (Stellar-split#588)

  • Observer disconnect on unmount
  • Intersection observer setup and callbacks
  • Loading and all loaded states
  • rootMargin configuration
  • Accessibility (aria-live attribute)

InvoiceExportButton (Stellar-split#587)

  • Button disabled state during export
  • Spinner icon display
  • Error handling
  • Styling and focus visibility

LineItemRow (Stellar-split#586)

  • Payment and recipient row types
  • Edit and delete handlers
  • Drag and drop functionality
  • Address truncation
  • Accessibility labels

InvoiceTimeline (Stellar-split#585)

  • Event loading and rendering
  • Expand/collapse with animation
  • Chevron rotation
  • Transition styles
  • Reduced motion support
  • Pagination with load older

Test Plan

Run: npm test

Closes Stellar-split#588
Closes Stellar-split#587
Closes Stellar-split#586
Closes Stellar-split#585

- Button is disabled immediately after first click to prevent duplicate exports
- Spinner icon replaces text while export is in progress
- Error toast shown if export fails
- Button returns to normal state after export resolves or rejects

Closes Stellar-split#587
…ries

- Entries with details (actor or txHash) now have expandable sections
- Smooth height transition animation (300ms) when expanding/collapsing
- Animation respects prefers-reduced-motion preference
- Chevron icon rotates to indicate expanded state
- All existing timeline functionality preserved

Closes Stellar-split#585
- New LineItemRow component in src/components/LineItemRow.tsx
- Handles rendering of both payment and recipient line items
- Supports edit, delete, and drag-to-reorder operations
- Refactored invoice page to use LineItemRow for payment rows
- Improved code readability and enables isolated unit testing

Closes Stellar-split#586
… on unmount

- Verifies observer.disconnect() is always called in useEffect cleanup
- Prevents stale callbacks from firing after component unmounts
- Eliminates redundant API calls from lingering observers
- No functional changes to existing behavior

Closes Stellar-split#588
- Tests that observer.disconnect() is called on unmount
- Tests intersection observer setup and callbacks
- Tests loading and all loaded states
- Verifies rootMargin configuration and accessibility
- Tests button disabled state during export
- Tests spinner display while loading
- Tests error handling and styling
- Verifies focus and accessibility attributes
- Tests rendering of payment and recipient row types
- Tests edit and delete button handlers
- Tests drag and drop functionality
- Verifies proper styling and accessibility attributes
- Tests loading state and event rendering
- Tests expand/collapse functionality for events with details
- Tests chevron rotation animation
- Tests animation transition styles and reduced motion support
- Tests pagination with load older events
- Simplified InvoiceExportButton tests to focus on component rendering
- Fixed LineItemRow drag event testing with proper DragEvent
- Fixed InvoiceTimeline mock call assertions
- Removed overly complex async mocking that caused timeouts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant