test(HelperText): add unit test coverage and assert exact color classes - #1
Closed
olitreadwell wants to merge 3 commits into
Closed
test(HelperText): add unit test coverage and assert exact color classes#1olitreadwell wants to merge 3 commits into
olitreadwell wants to merge 3 commits into
Conversation
HelperText was the only remaining public component in packages/ui with zero test coverage (verified across all 45 component folders). It only appeared indirectly through Label's integration test, so its own rendering, color variants, className merging, ref forwarding, and theme overrides were never asserted directly. Adds a dedicated HelperText.test.tsx following the same Rendering / Classname / Ref / Theme structure used by sibling component tests (e.g. Badge, Spinner, Blockquote).
The color it.each test only checked that className was non-empty, which passes even if the color prop had no effect at all (base classes are always present). Assert the specific expected class per color instead, matching the values in theme.ts.
olitreadwell
force-pushed
the
test/helper-text-coverage
branch
from
August 12, 2026 04:06
f605c5f to
89217e1
Compare
Owner
Author
|
Closing as superseded: the same change is already open upstream in themesberg#1687. See themesberg#1687 |
Owner
Author
|
Superseded by upstream themesberg#1687. |
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.
HelperTextwas the only component inpackages/ui/src/componentswith zero dedicated test coverage (verified by comparing.tsxsource files against.test.tsxfiles across all 45 component folders).It only showed up indirectly, rendered inside
Label.test.tsx's integration test: its own rendering, color variants,classNamemerging, ref forwarding, and theme overrides were never asserted directly.Adds
packages/ui/src/components/HelperText/HelperText.test.tsx, following the sameRendering/Classname/Ref/Themestructure used by sibling component tests (Badge,Spinner,Blockquote).No source changes: test-only addition, 12 test cases.
Second commit tightens the color-variant assertions: the initial
it.eachonly checked thatclassNamewas non-empty, which passes even if thecolorprop had no effect (base classes are always present).It now asserts the exact color classes instead of a non-empty check, matching the values in
theme.ts.Third commit (addressing CodeRabbit review on the upstream PR): the color cases now assert each color's dark-mode class (
dark:*) alongside the light-mode class, matchingtheme.ts.No breaking API changes.
No props, theme structure, or public API were added, removed, or changed.
Test plan
bun run test:coverage: all tests pass, including the 12 newHelperTexttestsbun run lint: 0 errorsbun run typecheck: passesbun run format:check: passesbun run build: passesChangeset: not included.
This is a test-only change with no effect on the published package's behavior or public API, so no version bump/changelog entry is warranted per this repo's Changesets convention.
How to verify
PROMOTION NOTE (remove this section before/when opening against upstream):
Prerequisites: none.
No CLA/DCO bot found in
themesberg/flowbite-react(checked.github/workflows,CONTRIBUTING.md, branch protection); no signed-commit requirement found.Branch name and commit message already match this repo's own conventions (commitizen-style
type/descriptionbranch prefix,type(scope): descriptioncommit style seen in upstream history).AI assistance
Drafted with AI assistance.
The gap was found and verified against the current code, the change was verified before opening, and this diff was reviewed line by line.