You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by gi...@apache.org on 2026/07/22 19:19:51 UTC
(texera) branch gh-readonly-queue/main/pr-6758-bab1fb254a5c9055fc1fdb5dfeff768d150f4eaa created (now e2abda237b)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-6758-bab1fb254a5c9055fc1fdb5dfeff768d150f4eaa
in repository https://gitbox.apache.org/repos/asf/texera.git
at e2abda237b test(frontend): cover DatasetDetailComponent upload-status, version-node selection, and trackByTask (#6758)
This branch includes the following new commits:
new e2abda237b test(frontend): cover DatasetDetailComponent upload-status, version-node selection, and trackByTask (#6758)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(texera) 01/01: test(frontend): cover DatasetDetailComponent upload-status, version-node selection, and trackByTask (#6758)
Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-6758-bab1fb254a5c9055fc1fdb5dfeff768d150f4eaa
in repository https://gitbox.apache.org/repos/asf/texera.git
commit e2abda237bdfd51ce2989cec1cc892add2a2003e
Author: Meng Wang <me...@uci.edu>
AuthorDate: Wed Jul 22 12:19:31 2026 -0700
test(frontend): cover DatasetDetailComponent upload-status, version-node selection, and trackByTask (#6758)
### What changes were proposed in this PR?
Extends the existing `DatasetDetailComponent` spec to cover a few
untested
methods
(`frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.ts`).
> Note: most of the methods the issue lists are already covered by the
existing
> spec. `removeFromPendingQueue` / `refreshPendingChanges` are `private`
and are
> exercised indirectly through the upload/handler flows, so this PR
focuses on
> the remaining public gaps.
3 tests cover:
- `getUploadStatus` — maps the multipart upload status to a progress
state (`active` / `exception` / `success`).
- `onVersionFileTreeNodeSelected` — loads the selected node's content.
- `trackByTask` — returns the task's file path.
No production code was changed.
### Any related issues, documentation, discussions?
Closes #6747
### How was this PR tested?
Extended 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/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts
# Test Files 1 passed (1) | Tests 63 passed (63)
prettier --write <spec> # clean
eslint <spec> # clean
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])
Co-authored-by: Xinyuan Lin <xi...@uci.edu>
---
.../dataset-detail.component.spec.ts | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts
index f5ebba48ac..91d8acce94 100644
--- a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts
+++ b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts
@@ -1008,4 +1008,32 @@ describe("DatasetDetailComponent behavior", () => {
expect(notificationServiceStub.error).toHaveBeenCalledWith("Failed to copy file path");
});
});
+
+ describe("upload status, version-node selection, and trackBy", () => {
+ it("getUploadStatus maps the upload status to a progress state", () => {
+ expect(component.getUploadStatus("uploading")).toBe("active");
+ expect(component.getUploadStatus("initializing")).toBe("active");
+ expect(component.getUploadStatus("aborted")).toBe("exception");
+ expect(component.getUploadStatus("failed")).toBe("exception");
+ expect(component.getUploadStatus("finished")).toBe("success");
+ });
+
+ it("onVersionFileTreeNodeSelected loads the selected node's content", () => {
+ const node = { name: "file.csv", type: "file" } as unknown as Parameters<
+ typeof component.onVersionFileTreeNodeSelected
+ >[0];
+ const loadSpy = vi
+ .spyOn(component as unknown as { loadFileContent: (n: unknown) => void }, "loadFileContent")
+ .mockImplementation(() => {});
+
+ component.onVersionFileTreeNodeSelected(node);
+
+ expect(loadSpy).toHaveBeenCalledWith(node);
+ });
+
+ it("trackByTask returns the task's file path", () => {
+ const task = { filePath: "owner/data/file.csv" } as unknown as Parameters<typeof component.trackByTask>[1];
+ expect(component.trackByTask(0, task)).toBe("owner/data/file.csv");
+ });
+ });
});