Skip to content

Integration tests - TreeDataProvider + VSCode API (90% coverage) #56

Description

@johnproblems

Task: Integration tests - TreeDataProvider + VSCode API (90% coverage)

Description

Create integration tests for the TreeDataProvider that validate the complete Epic/Task hierarchy rendering in the VSCode tree view. Test the interaction between TreeDataProvider, TreeItem nodes, and VSCode's tree view APIs with 90% minimum coverage.

Acceptance Criteria

  • Tests verify TreeDataProvider getChildren() returns correct hierarchy
  • Tests validate TreeItem creation for Epic and Task nodes
  • Tests check tree view registration and lifecycle
  • Tests verify refresh behavior and onDidChangeTreeData events
  • Tests validate tree expansion and collapse states
  • Tests check context menu command availability
  • Code coverage reaches minimum 90% (lines, branches, functions)
  • All tests pass consistently

Technical Details

  • Create test file: test/integration/treeview/treeDataProvider.test.ts
  • Test scenarios:
    • Tree view registration with VSCode window API
    • getChildren() with null (root), Epic node, Task node
    • getTreeItem() returns properly configured TreeItem
    • Epic nodes have correct collapsible state
    • Task nodes have click commands configured
    • Tree refresh triggers onDidChangeTreeData
    • Empty epic handling (no tasks)
    • Invalid file path handling
    • Tree view reveal() functionality
  • Use @vscode/test-electron for VSCode API integration
  • Create test fixtures: sample epic/task files
  • Test with actual VSCode tree view rendering
  • Mock file system with test data
  • Files affected: test/integration/treeview/*.test.ts (new)

Dependencies

  • Task 13 - TreeDataProvider implementation completed
  • Task 14 - TreeItem classes implemented
  • Task 3 - Testing infrastructure configured

Effort Estimate

  • Size: M
  • Hours: 8
  • Parallel: true

Definition of Done

  • Code implemented
  • Tests written and passing
  • Documentation updated
  • Code reviewed
  • Coverage report shows 90%+ coverage
  • Integration with VSCode API validated

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions