Yicong-Huang commented on code in PR #5151:
URL: https://github.com/apache/texera/pull/5151#discussion_r3293544800
##########
frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts:
##########
@@ -104,4 +112,66 @@ describe("ListItemComponent", () => {
expect(component.entry.description).toBe("Old Description");
expect(component.editingDescription).toBe(false);
});
+
+ describe("initializeEntry routes", () => {
+ const baseStats = { likeCount: 0, viewCount: 0, isLiked: false };
+
+ it("routes owned workflows to the user workspace", () => {
+ component.currentUid = 1;
+ component.entry = {
+ id: 100,
+ type: "workflow",
+ workflow: { isOwner: true },
+ accessibleUserIds: [1],
+ ...baseStats,
+ } as unknown as DashboardEntry;
+ component.initializeEntry();
+ expect(component.entryLink).toEqual([USER_WORKSPACE, "100"]);
+ });
+
+ it("routes non-owned workflows to the hub workflow detail page", () => {
+ component.currentUid = 1;
+ component.entry = {
+ id: 101,
+ type: "workflow",
+ workflow: { isOwner: false },
+ accessibleUserIds: [2],
+ ...baseStats,
+ } as unknown as DashboardEntry;
+ component.initializeEntry();
+ expect(component.entryLink).toEqual([HUB_WORKFLOW_RESULT_DETAIL, "101"]);
+ });
+
+ it("routes projects to the user project page", () => {
+ component.entry = { id: 200, type: "project", ...baseStats } as unknown
as DashboardEntry;
+ component.initializeEntry();
+ expect(component.entryLink).toEqual([USER_PROJECT, "200"]);
+ });
Review Comment:
let's raise a separate issue to discuss what to do with projects.
--
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]