Repository navigation
Conversation
Automated Reviewer SuggestionsBased on the
|
❌ 5 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Pull request overview
This PR adds Vitest unit coverage for the frontend FileSaverService (a thin wrapper around file-saver), improving confidence that the service correctly delegates payloads and optional arguments.
Changes:
- Adds
file-saver.service.spec.tsto verify delegation tofile-saver’ssaveAsforBlobandstringinputs. - Adds assertions for pass-through behavior when
filenameandoptionsare omitted.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…xera into test/file-saver-service-spec
Head branch was pushed to by a user without write access
|
please fix the ci |
|
This pull request has been automatically marked as stale because it has If this PR is still relevant, please:
To exempt this PR from auto-close, a maintainer can add the |
|
This pull request has been automatically closed due to 37 days of inactivity. |
|
Reopening: this was auto-closed by the stale bot after 37 days of inactivity, not because it was resolved or superseded. The change is still relevant and its tracking issue #6448 remains open. I'd like to continue it and will rebase it onto current |
|
Reopening: auto-closed by the stale bot for inactivity, not resolved or superseded. The branch is now merged up to current main, and its tracking issue #6448 is still open. |
### What changes were proposed in this PR? - Adds a Vitest spec for `FileSaverService`, the thin wrapper whose `saveAs(data, filename?, options?)` forwards straight to the `file-saver` library's `saveAs`. - Mocks the `file-saver` library so the suite can assert the call is forwarded unchanged: a Blob payload passes through with its filename and options, and a string payload (such as a URL) passes through. - Asserts that an omitted filename and options arrive as `undefined`, and that an error thrown by the underlying `saveAs` propagates to the caller instead of being swallowed. ### Any related issues, documentation, discussions? Closes: apache#6448 Supersedes apache#6460, which the stale bot auto-closed for inactivity. The branch is now merged up to current `main`. ### How was this PR tested? - Run `cd frontend && npx ng test --include="**/file-saver.service.spec.ts" --watch=false`, expect the FileSaverService suite to pass. - Confirm the forwarding cases hold: a Blob and a string payload each reach the mocked `saveAs` unchanged, an omitted filename and options arrive as `undefined`, and a thrown error surfaces to the caller. ### Was this PR authored or co-authored using generative AI tooling? Co-authored with Claude Opus 4.8 in compliance with ASF --------- Signed-off-by: Xinyuan Lin <xinyual3@uci.edu> Co-authored-by: Xinyuan Lin <xinyual3@uci.edu> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
What changes were proposed in this PR?
Any related issues, documentation, discussions?
Closes: #6448
How was this PR tested?
cd frontend && npx nx test gui --include="**/file-saver.service.spec.ts", expect 4 passed.yarn test:ci, selected by the auto-appliedfrontendlabel.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF