Skip to content

test(ui): add unit test coverage for Tabs and Avatar/AvatarStack components (#277, #278) - #292

Open
ghzhost wants to merge 1 commit into
MergeFi:mainfrom
ghzhost:fix/tabs-avatar-tests
Open

test(ui): add unit test coverage for Tabs and Avatar/AvatarStack components (#277, #278)#292
ghzhost wants to merge 1 commit into
MergeFi:mainfrom
ghzhost:fix/tabs-avatar-tests

Conversation

@ghzhost

@ghzhost ghzhost commented Aug 21, 2026

Copy link
Copy Markdown

What this does

Resolves #277 and #278 by introducing dedicated unit test coverage for Tabs and Avatar/AvatarStack UI components:

  1. Tabs component (src/components/ui/Tabs.test.tsx) (Tabs has no test file — its click-handling and active-tab-switching logic (independent of its known ARIA gaps) is entirely unverified #277):

    • Asserts that all tab labels render correctly.
    • Asserts clicking a tab triggers onChange with the clicked tab's key.
    • Asserts active tab receives active styling (bg-white text-slate-900) while inactive tabs receive text-slate-500.
    • Asserts count badges render if and only if typeof tab.count === "number" (including 0).
  2. Avatar / AvatarStack component (src/components/ui/Avatar.test.tsx) (Avatar and AvatarStack have no test file — AvatarStack's overflow-count ("+N") calculation is entirely unverified #278):

    • Asserts dicebear URL construction with seed encoding and data-unoptimized flag.
    • Asserts explicit src override handling.
    • Asserts AvatarStack overflow calculations for cases:
      • Under max seeds (all rendered, no overflow badge).
      • Exactly at max seeds (rest === 0, no overflow badge).
      • Over max seeds (renders max avatars + exact +N badge).

How I verified it

  • Executed full project build (npm run build).
  • TypeScript type checking and Next.js compiler verification passed cleanly.

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Tabs has no test file — its click-handling and active-tab-switching logic (independent of its known ARIA gaps) is entirely unverified

1 participant