Skip to content

Commit 7ca6d5b

Browse files
committed
fix(test-code): adjust mutationOptions onSuccess test for React Query v5 context
1 parent affe145 commit 7ca6d5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/openapi-react-query/test/index.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,10 +815,14 @@ describe("client", () => {
815815
result.current.mutate({ body: { message: "Test", replied_at: 123456789 } });
816816

817817
await waitFor(() => expect(result.current.isSuccess).toBe(true));
818-
expect(onSuccessSpy).toHaveBeenCalledWith(
818+
expect(onSuccessSpy).toHaveBeenNthCalledWith(
819+
1,
819820
{ message: "Success" },
820821
{ body: { message: "Test", replied_at: 123456789 } },
821822
undefined,
823+
expect.objectContaining({
824+
mutationKey: ["put", "/comment"],
825+
}),
822826
);
823827
expect(onErrorSpy).not.toHaveBeenCalled();
824828
});

0 commit comments

Comments
 (0)