update deprecated toBeCalledWith -> toHaveBeenCalledWith

This commit is contained in:
Min RK
2025-08-05 13:02:31 -07:00
parent 1fe10713fd
commit 370c649d61
2 changed files with 6 additions and 6 deletions

View File

@@ -139,7 +139,7 @@ test("Interacting with PaginationFooter causes page refresh", async () => {
render(groupsJsx(updateGroupsSpy));
});
expect(updateGroupsSpy).toBeCalledWith(0, 2);
expect(updateGroupsSpy).toHaveBeenCalledWith(0, 2);
var lastState =
mockReducers.mock.results[mockReducers.mock.results.length - 1].value;
@@ -153,5 +153,5 @@ test("Interacting with PaginationFooter causes page refresh", async () => {
});
expect(searchParams.get("offset")).toEqual("2");
// FIXME: useSelector mocks prevent updateGroups from being called
// expect(updateGroupsSpy).toBeCalledWith(2, 2);
// expect(updateGroupsSpy).toHaveBeenCalledWith(2, 2);
});

View File

@@ -591,14 +591,14 @@ test("Search for user calls updateUsers with name filter", async () => {
expect(searchParams.get("offset")).toEqual(null);
// FIXME: useSelector mocks prevent updateUsers from being called
// expect(mockUpdateUsers.mock.calls).toHaveLength(2);
// expect(mockUpdateUsers).toBeCalledWith(0, 100, "a");
// expect(mockUpdateUsers).toHaveBeenCalledWith(0, 100, "a");
await user.type(search, "b");
expect(search.value).toEqual("ab");
await act(async () => {
jest.runAllTimers();
});
expect(searchParams.get("name_filter")).toEqual("ab");
// expect(mockUpdateUsers).toBeCalledWith(0, 100, "ab");
// expect(mockUpdateUsers).toHaveBeenCalledWith(0, 100, "ab");
});
test("Interacting with PaginationFooter requests page update", async () => {
@@ -606,7 +606,7 @@ test("Interacting with PaginationFooter requests page update", async () => {
render(serverDashboardJsx());
});
expect(mockUpdateUsers).toBeCalledWith(defaultUpdateUsersParams);
expect(mockUpdateUsers).toHaveBeenCalledWith(defaultUpdateUsersParams);
var n = 3;
expect(searchParams.get("offset")).toEqual(null);
@@ -619,7 +619,7 @@ test("Interacting with PaginationFooter requests page update", async () => {
});
expect(searchParams.get("offset")).toEqual("2");
// FIXME: useSelector mocks prevent updateUsers from being called
// expect(mockUpdateUsers).toBeCalledWith({
// expect(mockUpdateUsers).toHaveBeenCalledWith({
// ...defaultUpdateUsersParams,
// offset: 2,
// });