Skip to content

Add unit tests for the watchlist toggle asserting bookmark state persists in localStorage across renders #861

Description

@Chucks1093

Summary

The watchlist toggle reads from and writes to localStorage. Unit tests should mock localStorage and assert that toggling a key on and off correctly updates the stored list and that the bookmark icon reflects the correct state on re-render.

Scope

  • Test that clicking the bookmark icon on an unbookmarked key adds it to localStorage and shows the filled icon
  • Test that clicking the bookmark icon on a bookmarked key removes it from localStorage and shows the outline icon
  • Test that the bookmark icon renders as filled on mount when the key is already in localStorage
  • Test that the watchlist count in the navbar updates after each toggle
  • Test that disconnecting the wallet clears the localStorage watchlist entry

Acceptance Criteria

  • Bookmarking adds key to localStorage and shows filled icon
  • Unbookmarking removes key from localStorage and shows outline icon
  • Filled icon shown on mount for already-bookmarked keys
  • Navbar count updates after toggle
  • localStorage cleared on wallet disconnect

ETA: 12 hours


Coordinate on Telegram

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions