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

   ### What changes were proposed in this PR?
   
   Nine small templates and one parser service. In every case the existing 
specs drove the component's methods directly and never rendered or clicked, so 
the templates' event bindings were unexecuted — 35 tests now render them and 
assert on the DOM.
   
   | File | Before | After |
   |---|---|---|
   | `dataset-version-selector.component.html` | 5/8 | **8/8** |
   | `settings.component.html` | 22/24 | **24/24** |
   | `versions-list.component.html` | 26/28 | **28/28** |
   | `mini-map.component.html` | 23/30 | **30/30** |
   | `sort-button.component.html` | 25/32 | **32/32** |
   | `user-dataset-version-creator.component.html` | 31/37 | **37/37** |
   | `registration-request-modal.component.html` | 2 fns + 2 branches dead | 
**all covered** |
   | `dataset-selection-modal.component.html` | 34/38 | **38/38** |
   | `ui-udf-parameters-parser.service.ts` | 168/172 | **170/172** |
   
   Suite 4739 -> **4774 tests**, 201 files, all green. Globally: statements 
93.61 -> **93.74%**, branches 89.45 -> **89.66%**, functions 89.30 -> 
**89.83%**, lines 95.38 -> **95.44%**.
   
   **None of these is an instance of #7458** — no target spec uses 
`TestBed.overrideComponent`, so there was no attribution loss to recover. That 
distinction is worth recording, because six merged PRs have now applied the 
#7458 remedy and it would have been the wrong tool here.
   
   ### Verification
   
   21 mutations applied one at a time, **20 killed, 1 equivalent**, with the 
production file diffed clean after every revert and the failing test named.
   
   The bulk are true **exchanges** rather than constant substitutions, which is 
what makes them meaningful on templates where two handlers sit side by side:
   
   | Mutation | Killed by |
   |---|---|
   | exchange `onClickZoomOut()` and `onClickZoomIn()` | zooms out and in from 
their own toolbar buttons |
   | exchange the drag handlers `onDrag($event)` / `dragging = false` | pans 
the main paper…; freezes the navigator between drag start and end |
   | exchange the icon ternary legs `'global'` / `'minus'` | collapses and 
re-opens the mini-map |
   | exchange `lastSort()` and `dateSort()` | emits the sort method that 
matches the clicked row |
   | exchange `onPublicStatusChange` and `onDownloadableStatusChange` | routes 
the first switch…; routes the second switch… |
   | exchange `[(ngModel)]="affiliation"` and `"reason"` | collects what the 
user typed into each box, trimmed |
   | exchange the `isOwner ? 'OWNER' : accessPrivilege` legs | labels an owned 
dataset OWNER and a shared one by its privilege |
   | drop `&& …?.touched` from the error guard | stays quiet about an invalid 
batch size the user has not touched yet |
   | `[disabled]="!selectedPath"` -> `"!!selectedPath"` | takes the path from 
the file tree's selection in file mode |
   | parser: exchange the two `UiUdfParametersEditError` messages | refuses to 
insert into a class that has no block body at all |
   
   **The equivalent mutant** is the `readMemberPath` MemberExpression guard: it 
is redundant with the child filter two lines below, since every node reaching 
it is either a MemberExpression or an argument value carrying no direct 
`VariableName`/`PropertyName` children — so `parts` comes back empty and the 
function returns `undefined` either way. The new test still pins real 
behaviour; it just cannot distinguish that guard.
   
   **One mutation was discarded rather than counted:** `if (first || !body)` -> 
`if (first)` is a TS18047 compile error, because that guard is what narrows 
`body` to non-null. A mutation that only fails to compile proves nothing, so it 
was replaced with the message exchange above.
   
   ### Deliberately not included
   
   **`hugging-face.component.html` (rejected entirely) — a production bug, 
reported not fixed.** Its validation message is gated on 
`*ngIf="props.showError && formControl.errors"`, but `props.showError` is never 
assigned anywhere in the repo and `@ngx-formly` never populates it: `showError` 
is a getter on `FieldType`, which the sibling `common/formly/object.type.ts:23` 
and `multischema.type.ts:24` use correctly **without** the `props.` prefix. So 
`<formly-validation-message>` never renders on the Hugging Face model field. 
Covering those lines would cement the typo.
   
   **The parser's remaining six branch arms are unreachable**, verified by 
probing `@lezer/python`'s error recovery across ~20 malformed sources rather 
than by inspection: a dangling `name=` always gains a zero-width error node, so 
`!value` cannot fire; an `AssignOp` inside an `ArgList` is always immediately 
preceded by a `VariableName` (`self.x=1`, `"a"=1` and `f(1)=2` all split the 
CallExpression; `None=1` yields an error node, not an `AssignOp`); `|| 
"parameter"` only fires for `""`, which an earlier guard rejects first; `/^[ 
\t]*/` always matches so its `?? ""` is dead; and both `parts` guards are fed 
by nodes that always carry the relevant child.
   
   A stale comment was also corrected: 
`ui-udf-parameters-parser.service.spec.ts:432` claimed to drive `lineEnd()`'s 
`newline === -1` arm, but coverage showed that arm at 0 hits. It now has a test 
that really drives it — a docstring ending the file with no trailing newline.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7771
   
   ### How was this PR tested?
   
   ```
   npx ng test --watch=false
   ```
   
   ```
    Test Files  201 passed (201)
         Tests  4774 passed | 1 skipped (4775)
   ```
   
   `yarn format:ci` passes.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   


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