You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/08/08 01:06:53 UTC
[PR] test(frontend): render the dataset file preview's viewer branches [texera]
aglinxinyuan opened a new pull request, #7406:
URL: https://github.com/apache/texera/pull/7406
### What changes were proposed in this PR?
The file renderer's class was already at 91% locally, but its template was at **25%** of statements. The template is a viewer switch — each `displayX` flag selects exactly one preview — and only the CSV path had ever been rendered.
Adds 16 tests that drive each viewer and assert what actually reaches the screen: the four status alerts (each excluding the others), the shared table for CSV and spreadsheets, image plus the click that opens the full-size modal, video, audio, markdown, JSON, plain text, the empty initial state, and the maximized height.
It also pins the `&& safeFileURL` guards on the media branches. Those are load-bearing: the flag is set as soon as the MIME type is known while the object URL is built asynchronously, so rendering on the flag alone emits a source-less `<img>`/`<video>`/`<audio>`.
**Verified by mutation**, all reverted (template diff empty):
| Mutation | Result |
|---|---|
| drop the `&& safeFileURL` guard on the video branch | red |
| drop the same guard on the image branch | red |
| key the markdown branch off `displayJson` | red |
| remove the image's click handler | red |
| drop `displayXlsx` from the table guard | red |
| reword the too-large message | red |
| use 100% height when not maximized | red |
Local coverage for the component directory: **68.34% → 93.57%** of statements.
Three details are commented in the spec, each of which cost a debugging round:
- The first `detectChanges()` runs `ngOnInit`, which inspects the empty `filePath` and settles on "preview unsupported"; flags set beforehand are silently overwritten. The helper clears state via the component's own `turnOffAllDisplay()` afterwards.
- Binding `[src]` makes Angular call `DomSanitizer.sanitize`, which the existing stub does not provide, so the new block supplies its own.
- `<markdown>` needs `MarkdownModule.forRoot()`, following `agent-chat.component.spec.ts`.
No production file is touched.
### Any related issues, documentation, discussions?
Closes #7403
### How was this PR tested?
```
npx ng test --watch=false --include="**/user-dataset-file-renderer.component.spec.ts"
```
```
Test Files 1 passed (1)
Tests 48 passed (48)
```
16 new on top of the existing 32. `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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(frontend): render the dataset file preview's viewer branches [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7406:
URL: https://github.com/apache/texera/pull/7406#issuecomment-5223752419
<!-- texera-reviewer-suggestion -->
### Automated Reviewer Suggestions
Based on the `git blame` history of the changed files, we recommend the following reviewers:
- No candidates found from `git blame` history.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(frontend): render the dataset file preview's viewer branches [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #7406:
URL: https://github.com/apache/texera/pull/7406
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(frontend): render the dataset file preview's viewer branches [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7406:
URL: https://github.com/apache/texera/pull/7406#issuecomment-5223784604
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7406?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 84.78%. Comparing base ([`389db60`](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`f545a57`](https://app.codecov.io/gh/apache/texera/commit/f545a57d8224ac7e319773b03a39bb54d6fea70e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 3 commits behind head on main.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #7406 +/- ##
============================================
+ Coverage 84.70% 84.78% +0.07%
Complexity 4151 4151
============================================
Files 1169 1169
Lines 46740 46740
Branches 5202 5202
============================================
+ Hits 39591 39627 +36
+ Misses 5433 5401 -32
+ Partials 1716 1712 -4
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.00% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `85.50% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.85% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `50.72% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.97% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.05% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.63% <ø> (+0.17%)` | :arrow_up: | |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.89% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.55% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/7406/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.31% <ø> (ø)` | | Carriedforward from [389db60](https://app.codecov.io/gh/apache/texera/commit/389db604ae6dcccc498eb530afaaad98f9228f77?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/7406?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org