The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-7336-3c8e0e4fb79ae67c3b439602f4d43810fdcf872e
 has failed.
Run started by GitHub user mengw15 (triggered by mengw15).

Head commit for run:
148b40c03628114a9f6cb17a117e9feeec9a878a / Meng Wang <[email protected]>
test(frontend): extend CardItemComponent template coverage (#7336)

### What changes were proposed in this PR?

Extends `card-item.component.spec.ts` to render the
previously-unexercised half
of `card-item.component.html`. The class was already ~96% covered but
the
template sat at ~50% — the existing tests call the handlers directly
rather than
rendering the branches. This adds 8 tests that drive each template arm
through
the DOM (`detectChanges()` +
`debugElement.query(By.css(...)).triggerEventHandler(...)`):

- **Private-search mode** (workflow) — the checkbox overlay, edit-name
button, and
the Detail / Share / Copy / Download / Delete actions render and their
clicks
  reach the right handler or `@Output`; the like button is absent here.
- **Cover-image controls** (`canEditCover`) — the camera and reset
buttons render
  and wire up, and the hidden file input's `(change)` fires.
- **Name editing** — the edit button swaps the name display for the
input, and
  Enter confirms the rename.
- **Non-private mode** — the like button renders, toggles on click,
shows the
  `liked` class, and is disabled without a current user.
- **Dataset in private mode** — Download shows while Detail / Copy /
checkbox are
  hidden (per-type `*ngIf` gating).
- **Size row + cover-image error** handler.

This takes the template from ~50% to **105/106 lines (99%)**. The one
remaining
line is the `(keydown.enter)` binding on the rename input: the handler
is
exercised (the test asserts the rename fires on Enter), but the coverage
tool
does not credit that key-filtered event line. No production code was
changed.

### Any related issues, documentation, discussions?

Closes #7330.

### How was this PR tested?

`ng test --watch=false --include
src/app/dashboard/component/user/list-item/card-item/card-item.component.spec.ts`
— 72 passed. `eslint` and `prettier --check` clean. Coverage report
confirms the template at 105/106 lines. Failure path verified by
breaking an assertion (→ non-zero exit) and restoring. Per the issue's
determinism note, no `vi.useFakeTimers()` — `onEditName`'s `setTimeout`
focus never runs in the synchronous test body.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

Report URL: https://github.com/apache/texera/actions/runs/31119702553

With regards,
GitHub Actions via GitBox

Reply via email to