Skip to content

Add component tests for ClassTree #209

Description

@aadorian

Description

Only three ontology components currently have tests (header, property-details, new-entity-dialog). ClassTree handles expand/collapse, selection, and sessionStorage persistence but is untested.

Difficulty

Easy–Medium

Skills

React Testing Library, Jest

Relevant files

  • components/ontology/class-tree.tsx
  • components/ontology/__tests__/class-tree.test.tsx (create)
  • lib/ontology/sample-data.ts — sample ontology for mocks

Tasks

  • Create components/ontology/__tests__/class-tree.test.tsx
  • Test expand/collapse toggle on nodes with children
  • Test "Expand all" and "Collapse all" toolbar buttons
  • Test clicking a class row calls selectClass
  • Mock useOntology with sample data

Acceptance Criteria

  • All new tests pass with npm test
  • No changes to production behavior required (tests only)
  • Follow patterns in existing component tests

Getting started

  1. Comment on this issue to get assigned
  2. Fork the repo and create a branch: test/class-tree
  3. Run npm ci && npm test before opening a PR

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions