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/09 09:40:56 UTC

[PR] test(frontend): render the dataset explorer's toolbar and upload panel [texera]

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

   ### What changes were proposed in this PR?
   
   The dataset explorer's toolbar and upload panel are template-only, and the suite around them drives component state without asserting on what reaches the screen.
   
   Adds 14 tests. The download gating is the part that matters — both the per-file and whole-version downloads are guarded by `!isLogin || !isDownloadAllowed()`, and each half is pinned separately, since being signed in is not on its own permission to copy someone else's non-downloadable dataset.
   
   Also covered: exactly one of Maximize/Minimize showing, so the user always has a way back; the copy-path control appearing only once a file is on screen; the file size and version creation time appearing only when known; and the upload panel reporting no statistics while initializing, live speed and both timings while running, and a single total once finished or aborted.
   
   **Verified by mutation**, all reverted (template diff empty):
   
   | Mutation | Result |
   |---|---|
   | file download ignores `isLogin` | red |
   | file download ignores `isDownloadAllowed()` | red |
   | whole-version download ungated | red |
   | Maximize shown regardless of state | red |
   | Minimize shown regardless of state | red |
   | copy-path always offered | red |
   | file-size block always rendered | red |
   | creation-time row always rendered | red |
   | statistics shown while still initializing | red |
   | live figures kept after finishing | red |
   | total time shown only when finished, not when aborted | red |
   
   Two structural notes are commented in the spec, since both cost a debugging round:
   
   - `nz-tabs` only instantiates the active tab, and this toolbar lives in the second one, so nothing in it exists until that tab is selected.
   - The upload panel is gated on the separate `activeUploads` counter rather than on `uploadTasks`, and ng-zorro collapses it by default.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7432
   
   ### How was this PR tested?
   
   ```
   npx ng test --watch=false --include="**/dataset-detail.component.spec.ts"
   ```
   
   ```
    Test Files  1 passed (1)
         Tests  129 passed (129)
   ```
   
   14 new on top of the existing 115. `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 explorer's toolbar and upload panel [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7435:
URL: https://github.com/apache/texera/pull/7435#issuecomment-5230853467

   <!-- texera-reviewer-suggestion -->
   ### Automated Reviewer Suggestions
   
   Based on the `git blame` history of the changed files, we recommend the following reviewers:
   
   - **Contributors with relevant context:** `@mengw15`
     You can notify them by mentioning `@mengw15` in a comment.
   


-- 
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 explorer's toolbar and upload panel [texera]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7435:
URL: https://github.com/apache/texera/pull/7435#issuecomment-5230881410

   ## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7435?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 85.41%. Comparing base ([`3534662`](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3db63c6`](https://app.codecov.io/gh/apache/texera/commit/3db63c6cf459dc4fbc05fd18187cc1a0d29f2fb6?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    #7435      +/-   ##
   ============================================
   + Coverage     85.19%   85.41%   +0.21%     
     Complexity     4151     4151              
   ============================================
     Files          1169     1169              
     Lines         46740    46740              
     Branches       5202     5202              
   ============================================
   + Hits          39820    39922     +102     
   + Misses         5207     5106     -101     
   + Partials       1713     1712       -1     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/texera/pull/7435/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/7435/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 [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435/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 [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.88% <ø> (ø)` | | Carriedforward from [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435/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 [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435/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 [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435/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 [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `88.05% <ø> (+0.49%)` | :arrow_up: | |
   | [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7435/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 [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.51% <ø> (ø)` | | Carriedforward from [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435/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 [3534662](https://app.codecov.io/gh/apache/texera/commit/35346629ce00493927556df92fc839cb79b78dfa?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/7435?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


Re: [PR] test(frontend): render the dataset explorer's toolbar and upload panel [texera]

Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 merged PR #7435:
URL: https://github.com/apache/texera/pull/7435


-- 
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 explorer's toolbar and upload panel [texera]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7435:
URL: https://github.com/apache/texera/pull/7435#discussion_r3743353873


##########
frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts:
##########
@@ -276,6 +276,228 @@ describe("DatasetDetailComponent upload queue", () => {
     });
   });
 
+  /**
+   * The explorer's toolbar and upload panel are template-only: whether a download is offered at all,
+   * which of the maximize/minimize pair is showing, and what an in-flight upload reports. The suite
+   * around this one drives component state and never asserts on what is rendered.
+   */
+  describe("rendered explorer", () => {
+    /**
+     * Applies some state and renders the "Versions & Files" tab. nz-tabs only instantiates the
+     * active tab, and the toolbar under test lives in the second one, so it has to be selected
+     * before anything in it exists to assert on.
+     */
+    function render(setup: (c: DatasetDetailComponent) => void = () => {}): HTMLElement {
+      setup(component);
+      fixture.detectChanges();
+      const host = fixture.nativeElement as HTMLElement;
+      const tabs = Array.from(host.querySelectorAll<HTMLElement>(".ant-tabs-tab"));
+      if (tabs.length > 1 && !tabs[1].classList.contains("ant-tabs-tab-active")) {
+        tabs[1].click();
+        fixture.detectChanges();
+      }

Review Comment:
   The `render()` helper selects the "Versions & Files" tab by index (`tabs[1]`) and clicks the `.ant-tabs-tab` container. This is brittle (tab order/structure changes will silently break the tests) and differs from the existing pattern in this spec that locates the tab by its label and clicks the `.ant-tabs-tab-btn`. Consider selecting the tab by text to make the tests resilient to future tab reordering.
   
   This issue also appears on line 411 of the same file.



-- 
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