Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer committed Sep 10, 2024
1 parent 6d551ad commit d9a8744
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/swap/components/SwapProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ vi.mock('wagmi', async (importOriginal) => {
};
});

vi.mock('../path/to/maxSlippageModule', () => ({
getMaxSlippage: vi.fn().mockReturnValue(10),
}));

const queryClient = new QueryClient();

const config = createConfig({
Expand Down Expand Up @@ -410,12 +414,15 @@ describe('SwapProvider', () => {
});
const button = screen.getByText('setLifeCycleStatus.success');
fireEvent.click(button);
expect(onStatusMock).toHaveBeenCalledWith({
statusName: 'init',
statusData: {
isMissingRequiredField: false,
maxSlippage: 10,
},
await waitFor(() => {
expect(onStatusMock).toHaveBeenCalledWith(
expect.objectContaining({
statusName: 'init',
statusData: expect.objectContaining({
isMissingRequiredField: false,
}),
}),
);
});
});

Expand Down

0 comments on commit d9a8744

Please sign in to comment.