Part of #1630.
Three related bits of test debt surfaced while reviewing the domain-icon registry work. None is urgent; grouping them so they are fixed together.
Duplicated retention mock block
The same six-field useRetention + PricingDialog mock is copy-pasted across five files:
frontend/ui/src/app/projects/[projectId]/detectors/page.test.tsx
frontend/ui/src/app/projects/[projectId]/detectors/[detectorId]/page.test.tsx
frontend/ui/src/app/projects/[projectId]/sessions/page.test.tsx
frontend/ui/src/app/projects/[projectId]/users/page.test.tsx
frontend/ui/src/app/projects/[projectId]/traces/page.user-filter.test.tsx
A shared test helper would stop the next page test rediscovering which fields the hook returns. Deliberately not done during the registry work to avoid diverging from the established pattern mid-change.
Duplicated page-test scaffolding
traces/page.user-filter.test.tsx duplicates roughly 60 lines of mock scaffolding from its sibling traces/page.prefetch.test.tsx, which already uses mutable module-level state for exactly this "vary one input across cases" need. Making useSearchParams read a mutable variable there would let the badge case move in and the extra file be deleted.
Its useRetention / PricingDialog mocks are also redundant, since its QueryClientProvider wrapper lets the real hook run.
Icon changes that are covered but not asserted
Coverage counts these lines, but the tests would still pass with the icon deleted:
frontend/ui/src/features/traces/components/SessionDetailPanel.test.tsx asserts badge text only, across four migrated icon lines
- The onboarding project-step glyph change (
Layers → FolderKanban) has no assertion at all
SpanTreeView.render.test.tsx and SpanTimelineView.test.tsx show the pattern to copy: assert badge.querySelector("svg") is present.
Part of #1630.
Three related bits of test debt surfaced while reviewing the domain-icon registry work. None is urgent; grouping them so they are fixed together.
Duplicated retention mock block
The same six-field
useRetention+PricingDialogmock is copy-pasted across five files:frontend/ui/src/app/projects/[projectId]/detectors/page.test.tsxfrontend/ui/src/app/projects/[projectId]/detectors/[detectorId]/page.test.tsxfrontend/ui/src/app/projects/[projectId]/sessions/page.test.tsxfrontend/ui/src/app/projects/[projectId]/users/page.test.tsxfrontend/ui/src/app/projects/[projectId]/traces/page.user-filter.test.tsxA shared test helper would stop the next page test rediscovering which fields the hook returns. Deliberately not done during the registry work to avoid diverging from the established pattern mid-change.
Duplicated page-test scaffolding
traces/page.user-filter.test.tsxduplicates roughly 60 lines of mock scaffolding from its siblingtraces/page.prefetch.test.tsx, which already uses mutable module-level state for exactly this "vary one input across cases" need. MakinguseSearchParamsread a mutable variable there would let the badge case move in and the extra file be deleted.Its
useRetention/PricingDialogmocks are also redundant, since itsQueryClientProviderwrapper lets the real hook run.Icon changes that are covered but not asserted
Coverage counts these lines, but the tests would still pass with the icon deleted:
frontend/ui/src/features/traces/components/SessionDetailPanel.test.tsxasserts badge text only, across four migrated icon linesLayers→FolderKanban) has no assertion at allSpanTreeView.render.test.tsxandSpanTimelineView.test.tsxshow the pattern to copy: assertbadge.querySelector("svg")is present.