Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer committed Sep 10, 2024
1 parent 3718487 commit 77e2192
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/swap/components/SwapProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -422,15 +422,18 @@ describe('SwapProvider', () => {
},
});
});
await waitFor(() => {
expect(onStatusMock).toHaveBeenCalledWith({
statusName: 'init',
statusData: {
isMissingRequiredField: false,
maxSlippage: expect.any(Number),
},
});
}, { timeout: 3000 }); // Increase timeout if needed
await waitFor(
() => {
expect(onStatusMock).toHaveBeenCalledWith({

Check failure on line 427 in src/swap/components/SwapProvider.test.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

src/swap/components/SwapProvider.test.tsx > SwapProvider > should reset status to init when setLifeCycleStatus is called with success

AssertionError: expected "spy" to be called with arguments: [ { statusName: 'init', …(1) } ] Received: 1st spy call: Array [ Object { "statusData": Object { - "isMissingRequiredField": false, - "maxSlippage": Any<Number>, + "isMissingRequiredField": true, + "maxSlippage": 10, }, "statusName": "init", }, ] 2nd spy call: Array [ Object { "statusData": Object { - "isMissingRequiredField": false, - "maxSlippage": Any<Number>, + "receipt": Array [ + "0x123", + ], }, - "statusName": "init", + "statusName": "success", }, ] 3rd spy call: Array [ Object { "statusData": Object { "isMissingRequiredField": false, - "maxSlippage": Any<Number>, + "maxSlippage": undefined, }, "statusName": "init", }, ] Number of calls: 3 Ignored nodes: comments, script, style <html> <head /> <body> <div> <div data-testid="test-component" > <span data-testid="context-value-lifeCycleStatus-statusName" > init </span> <button type="button" > setLifeCycleStatus.error </button> <button type="button" > setLifeCycleStatus.amountChange </button> <button type="button" > setLifeCycleStatus.transactionPending </button> <button type="button" > setLifeCycleStatus.transactionApproved </button> <button type="button" > setLifeCycleStatus.success </button> <button type="submit" > Swap </button> </div> </div> </body> </html> ❯ __vi_import_2__.waitFor.timeout src/swap/components/SwapProvider.test.tsx:427:30 ❯ runWithExpensiveErrorDiagnosticsDisabled node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:118:16
statusName: 'init',
statusData: {
isMissingRequiredField: false,
maxSlippage: expect.any(Number),
},
});
},
{ timeout: 3000 },
); // Increase timeout if needed
});

it('should emit onStatus when setLifeCycleStatus is called with error', async () => {
Expand Down

0 comments on commit 77e2192

Please sign in to comment.