Skip to content

fix(AddressDisplay): add copy fallback and tests for truncation, clipboard, and timer reset (#604) - #616

Open
stayzappy wants to merge 1 commit into
Sorokit:mainfrom
stayzappy:fix/issue-604
Open

fix(AddressDisplay): add copy fallback and tests for truncation, clipboard, and timer reset (#604)#616
stayzappy wants to merge 1 commit into
Sorokit:mainfrom
stayzappy:fix/issue-604

Conversation

@stayzappy

@stayzappy stayzappy commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #604

Summary

  • Added document.execCommand("copy") fallback when navigator.clipboard.writeText rejects or is unavailable.
  • Updated aria-label to "Copied!" upon copy success.
  • Added unit tests in AddressDisplay.test.tsx:
    • Truncated address rendering by default.
    • Full untruncated address copied on button click.
    • Fake timer reset after 2000ms back to "Copy address".
    • Fallback triggering execCommand on clipboard.writeText failure.
    • Error resilience when both clipboard API and fallback throw.

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.

Write tests for AddressDisplay truncation copy-to-clipboard and clipboard fallback

1 participant