Skip to content

Commit 6f28c74

Browse files
authored
MAT-9810 owner shared sorting moved to different ticket (#61)
1 parent f474d56 commit 6f28c74

2 files changed

Lines changed: 7 additions & 28 deletions

File tree

src/components/landing/userManagement/userProfile/UserProfile.test.tsx

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ describe("UserProfile", () => {
12151215
expect(screen.queryByTestId("filter-by-CMS ID")).not.toBeInTheDocument();
12161216
});
12171217

1218-
it("uses ownerDisplayName sortInfo when sorting Shared Libraries by Owner", async () => {
1218+
it("does not make Owner sortable in Shared Libraries", async () => {
12191219
mockAdminSearchMeasures.mockResolvedValue(pageWith([ownedMeasure], 1));
12201220
mockFetchCqlLibraries
12211221
.mockResolvedValueOnce(pageWith([], 5))
@@ -1229,32 +1229,11 @@ describe("UserProfile", () => {
12291229
await screen.findByTestId("library-name-lib2-content");
12301230

12311231
mockFetchCqlLibraries.mockClear();
1232-
fireEvent.click(screen.getByRole("button", { name: "Owner" }));
1233-
1234-
await waitFor(() => {
1235-
expect(mockFetchCqlLibraries).toHaveBeenCalledWith(
1236-
"SHARED",
1237-
10,
1238-
0,
1239-
{ searchField: "", optionalSearchProperties: [] },
1240-
"ownerDisplayName,false",
1241-
expect.any(AbortSignal)
1242-
);
1243-
});
1244-
1245-
mockFetchCqlLibraries.mockClear();
1246-
fireEvent.click(screen.getByRole("button", { name: "Owner" }));
1247-
1248-
await waitFor(() => {
1249-
expect(mockFetchCqlLibraries).toHaveBeenCalledWith(
1250-
"SHARED",
1251-
10,
1252-
0,
1253-
{ searchField: "", optionalSearchProperties: [] },
1254-
"ownerDisplayName,true",
1255-
expect.any(AbortSignal)
1256-
);
1257-
});
1232+
expect(screen.getByText("Owner", { exact: true })).toBeInTheDocument();
1233+
expect(
1234+
screen.queryByRole("button", { name: "Owner" })
1235+
).not.toBeInTheDocument();
1236+
expect(mockFetchCqlLibraries).not.toHaveBeenCalled();
12581237
});
12591238

12601239
it("shows an error message when the search fails", async () => {

src/components/landing/userManagement/userProfile/UserProfile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ const UserProfile = () => {
999999
...(activeOwnership === "SHARED_LIBRARY"
10001000
? [
10011001
{
1002-
sortDescFirst: false,
1002+
enableSorting: false,
10031003
header: "Owner",
10041004
accessorKey: "ownerDisplayName",
10051005
cell: (info: any) => {

0 commit comments

Comments
 (0)