Context
packages/loopover-ui-kit (npm: @loopover/ui-kit) is the shared design-system package consumed by
both apps/loopover-ui (ORB) and apps/loopover-miner-ui (AMS). Its package.json has only two
scripts, build and typecheck — no test, and no test-related devDependencies at all. There is
no vitest.config.ts in the package directory, and no file anywhere under
packages/loopover-ui-kit/ matches *.test.*. The root vitest.config.ts's coverage.include list
enumerates src/**, packages/loopover-engine, packages/loopover-miner, packages/discovery-index,
and packages/loopover-mcp explicitly — packages/loopover-ui-kit is absent from that list too, so
even if a stray test file existed there today it would not be instrumented by the root run either.
In practice, whatever behavioral coverage this package's components get today happens only
indirectly, through whichever consuming app happens to re-export and exercise a given component or
hook (e.g. relativeTimeFromNow is thoroughly tested, but only via
apps/loopover-ui/src/components/site/refresh-meta.test.tsx importing it through the
apps/loopover-ui/src/lib/utils.ts re-export — not from any test inside the package that actually
owns the function). Some exports have no such indirect coverage found anywhere in this audit.
This repo already has a directly analogous precedent for treating an entirely-unmeasured directory as
a real bug worth its own issue: #6250 ("review-enrichment's real node:test coverage is invisible to
Codecov — 83 of 83 files effectively unmeasured"), filed and labeled gittensor:bug.
A concrete instance of what this blind spot costs: a re-render/edge-vs-level-trigger defect in
state-views.tsx (see the sibling issue on StateBoundary's failure-notify effect) slipped past
every existing indirect test, because none of them assert on the primitive's own contract directly.
Requirements
- Add
packages/loopover-ui-kit/vitest.config.ts (mirror apps/loopover-miner-ui/vitest.config.ts's
shape: jsdom/happy-dom environment, React plugin, @testing-library/react setup) plus a test
script in packages/loopover-ui-kit/package.json, and the needed test-only devDependencies
(vitest, @testing-library/react, @testing-library/jest-dom or equivalent, a DOM environment
package) — matching versions already used by apps/loopover-miner-ui's package.json where
possible, to avoid introducing a second, drifting version of the same tooling in the monorepo.
- Write real, colocated unit tests for the package's own logic-bearing exports only — not the
~40 purely-presentational shadcn-derived primitives (button.tsx, badge.tsx, card.tsx, etc.,
which have no conditional logic of their own to regress). In scope:
src/utils.ts: cn (basic merge behavior) and relativeTimeFromNow (all four time buckets —
seconds/minutes/hours/days — plus the future-clock-skew clamp to "just now"; note this function
already has thorough indirect coverage via apps/loopover-ui/src/components/site/refresh-meta.test.tsx
— port those exact cases into the new colocated test rather than inventing new ones, so behavior
doesn't drift between the two).
src/hooks/use-mobile.tsx: useIsMobile — both above/below the 768px breakpoint, and a
matchMedia change event flipping the result.
src/components/state-views.tsx: LoadingState/EmptyState/ErrorState default copy and the
errorKind-driven network-vs-generic copy branch, and StateBoundary's
loading/error/empty/children precedence order. Do not write a test asserting the current
re-render-triggers-onFailureNotify-every-time behavior of the useEffect at lines 267–280 —
that behavior is a known bug tracked separately; leave that specific effect's call-count behavior
untested here to avoid locking in the bug, or coordinate with that issue if it's already in
progress.
- Wiring this new test script into the root
test:ci orchestration path is out of scope for this
issue unless there's an obvious single hook point — file that wiring as a follow-up if it turns
out to need more than adding the package to an existing npm run fan-out list. State plainly in the
PR if npm run test:ci at the root does or doesn't pick up the new suite.
Deliverables
Test Coverage Requirements
packages/loopover-ui-kit is not in the root vitest.config.ts's coverage.include list and is not
measured by Codecov's patch gate — similar in effect to the apps/** ignore in codecov.yml,
though not literally named there (it's simply never instrumented). This PR's acceptance signal is
that the new package-local test script runs and passes locally, not a Codecov percentage. Do not
attempt to force this package into the root coverage measurement as part of this issue — that's a
separate, larger decision (whether packages/loopover-ui-kit should ever be Codecov-gated at all)
that stays out of scope here.
Expected Outcome
packages/loopover-ui-kit's own logic (relativeTimeFromNow, useIsMobile, the state-primitive copy
branches) is verified directly, by a test suite that runs independently of any consuming app, instead
of only incidentally through whichever app happens to import and exercise it today.
Links & Resources
packages/loopover-ui-kit/package.json
apps/loopover-miner-ui/vitest.config.ts (the config shape to mirror)
apps/loopover-ui/src/components/site/refresh-meta.test.tsx (existing relativeTimeFromNow cases to port)
- Precedent issue:
#6250 (whole-directory coverage blind spot, same gittensor:bug shape)
Context
packages/loopover-ui-kit(npm:@loopover/ui-kit) is the shared design-system package consumed byboth
apps/loopover-ui(ORB) andapps/loopover-miner-ui(AMS). Itspackage.jsonhas only twoscripts,
buildandtypecheck— notest, and no test-relateddevDependenciesat all. There isno
vitest.config.tsin the package directory, and no file anywhere underpackages/loopover-ui-kit/matches*.test.*. The rootvitest.config.ts'scoverage.includelistenumerates
src/**,packages/loopover-engine,packages/loopover-miner,packages/discovery-index,and
packages/loopover-mcpexplicitly —packages/loopover-ui-kitis absent from that list too, soeven if a stray test file existed there today it would not be instrumented by the root run either.
In practice, whatever behavioral coverage this package's components get today happens only
indirectly, through whichever consuming app happens to re-export and exercise a given component or
hook (e.g.
relativeTimeFromNowis thoroughly tested, but only viaapps/loopover-ui/src/components/site/refresh-meta.test.tsximporting it through theapps/loopover-ui/src/lib/utils.tsre-export — not from any test inside the package that actuallyowns the function). Some exports have no such indirect coverage found anywhere in this audit.
This repo already has a directly analogous precedent for treating an entirely-unmeasured directory as
a real bug worth its own issue:
#6250("review-enrichment's real node:test coverage is invisible toCodecov — 83 of 83 files effectively unmeasured"), filed and labeled
gittensor:bug.A concrete instance of what this blind spot costs: a re-render/edge-vs-level-trigger defect in
state-views.tsx(see the sibling issue onStateBoundary's failure-notify effect) slipped pastevery existing indirect test, because none of them assert on the primitive's own contract directly.
Requirements
packages/loopover-ui-kit/vitest.config.ts(mirrorapps/loopover-miner-ui/vitest.config.ts'sshape: jsdom/happy-dom environment, React plugin,
@testing-library/reactsetup) plus atestscript in
packages/loopover-ui-kit/package.json, and the needed test-onlydevDependencies(
vitest,@testing-library/react,@testing-library/jest-domor equivalent, a DOM environmentpackage) — matching versions already used by
apps/loopover-miner-ui'spackage.jsonwherepossible, to avoid introducing a second, drifting version of the same tooling in the monorepo.
~40 purely-presentational shadcn-derived primitives (
button.tsx,badge.tsx,card.tsx, etc.,which have no conditional logic of their own to regress). In scope:
src/utils.ts:cn(basic merge behavior) andrelativeTimeFromNow(all four time buckets —seconds/minutes/hours/days — plus the future-clock-skew clamp to "just now"; note this function
already has thorough indirect coverage via
apps/loopover-ui/src/components/site/refresh-meta.test.tsx— port those exact cases into the new colocated test rather than inventing new ones, so behavior
doesn't drift between the two).
src/hooks/use-mobile.tsx:useIsMobile— both above/below the 768px breakpoint, and amatchMediachangeevent flipping the result.src/components/state-views.tsx:LoadingState/EmptyState/ErrorStatedefault copy and theerrorKind-driven network-vs-generic copy branch, andStateBoundary'sloading/error/empty/children precedence order. Do not write a test asserting the current
re-render-triggers-
onFailureNotify-every-time behavior of theuseEffectat lines 267–280 —that behavior is a known bug tracked separately; leave that specific effect's call-count behavior
untested here to avoid locking in the bug, or coordinate with that issue if it's already in
progress.
test:ciorchestration path is out of scope for thisissue unless there's an obvious single hook point — file that wiring as a follow-up if it turns
out to need more than adding the package to an existing
npm runfan-out list. State plainly in thePR if
npm run test:ciat the root does or doesn't pick up the new suite.Deliverables
packages/loopover-ui-kit/package.jsonhas atestscript and the test devDependencies.packages/loopover-ui-kit/vitest.config.tsexists and runs standalone(
npm --workspace @loopover/ui-kit run testor equivalent).utils.ts,hooks/use-mobile.tsx, andcomponents/state-views.tsx(excluding the failure-notify effect's call-count behavior, per above).
Test Coverage Requirements
packages/loopover-ui-kitis not in the rootvitest.config.ts'scoverage.includelist and is notmeasured by Codecov's
patchgate — similar in effect to theapps/**ignore incodecov.yml,though not literally named there (it's simply never instrumented). This PR's acceptance signal is
that the new package-local test script runs and passes locally, not a Codecov percentage. Do not
attempt to force this package into the root coverage measurement as part of this issue — that's a
separate, larger decision (whether
packages/loopover-ui-kitshould ever be Codecov-gated at all)that stays out of scope here.
Expected Outcome
packages/loopover-ui-kit's own logic (relativeTimeFromNow,useIsMobile, the state-primitive copybranches) is verified directly, by a test suite that runs independently of any consuming app, instead
of only incidentally through whichever app happens to import and exercise it today.
Links & Resources
packages/loopover-ui-kit/package.jsonapps/loopover-miner-ui/vitest.config.ts(the config shape to mirror)apps/loopover-ui/src/components/site/refresh-meta.test.tsx(existingrelativeTimeFromNowcases to port)#6250(whole-directory coverage blind spot, samegittensor:bugshape)