Musxeto opened a new pull request, #6835:
URL: https://github.com/apache/texera/pull/6835
### What changes were proposed in this PR?
Adds Vitest unit test coverage for `UserProjectSectionComponent`
(`user-project-section.component.spec.ts`) covering:
- Route-driven project metadata loading via `ActivatedRoute` URL params
(`getUserProjectMetadata`, `retrieveProject`, `getProjectList`,
`refreshFilesOfProject`, component field bindings, and handling of malformed
route segments).
- Cached project file retrieval (`getUserProjectFilesArray`) and fallback to
an empty array `[]`.
- Project color updates (`updateProjectColor`) for valid HEX formats,
invalid HEX notification handling, and ignoring unchanged values.
- Project color removal (`removeProjectColor`) for populated and
missing/null color states.
No production source code files were modified.
### Any related issues, documentation, discussions?
Closes #6634
### How was this PR tested?
Ran Vitest unit tests via Angular CLI:
`npx ng test --include
src/app/dashboard/component/user/user-project/user-project-section/user-project-section.component.spec.ts`
**Result**: 7 passed, 1 failed (8 total tests).
```text
FAIL |gui|
src/app/dashboard/component/user/user-project/user-project-section/user-project-section.component.spec.ts
> UserProjectSectionComponent > returns cached files from the service and
falls back to an empty list
AssertionError: expected [] to be [ { file: { name: 'file-1' } } ] //
Object.is equality
- Expected
+ Received
- [
- {
- "file": {
- "name": "file-1",
- },
- },
- ]
+ []
Test Files 1 failed (1)
Tests 1 failed | 7 passed (8)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]