Add frontend unit tests for dorc-web components
Open
@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.tsexists but is a development helper, not a test
Recommended Approach
- Add Vitest (works with Vite out of the box) +
@open-wc/testingfor Lit component testing - Priority components to test:
add-edit-project.ts— source control type combo-box binding, conditional field visibility (showSubPaths/showBuildRegex), label switching per typepage-projects-list.ts— source control icon renderer (AzDO/GitHub/FileShare detection), project name tooltip, search filteringproject-controls.ts— button visibility based on permissionsdeploy-env.ts— build definition handling, folder project detection
- Test the enum string serialization edge case (API returns
"FileShare"not2)
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.