mengw15 opened a new pull request, #6509:
URL: https://github.com/apache/texera/pull/6509
### What changes were proposed in this PR?
Adds a behavior-focused Vitest spec for `ResultExportationComponent`
(`frontend/src/app/workspace/component/result-exportation/result-exportation.component.ts`),
which previously had no dedicated spec (codecov ~6%). It is the ng-zorro
modal
that drives result export to a dataset or a local download.
5 tests, using `TestBed` with all seven collaborators stubbed and
`NZ_MODAL_DATA` / `NzModalRef` provided (no backend, no real modal):
- **creation** — the component instantiates and `detectChanges()` renders.
- **`ngOnInit`** — keeps only `WRITE`-accessible datasets, stores the
downloadability result, and picks up the selected computing unit.
- **`onClickExportResult("dataset", ds)`** — calls the export service with
the
dataset destination and the resolved dataset id, then closes the modal.
- **`onClickExportResult("local")`** — calls the export service with the
local
destination and no dataset ids, then closes the modal.
- **`onClickCreateNewDataset()`** — opens the dataset-creator modal
(`UserDatasetVersionCreatorComponent`) and adopts the dataset returned on
close.
No production code was changed.
### Any related issues, documentation, discussions?
Closes #6504
### How was this PR tested?
New unit tests, run locally in `frontend/` (all green; the failure path was
verified by breaking an assertion to confirm the suite goes red):
```
ng test --watch=false --include
src/app/workspace/component/result-exportation/result-exportation.component.spec.ts
# Tests 5 passed (5)
eslint <spec> # clean
prettier --check # clean
```
### 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]