sefe / sefe/dorc

Add frontend unit tests for dorc-web components

Open
#595 0 comments 0 reactions 1 assignee View on GitHub

@Otar-Khokhashvili-ext-sefe is already working on this.

Since May 11, 2026.

  • #599 by @smurugan-sefe — closed without merging
enhancement
Dominant language
C#
Stars
5
Forks
3
Avg merge
1d 22h
Merged PRs (30d)
14

Description

Background

The dorc-web project has no unit test infrastructure. All UI behavior is manually tested. PR #584 added significant UI logic (source control type icons, combo-box binding, conditional field visibility) that would benefit from automated tests.

Current State

  • No test framework configured ("test": "echo no test specified")
  • Only k6 load tests exist (k6-tests/) which test API performance, not UI logic
  • page-test-component.ts exists but is a development helper, not a test

Recommended Approach

  1. Add Vitest (works with Vite out of the box) + @open-wc/testing for Lit component testing
  2. Priority components to test:
    • add-edit-project.ts — source control type combo-box binding, conditional field visibility (showSubPaths/showBuildRegex), label switching per type
    • page-projects-list.ts — source control icon renderer (AzDO/GitHub/FileShare detection), project name tooltip, search filtering
    • project-controls.ts — button visibility based on permissions
    • deploy-env.ts — build definition handling, folder project detection
  3. Test the enum string serialization edge case (API returns "FileShare" not 2)

Setup Steps

npm install -D vitest @open-wc/testing @testing-library/dom jsdom

Add to vite.config.ts:

test: {
  environment: 'jsdom',
  include: ['src/**/*.test.ts']
}

Identified during PR #584 UI development

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.