test: add render coverage for Skeleton.tsx - #1134
Open
tosin-zoffun wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Skeleton.tsxexporting several variants with row-count props (plus a mentioned but already-deadStreamListSkeleton). As it exists onmaintoday,Skeleton.tsxexports exactly one component — a singleclassName-only placeholder<div>, no row-count prop, noStreamListSkeletonor 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.Skeleton.test.tsxcovering the one export that does exist: renders exactly one placeholder element, applies the defaultanimate-pulse/rounded-mdstyling, and correctly merges a caller-suppliedclassName.Test plan
npx vitest run src/components/ui/Skeleton.test.tsx— 4 passednpx vitest run(full suite) — 186 passed; the 2 pre-existing failing suites (useIncomingStreams.test.tsand one other, both a.ts-file-using-JSX esbuild error) fail identically onmainbefore this change, confirmed viagit stash -u— unrelated to this change, out of scopeCloses #1032