aglinxinyuan opened a new pull request, #7417:
URL: https://github.com/apache/texera/pull/7417
### What changes were proposed in this PR?
`UserDatasetComponent`'s spec constructs the component with `new`, so its
template had never been rendered and sat at 0%. That 0% is simply "never
mounted" — not the instrumentation problem some other templates have.
Adds 8 tests that mount it for real:
- the card/list toggle, and which button carries the `primary` highlight —
the only way the user can tell which view they are in
- the preference surviving into a freshly created component through
`localStorage`
- the view mode, `editable` and `isPrivateSearch` flags handed down to
`texera-search-results`
- `(sortMethodChange)="sortMethod = $event; search()"` — an inline statement
doing two things, where dropping either leaves the list in the previous order
- the execution-time sort options being withheld on a page whose entries
never execute
- the create button being wired
**Verified by mutation**, all reverted (production diff empty):
| Mutation | Result |
|---|---|
| pin the list button's highlight on | red |
| key the card highlight off the wrong mode | red |
| stop passing the view mode down | red |
| mark the results list read-only | red |
| turn off the private-search scope | red |
| drop `search()` from the sort handler | red |
| drop the assignment from the sort handler | red |
| offer the execution-time sort option | red |
| unwire the create button | red |
| stop persisting the view preference | red |
Three findings from getting it to run, all commented in the spec:
- `viewType` defaults to **card**, not list, and is seeded from
`localStorage` at construction — so it is cleared per test, or a view chosen by
one test leaks into the next. That persistence turned out to be worth a test of
its own.
- The sort button renders its own `<button>` into the same
`nz-space-compact`, so a positional selector picks that up first. The view
buttons are selected by their `title` attribute instead.
- ng-zorro defaults to `zh-cn` and throws `NG0701` without locale data; the
TestBed provides `{ provide: NZ_I18N, useValue: en_US }`, matching the sibling
dashboard specs.
No production file is touched.
### Any related issues, documentation, discussions?
Closes #7414
### How was this PR tested?
```
npx ng test --watch=false --include="**/user-dataset.component.spec.ts"
```
```
Test Files 1 passed (1)
Tests 26 passed (26)
```
8 new on top of the existing 18. `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]