Yicong-Huang commented on code in PR #6834:
URL: https://github.com/apache/texera/pull/6834#discussion_r3691031088
##########
frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts:
##########
@@ -288,6 +294,72 @@ describe("ListItemComponent", () => {
expect(createSpy).not.toHaveBeenCalled();
});
+ describe("read-only entries cannot edit the description (#3497)", () => {
+ // `editable` only means "private dashboard view" and is hardcoded true
by the
+ // container, so the row itself must consult the entry's access level.
+ const makeEntry = (accessLevel: string) =>
+ ({
+ id: 1,
+ name: "wf",
+ description: "old",
+ type: "workflow",
+ accessLevel,
+ workflow: { isOwner: accessLevel === "WRITE", accessLevel },
+ accessibleUserIds: [],
+ likeCount: 0,
+ viewCount: 0,
+ isLiked: false,
+ size: 0,
+ }) as unknown as DashboardEntry;
+
+ const stubModal = () =>
+ vi
+ .spyOn(modalService, "create")
+ .mockReturnValue({
+ componentInstance: { descriptionChange: new Subject<string>() },
+ destroy: vi.fn(),
+ } as any);
Review Comment:
This new `stubModal` chain trips Prettier (`format:ci`), which is why `build
/ frontend` fails on all three OSes — a formatting slip, not a failing test.
Prettier collapses the `vi.spyOn(...).mockReturnValue({…})` chain; `yarn --cwd
frontend format` applies exactly this:
```suggestion
vi.spyOn(modalService, "create").mockReturnValue({
componentInstance: { descriptionChange: new Subject<string>() },
destroy: vi.fn(),
} as any);
```
--
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]