mengw15 opened a new pull request, #7884:
URL: https://github.com/apache/texera/pull/7884
### What changes were proposed in this PR?
The spec fed the component one workflow entry; the component dispatches on
`entry.type` in
half a dozen places. 18 new tests hand it the other kinds, taking
`list-item.component.ts` to
**177/177 statements** (from 147/177) and its branches from 68/110 to 95/110.
- **The required-input guard** — reading `entry` before one is supplied
throws.
- **Icon dispatch** — `project` for a workflow, `database` for a dataset,
`folder-open` for a
file, the `Unexpected type in DashboardEntry.` throw for a kind the chain
does not know, and
a dataset without a numeric id, which is left unrouted.
- **`renderMarkdownPreview`** — an absent description, a whitespace-only
one, and a real one
reduced to plain text, so both the `??` fallback and the empty-guard arm
run.
- **Share access** — the workflow and dataset dialogs assert their own
configuration, the
modal's `refresh` is re-emitted through the component's own output, and an
entry kind that
cannot be shared opens nothing.
- **Download** — workflow by id and name, dataset by id and name, and the
early exit for an
entry that was never persisted.
- **Editing** — entering name-edit mode with and without the view child
present (the focus
callback is invoked directly rather than waited on), the missing-id
rejection, the per-kind
default name when a rename is blank, an absent description treated as
empty, and a dataset
description routed to the dataset service.
- **`ngOnChanges`** with a change that is not the entry, which must not
re-initialise.
Each test builds its own entry — several handlers mutate it in place, so a
shared fixture
would leak a rename into a later assertion. `vi.restoreAllMocks()` runs in
the block's own
`afterEach`. No assertions on layout or geometry, and no project-type
entries, so #7463 does
not disturb this.
No production code was changed.
### The 15 branch lines left
They are the remaining `else if` type arms and `??` fallbacks in the
like/view counters
(`toggleLike`, `openDetailModal`'s count refresh) — reachable, but each
needs another
hub-service response shape rather than another entry kind, which is a
different seam from the
dispatch this issue is about. Statements are complete, so nothing is
unexercised; these are the
unlit halves of value-level guards.
### Any related issues, documentation, discussions?
Closes #7880.
### How was this PR tested?
`ng test --watch=false --include
src/app/dashboard/component/user/list-item/list-item.component.spec.ts`
— 38 passed (20 existing + 18 new), run 3x for determinism. Coverage
(`--coverage`) gives the
numbers above. The failure path was verified by breaking an assertion (red,
non-zero exit) and
restoring it. `yarn --cwd frontend format:ci`, the repo's own lint step, is
clean.
### 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]