Skip to content

test: add comprehensive test coverage for UI critical business logic (Phase 1 & 2)#411

Merged
dsclassen merged 6 commits intomainfrom
test/ui/add-critical-tests
Feb 12, 2026
Merged

test: add comprehensive test coverage for UI critical business logic (Phase 1 & 2)#411
dsclassen merged 6 commits intomainfrom
test/ui/add-critical-tests

Conversation

@dsclassen
Copy link
Collaborator

Summary

Implements comprehensive test coverage for critical business logic in the UI package, following the test coverage plan. This PR completes Phase 1 and makes significant progress on Phase 2.

Coverage Progress

Starting Coverage: ~35.8%
Current Coverage: Significantly improved
Target Coverage: 70% for critical business logic

✅ Phase 1: API Slices & State Management (Complete)

  • 5 files tested, 43 tests total
  • All files at 95-100% coverage
  • Files:
    • app/api/apiSlice.ts - Main API slice with reauth logic (95.65%, 10 tests)
    • app/api/sfapiSlice.ts - Superfacility API (100%, 6 tests)
    • features/bullmq/bullmqApiSlice.ts - BullMQ integration (100%, 4 tests)
    • slices/authSlice.ts - Authentication state (100%, 7 tests)
    • slices/alphafoldPaeVizSlice.ts - AlphaFold PAE viz (100%, 16 tests)

🔄 Phase 2: Job Management Components (73% Complete)

  • 11 of 15 files tested, 256 tests total
  • High coverage on all tested files (71-100%)
  • Files:
    • features/jobs/JobDBDisplayProperties.ts (100%, 16 tests)
    • features/jobs/JobSuccessAlert.tsx (100%, 17 tests)
    • features/jobs/JobError.tsx (100%, 11 tests)
    • features/jobs/JobDetails.tsx (100%, 14 tests)
    • features/jobs/BilboMDStep.tsx (100%, 39 tests)
    • features/jobs/NewJobFormInstructions.tsx (100%, 21 tests)
    • features/jobs/BilboMDNerscStep.tsx (71.87%, 41 tests)
    • features/jobs/BilboMDMongoSteps.tsx (100%, 18 tests)
    • features/jobs/BilboMDNerscSteps.tsx (100%, 20 tests)
    • features/jobs/JobActionsMenu.tsx (100%, 39 tests)
    • features/jobs/FoXSAnalysis.tsx (94.28%, 20 tests)

Test Coverage Highlights

  • RTK Query testing: Comprehensive coverage of API slices, polling, error handling, token refresh
  • React component testing: User interactions, conditional rendering, Material-UI components
  • Complex data transformations: FoXS data processing, residual calculations, ensemble analysis
  • NERSC workflow testing: Step filtering, job type handling, friendly name mappings
  • State management: Redux slices, selectors, actions

Testing Patterns Established

  • Vitest + React Testing Library for all tests
  • MSW for API mocking
  • Comprehensive test utilities in test/test-utils.tsx
  • User event testing for interactions
  • Accessibility-focused queries
  • Type-safe test data

Remaining Work

Phase 2 (4 files remaining):

  • SingleJobPage.tsx
  • NewJobForm.tsx
  • ResubmitJobForm.tsx
  • PipelineSchematic.tsx

Future Phases:

  • Phase 3: Validation Schemas (5 files)
  • Phase 4: Authentication & Authorization (7 files)
  • Phase 5: Admin & Queue Management (5 files)
  • Phase 6+: Additional components

Verification

  • ✅ All 299 tests passing
  • ✅ Lint passing
  • ✅ Build successful
  • ✅ TypeScript type checking passed

Notes

Progress is tracked in TEST-COVERAGE-PROGRESS.md. Each phase has dedicated changesets for proper version management.

🤖 Generated with Claude Code

dsclassen and others added 6 commits February 12, 2026 10:05
Add comprehensive test coverage for API slices and state management:
- apiSlice.ts: Main API slice with base query and reauth logic (95.65% coverage)
- sfapiSlice.ts: Superfacility API slice (100% coverage)
- bullmqApiSlice.ts: BullMQ integration (100% coverage)
- authSlice.ts: Authentication state management (100% coverage)
- alphafoldPaeVizSlice.ts: AlphaFold PAE visualization endpoints (100% coverage)

Total: 43 tests across 5 files covering critical application infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive test coverage for initial Phase 2 components:
- JobDBDisplayProperties.ts: Job type display properties (100% coverage, 16 tests)
- JobSuccessAlert.tsx: Job success notification component (100% coverage, 17 tests)
- JobError.tsx: Job error display with async log fetching (100% coverage, 11 tests)

Total: 44 new tests covering core job management functionality including
data structures, UI components, navigation, and async data fetching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive test coverage for additional Phase 2 components:
- JobDetails.tsx: Job details navigation button (100% coverage, 14 tests)
- BilboMDStep.tsx: Pipeline step status chips with tooltips (100% coverage, 39 tests)
- NewJobFormInstructions.tsx: Accordion instructions component (100% coverage, 21 tests)

Total: 74 tests covering navigation, step visualization, user interactions,
accessibility features, and comprehensive documentation display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive test coverage for 5 more job management components:
- JobActionsMenu: 39 tests, 100% coverage (menu actions, conditional enabling)
- FoXSAnalysis: 20 tests, 94.28% coverage (data fetching, transformations, rendering)
- BilboMDNerscSteps: 20 tests, 100% coverage (step filtering, ordering, job types)
- BilboMDMongoSteps: 18 tests, 100% coverage (step display, Scoper detection)
- BilboMDNerscStep: 41 tests, 71.87% coverage (friendly names, tooltips, icons)

Phase 2 progress: 11 of 15 files complete (256 total tests)
Remaining: SingleJobPage, NewJobForm, ResubmitJobForm, PipelineSchematic

All tests passing, lint and build verified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: dc61596

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bilbomd/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dsclassen dsclassen merged commit 0b7440c into main Feb 12, 2026
15 checks passed
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.

1 participant