Skip to content

add unit test coverage for UserComputingUnitListItemComponent #6389

Description

@mengw15

Task Summary

frontend/src/app/dashboard/component/user/user-computing-unit/user-computing-unit-list-item/user-computing-unit-list-item.component.ts (codecov ~9%, no spec) — add a behavior-focused Vitest spec (TestBed + detectChanges()). See frontend/TESTING.md and the user-dataset-list-item spec (#5230) for the pattern; mock ComputingUnitService, NotificationService, ComputingUnitStatusService, ComputingUnitActionsService.

Behavior to cover

  • should create — instantiates; fixture.detectChanges() renders the template
  • entry @input / unit getter — expose the bound value
  • confirmUpdateUnitName(cuid, newName):
    • invalid name (via validateName) -> notificationService.error(validationError) + cancels editing; no rename call
    • valid -> calls computingUnitService.renameComputingUnit(cuid, trimmedName); on success -> notificationService.success("Successfully renamed computing unit"), updates entry.computingUnit.name when the cuid matches, calls refreshComputingUnitList(); on error -> notificationService.error("Failed to rename computing unit: ...")
  • onClickOpenShareAccess(cuid) -> calls computingUnitActionsService.openShareAccessModal(cuid, false)
  • @Output() deleted — emits on the delete flow

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions