aglinxinyuan opened a new pull request, #7407:
URL: https://github.com/apache/texera/pull/7407
### What changes were proposed in this PR?
The version list keeps its display rules in the template, and the spec never
rendered it — the existing tests drive `collapse()` and
`getDisplayedVersionId()` directly. The template was at roughly **4%** of
statements locally.
The rule worth pinning is the row predicate:
```html
<tr *ngIf="(!row.importance && row.expand) || row.importance">
```
A minor version stays folded away until its important parent is expanded —
that is the whole point of the collapse, and it exists only in the template.
Adds 9 tests: that predicate in both directions, the descending version
numbering, the `selected-row` highlight, the expand control appearing only on
important versions, the three arguments the timestamp button passes to
`getVersion`, the date format, the column headings, and the table being absent
until versions load.
**Verified by mutation**, all reverted (template diff empty):
| Mutation | Result |
|---|---|
| make the row predicate always true | red |
| drop `expand` from the predicate | red |
| key `selected-row` off the row count instead of the index | red |
| number versions by index instead of count − index | red |
| hand `getVersion` a fixed index | red |
| show the expand control on every row | red |
| change the date format | red |
| render the table before versions load | red |
Local coverage for the component directory: **~4% → 96.55%** of statements.
The spec was already set up for this — it deliberately skips
`detectChanges()` in `beforeEach` and notes that tests needing the rendered
template should call it locally.
One gotcha worth recording: `nz-table` renders its own expand-icon
`<button>`, so `querySelector("button")` finds that rather than the version
link. The tests select `button.version-link`.
No production file is touched.
### Any related issues, documentation, discussions?
Closes #7404
### How was this PR tested?
```
npx ng test --watch=false --include="**/versions-list.component.spec.ts"
```
```
Test Files 1 passed (1)
Tests 20 passed (20)
```
9 new on top of the existing 11. `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]