Skip to content

Integration tests - Progress panel + webview (90% coverage) #57

@johnproblems

Description

@johnproblems

Task: Integration tests - Progress panel + webview (90% coverage)

Description

Create integration tests for the webview progress panel that displays task details and progress notes. Test webview lifecycle, message passing, content rendering, and interaction with the extension host with 90% minimum coverage.

Acceptance Criteria

  • Tests verify webview panel creation and lifecycle
  • Tests validate message passing between extension and webview
  • Tests check webview HTML content rendering
  • Tests verify webview state persistence (retainContextWhenHidden)
  • Tests validate progress note loading and display
  • Tests check webview disposal and cleanup
  • Code coverage reaches minimum 90% (lines, branches, functions)
  • All tests pass consistently

Technical Details

  • Create test file: test/integration/webview/progressPanel.test.ts
  • Test scenarios:
    • Webview panel creation with correct configuration
    • Singleton pattern (createOrShow reuses existing panel)
    • Message posting from extension to webview
    • Message receiving from webview to extension
    • HTML content injection with CSP headers
    • Local resource loading (scripts, styles)
    • Panel reveal in correct editor column
    • Panel disposal on close
    • State retention when hidden
    • Progress note markdown rendering
    • Task metadata display
    • GitHub sync status indicators
  • Use @vscode/test-electron for webview API testing
  • Mock webview.postMessage and onDidReceiveMessage
  • Create test HTML fixtures
  • Test with actual webview rendering
  • Files affected: test/integration/webview/*.test.ts (new)

Dependencies

  • Task 20 - Webview panel provider implemented
  • Task 21 - Webview HTML template implemented
  • Task 22 - Progress note renderer implemented
  • Task 23 - Webview message handling implemented
  • Task 3 - Testing infrastructure configured

Effort Estimate

  • Size: L
  • Hours: 10
  • Parallel: true

Definition of Done

  • Code implemented
  • Tests written and passing
  • Documentation updated
  • Code reviewed
  • Coverage report shows 90%+ coverage
  • Webview integration fully tested

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions