aglinxinyuan opened a new pull request, #6564:
URL: https://github.com/apache/texera/pull/6564

   ### What changes were proposed in this PR?
   
   Adds a Vitest unit spec for `UserProjectSectionComponent`, which previously 
had no test coverage. The 16 tests cover:
   - `ngOnInit` URL-segment handling: 2-segment load path (sets `pid`, loads 
metadata, refreshes files), non-2-segment no-op, and the empty second-segment 
guard.
   - `getUserProjectFilesArray` (falsy → `[]` vs returning the service array).
   - `updateProjectColor`: valid persist (asserts `colorIsBright` via the real 
`isLightColor` and `updateProjectStatus`), invalid-HEX notification, same-color 
no-op, undefined-`pid` no-op, and the service-error branch.
   - `removeProjectColor` null-color error path and success reset.
   - `getUserProjectMetadata` via `ngOnInit`: `retrieveProject` field 
population (dark hex → `colorIsBright` false) and `getProjectList` overwriting 
single-project fields on `pid` match, plus the empty-list branch.
   
   The injected `UserProjectService` is mocked while the real class is imported 
so the genuine static `isLightColor`/`isInvalidColorFormat` run. The two heavy 
child imports (ngx-markdown, `UserWorkflowComponent`) are swapped for minimal 
same-selector stubs.
   
   ### Any related issues, documentation, discussions?
   
   Closes #6561.
   
   ### How was this PR tested?
   
   `npx ng test --watch=false 
--include='**/user-project-section.component.spec.ts'` → 16/16 passing. `yarn 
format:ci` passes.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8 [1M context])


-- 
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]

Reply via email to