Skip to content

Unit tests for the webview views (Vitest) #127

Description

@CatarinaGamboa

Why: client/src/webview/views/** is where most recent UI changes land. These functions take diagnostics or context data and return HTML, with no vscode import, so they can be tested in milliseconds without starting VS Code.

What:

  • Add Vitest (src/**/*.spec.ts, excluded from the extension build).
  • Build HTML from sample data, parse it (jsdom), and check the elements rather than comparing whole HTML strings.
  • First cases: the diagnostics heading and file/workspace counts, errors vs warnings, the hidden-errors indicator, the passed-verification state, and the context view sections.
  • Add vitest run to test.yml.

References:

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

    testingTesting related

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions