The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-7776-5f95b671d3dd73e327a15d9561c9b601394f64d5
 has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
88426b325a80a54e6a9a412452a9f549cde728b2 / Xinyuan Lin <[email protected]>
test(frontend): cover the operator label drag, computing-unit rows and menu 
clipboard (#7776)

### What changes were proposed in this PR?

Four workspace and dashboard files whose handlers and bindings were
never driven. 12 tests added; suite 4739 -> **4751**, 201 files green.

Measured from a **full-suite** run, because three of these files are
also touched by other specs and a targets-only run misreports them:

| File | Lines | Branches | Functions |
|---|---|---|---|
| `operator-label.component.ts` | 72.7% -> **100%** | 10/12 -> **12/12**
| 4/6 -> **6/6** |
| `user-computing-unit.component.html` | 81.2% -> **100%** | 2/2 | 2/4
-> **4/4** |
| `operator-menu.service.ts` | 98.0% -> **100%** | 35/36 -> **36/36** |
29/32 -> **32/32** |
| `dynamic-schema.service.ts` | 96.4% -> **98.2%** | 23/25 -> **25/25**
| 16/17 (one dead method) |

**None of these is an instance of #7458** — no spec here uses
`TestBed.overrideComponent`, which the non-zero percentages already
implied. Six merged PRs have applied that remedy; it would have been the
wrong tool here, and these were simply untested bindings.

Covered: the operator label's drag start/stop and its read-only guard,
the computing-unit toolbar and per-row terminate, the clipboard's link
and comment-box serialisation ordering and paste offsetting, and
`dynamic-schema`'s boolean-subschema skips.

The computing-unit rows sit in a CDK virtual viewport, and jsdom does no
layout — the viewport measures 0px and renders nothing. They are reached
via `viewport.setRenderedRange(...)`, following the existing precedent
in `computing-unit-create-modal.component.spec.ts`. Row deletion is
driven through the child's bound `deleted` output rather than a
library's internal emit timing.

### Verification

12 mutations, **10 killed, 1 equivalent, 2 discarded as compile
errors**. Each applied alone with its anchor asserted to occur exactly
once, and the production diff verified empty after every revert.

| Mutation | Killed by |
|---|---|
| `if (this.draggable)` -> `if (!this.draggable)` | announces the
dragged operator's type… (+1) |
| drag payload `operatorType` -> `additionalMetadata.userFriendlyName` |
announces the dragged operator's type, not its display name |
| **exchange** the drop point's x and y | forwards the drop point of a
completed drag |
| **exchange** the links comparator's operands | serializes the copied
links by joint layer rather than by highlight order |
| **exchange** the comment-box comparator's operands | serializes the
copied comment boxes by joint layer… |
| **exchange** `commentBoxPosition`'s x and y | shifts a pasted comment
box clear of one already on the canvas |
| pasted-link guard `===` -> `!==` | leaves both ends of a pasted link
blank when neither operator was copied (+1) |
| `(click)` -> `(dblclick)` on the toolbar | opens the create-unit modal
from its toolbar button |
| `[entry]="entry.computingUnit"` -> `entries[0]…` | renders one row per
computing unit, in the order the service reported them |
| `terminateComputingUnit(entry…cuid)` -> `entries[0]…cuid` | terminates
the unit belonging to the row that asked, not the first one |

**Two mutations were discarded rather than counted as kills**, because
they were TypeScript errors (TS2345 and TS2559) rather than behaviour
changes — a mutation that only fails to compile proves nothing. Both
were replaced: one by deleting the guard outright (with a cast to keep
it compiling), one by inverting the branch so the boolean entry is acted
on instead of skipped.

**The one survivor is a genuine equivalent mutant.**
`dynamic-schema.service.ts:187`'s tuple-item guard has
`mutatePropertyRecurse(item)` as its entire body. Delete it and a
boolean primitive reaches that function, which reads `.properties`,
`.definitions` and `.items` — property access on a boolean yields
`undefined` for all three, so every branch is false and the call is a
no-op, behaviourally identical to skipping. The guard is a TypeScript
narrowing device, not a behavioural one; removing it does not even
compile without a cast. The companion mutation (inverting the branch to
act on the boolean) *is* caught, which shows the assertion is not
vacuous.

Fixtures were kept deliberately distinguishable — two units `#7` and
`#9`, a drop point of `x: 137, y: 421`, and layer order inverted against
highlight order — precisely so the "wrong element" and "swapped operand"
mutants above could not survive.

### Deliberately not included

**`user-dataset-list-item.component.html` was rejected entirely: the
component is orphaned.** Its selector `texera-user-dataset-list-item`
appears repo-wide only in its own `@Component` declaration and its own
spec's test host. The one other reference is a standalone entry in
`app.module.ts:325` with no consumer — the dataset page moved to
`texera-card-item`/`texera-search-results` in #5947. All 8 of its
uncovered template listeners belong to a component nothing renders, so
testing them would cement dead code. Deleting it is the right change,
and belongs in its own PR.

**`DynamicSchemaService.dynamicSchemaExists` is unused** — exactly one
occurrence repo-wide, its own declaration, while every sibling method
has 2 to 5 call sites. Its line is the one line left uncovered here,
deliberately.

No production bug was found, and no production file is touched.

### Any related issues, documentation, discussions?

Closes #7775

### How was this PR tested?

```
npx ng test --watch=false
```

```
 Test Files  201 passed (201)
      Tests  4751 passed | 1 skipped (4752)
```

`yarn format:ci` passes.

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

Generated-by: Claude Code (Opus 5)

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

With regards,
GitHub Actions via GitBox

Reply via email to