Skip to content

Improve Test Coverage (Currently 38.82%) #177

@aadorian

Description

@aadorian

Summary

Running npm run test:coverage shows the project has 38.82% overall test coverage. All 224 tests pass, but many files lack test coverage.

Current Coverage Statistics

Metric Coverage
Statements 38.82%
Branches 79.18%
Functions 65%
Lines 38.82%

Test Results: 10 suites, 224 tests passing ✅

Files with 0% Coverage (Need Tests)

App Layer

  • app/layout.tsx (lines 1-47)
  • app/page.tsx (lines 1-73)

Components - Ontology

File Lines
class-details.tsx 1-530
class-tree.tsx 1-137
details-panel.tsx 1-28
global-search.tsx 1-233
graph-view.tsx 1-740
import-export-dialog.tsx 1-344
individual-details.tsx 1-290
individual-list.tsx 1-156
ontology-stats.tsx 1-134
property-details.tsx 1-318
property-list.tsx 1-145
reasoner-dialog.tsx 1-259
sparql-query.tsx 1-403
tabs-navigation.tsx 1-36

Components - UI

File Lines
card.tsx 1-75
checkbox.tsx 1-29
item.tsx 1-162
scroll-area.tsx 1-56
table.tsx 1-91
tabs.tsx 1-54
toast.tsx 1-124
toaster.tsx 1-29

Hooks

  • copy-to-clipboard.ts (1-19)
  • use-toast.ts (1-198)

Lib

  • constants.ts (1-59)
  • lib/ontology/types.ts (1-90)

Files with Good Coverage (100%)

  • components/ontology/header.tsx
  • components/ui/button.tsx
  • components/ui/input.tsx
  • components/ui/label.tsx
  • components/ui/textarea.tsx
  • lib/utils.ts
  • lib/ontology/sample-data.ts
  • lib/ontology/search.ts

Suggested Priorities

High Priority (Core Business Logic)

  1. lib/ontology/serializers.tsx - Currently 78.81%, increase to 90%+
  2. lib/ontology/context.tsx - Currently 87.63%, increase to 95%+
  3. lib/ontology/sparql.ts - Currently 89.71%, increase to 95%+

Medium Priority (User-Facing Components)

  1. components/ontology/class-details.tsx - 0% → 70%+
  2. components/ontology/graph-view.tsx - 0% → 70%+
  3. components/ontology/sparql-query.tsx - 0% → 70%+
  4. components/ontology/import-export-dialog.tsx - 0% → 70%+

Lower Priority (UI Components)

  1. UI components in components/ui/ - Basic rendering tests

Coverage Goal

Aim for 70% overall coverage as a reasonable target for this project.

Reproduction

npm run test:coverage

🤖 Generated with Claude Code

Metadata

Metadata

Labels

No labels
No labels

Projects

Status
To triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions