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

   ### What changes were proposed in this PR?
   
   Covers the remaining lines and untaken branches in the four files. All four 
now
   report full line and branch coverage. No production code was changed.
   
   Two of the paths in the issue have moved: `CoeditorUserIconComponent` lives 
under
   `workspace/component/menu/`, and `PresetWrapperComponent` under
   `common/formly/`.
   
   **`CoeditorUserIconComponent`** (+5) — the shadowing menu had no test at all
   beyond "should create". Both arms of the compound guard now render: shadowing
   off, shadowing on for *another* co-editor (the second half flipped on its 
own),
   and shadowing on for this one. Each variant is then clicked, asserting the
   presence service receives `shadowCoeditor` / `stopShadowing`.
   
   **`UserVenvComponent`** (+5) — the `"(unnamed)"` fallback on both the confirm
   dialog and the delete notification, a record with no `packages`, a stored
   version that is nullish rather than empty (only nullish reaches `?? ""`), 
and a
   draft row whose version is null.
   
   **`FilesUploaderComponent`** (+5) — the existing suite constructs the 
component
   with `new`, so the template had never rendered (0% on the .html). A second 
block
   mounts it for real and drives the banner `*ngIf` through all four flag
   combinations, its message, its close handler, the drop-zone button and the 
drop
   handler.
   
   **`PresetWrapperComponent`** (+6) — a form control holding a value and 
holding
   `null`, `setupFieldConfig`, the `applyPresetStream` predicate with a 
matching and
   a non-matching event plus the `basePreset` assignment behind it, and the
   dropdown's own `nzVisibleChange` output.
   
   Two notes on how the DOM is driven here:
   
   - `nz-dropdown-menu` keeps its content in an ng-template that mounts into a 
CDK
     overlay only when the dropdown opens, which jsdom does not drive. Rather 
than
     assert on the bound data, the tests instantiate that template directly
     (`viewContainerRef.createEmbeddedView(templateRef)`), which puts the rows 
in
     the fixture's DOM so the `*ngFor`, the interpolations and the click 
handlers
     all really run. This replaces the data-only assertions the preset spec had 
for
     the same reason.
   - `PresetWrapperComponent`'s "does not refresh while the dropdown is closed" 
test
     never awaited the handler's `debounceTime(0)`, so it passed because the
     callback had not run yet rather than because the menu was closed — it 
could not
     fail. It now awaits the tick and also asserts the search term is still 
tracked.
   
   `ngx-file-drop` hands its `openFileSelector` to the content template by
   reference, so a spy installed after render is not seen; that test asserts the
   effect (the hidden file input is clicked) instead.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7700
   
   ### How was this PR tested?
   
   Extended unit tests, run locally in `frontend/` (all green; the failure paths
   were verified by breaking one assertion per file and confirming all four 
suites
   go red and the run exits non-zero):
   
   ```
   ng test --watch=false --include <the four specs>
   # Test Files 4 passed (4) | Tests 111 passed (111)
   prettier --write <specs>   # clean
   eslint  <specs>            # clean
   ```
   
   The coverage report was re-run over the four specs to confirm the gaps 
cleared —
   `coeditor-user-icon.component.{ts,html}`, `user-venv.component.ts`,
   `files-uploader.component.{ts,html}` and `preset-wrapper.component.{ts,html}`
   each report no unhit line and no partial branch.
   
   ### 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]

Reply via email to