Skip to content

Button.test.tsx only covers the loading prop — variant and size, the component's core API, have zero test coverage #421

Closed

Description

@chonilius

Problem

src/components/ui/Button.test.tsx has exactly one describe block, "Button — loading prop" (5 test cases), all about the loading/aria-busy behavior added for #211. variant (primary/secondary/ghost/outline) and size (sm/md/lg) — the two other props this component's whole API is built around — have zero test coverage. variantClasses/sizeClasses are plain Record lookups with no runtime validation; a typo'd key, a swapped pair of class strings, or an accidentally-removed variant would produce no error, just a silently wrong (or entirely missing, if cn() receives undefined) className — and nothing would catch it.

Button is this app's single most-used primitive — every fund/claim/refund/deposit/connect/sign-in action across IssueActions, MilestoneActions, ConnectPanel, Navbar, ErrorBoundary, and more renders through it with a specific variant/size combination chosen for a reason (e.g. variant="outline" for the less-emphasized "Refund sponsor" action next to a primary "Claim" button) — none of that visual-hierarchy intent is protected by a test.

Impact

A regression in variantClasses/sizeClasses would silently change the visual weight/styling of buttons across the entire app (e.g. every "primary" action accidentally rendering with "ghost" styling) with zero test failures anywhere, since the one component both consumers and this repo's design system depend on for that distinction is only tested for its loading behavior.

Suggested fix

Add test cases asserting each variant and size value produces its corresponding expected class(es) in the rendered className, and that the default (variant="primary", size="md") is applied when neither prop is passed.

Activity

  1. added
    testing
    on Sep 17, 2026
  2. ranjeet150 commented on Sep 17, 2026

    @ranjeet150

    Hello @maintainers,

    I can tackle Button.test.tsx only covers the loading prop — variant and size, the component's core API, have zero test coverage. Proposed implementation roadmap:

    • Analysis: Inspect current behavior and edge cases in MergeFi/frontend
    • Core Implementation: Implement robust automated tests covering Button.test.tsx only covers the loading prop — variant and size, the component's core API, have zero test coverage with clean isolation and assertion checks.
    • Quality Assurance: Validate both positive flows and negative/revert branches.

    Looking forward to collaborating on this—please assign!

  3. added
    Stellar Wave
    on Sep 23, 2026
  4. Philanderboy commented on Sep 23, 2026

    @Philanderboy

    @Philanderboy has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I would like to work on this and give you the result you want

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Philanderboy to this issue.

  5. ephraimkucha90-boop commented on Sep 23, 2026

    @ephraimkucha90-boop

    @ephraimkucha90-boop has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I would like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @ephraimkucha90-boop to this issue.

  6. chinoyenmose commented on Sep 23, 2026

    @chinoyenmose
    Contributor

    @chinoyenmose has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Please can u assign this issue to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @chinoyenmose to this issue.

  7. drips-wave commented on Sep 23, 2026

    @drips-wave

    Congratulations, @chinoyenmose! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @chinoyenmose: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  8. drips-wave commented on Sep 25, 2026

    @drips-wave

    This issue has been completed by @chinoyenmose as part of the Stellar Wave Program's 9th Wave 🥳

    😎 @chinoyenmose: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  9. removed
    Stellar Wave
    on Oct 15, 2026
  10. added
    Stellar Wave
    on Oct 15, 2026
  11. removed
    Stellar Wave
    on Oct 15, 2026
  12. added
    Stellar Wave
    on Oct 15, 2026
  13. removed
    Stellar Wave
    on Oct 15, 2026
  14. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar Wavetesting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions