Skip to content

test: add render coverage for Skeleton.tsx - #1134

Open
tosin-zoffun wants to merge 1 commit into
LabsCrypt:mainfrom
tosin-zoffun:feat/issue-1032
Open

test: add render coverage for Skeleton.tsx#1134
tosin-zoffun wants to merge 1 commit into
LabsCrypt:mainfrom
tosin-zoffun:feat/issue-1032

Conversation

@tosin-zoffun

Copy link
Copy Markdown

Changes

  • [Frontend] Skeleton.tsx exports multiple skeleton variants but has no unit test verifying each renders the expected number of placeholder rows #1032: the issue describes Skeleton.tsx exporting several variants with row-count props (plus a mentioned but already-dead StreamListSkeleton). As it exists on main today, Skeleton.tsx exports exactly one component — a single className-only placeholder <div>, no row-count prop, no StreamListSkeleton or any other named variant anywhere in the codebase (checked with a repo-wide grep). There's nothing matching the multi-variant "assert placeholder count equals the row prop" description to test without inventing that API from scratch, which would be adding a feature, not testing one that exists.
  • Added Skeleton.test.tsx covering the one export that does exist: renders exactly one placeholder element, applies the default animate-pulse/rounded-md styling, and correctly merges a caller-supplied className.

Test plan

  • npx vitest run src/components/ui/Skeleton.test.tsx — 4 passed
  • npx vitest run (full suite) — 186 passed; the 2 pre-existing failing suites (useIncomingStreams.test.ts and one other, both a .ts-file-using-JSX esbuild error) fail identically on main before this change, confirmed via git stash -u — unrelated to this change, out of scope

Closes #1032

Skeleton.tsx currently exports a single component (a className-only
placeholder <div>) — no row-count prop, no StreamListSkeleton or other
named variants exist anywhere in the codebase, so there's nothing
matching the multi-variant "assert placeholder count equals the row
prop" description to test without inventing that API from scratch.
Added coverage for the one export that does exist: renders exactly one
placeholder element, applies the default pulse/rounded styling, and
correctly merges a caller-supplied className.

Closes LabsCrypt#1032
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.

[Frontend] Skeleton.tsx exports multiple skeleton variants but has no unit test verifying each renders the expected number of placeholder rows

1 participant