Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sdk): further setup for integration tests #3282

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

PaulLeCam
Copy link
Contributor

@PaulLeCam PaulLeCam commented Mar 5, 2025

Only goes through a single check for now, will add more in future PRs

issue: none

@PaulLeCam PaulLeCam requested a review from ga-reth March 5, 2025 13:55
@PaulLeCam PaulLeCam self-assigned this Mar 5, 2025
Copy link

vercel bot commented Mar 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
omni ⬜️ Ignored (Inspect) Visit Preview Mar 5, 2025 4:20pm

Copy link
Contributor

@ga-reth ga-reth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general comments:

  • noticed you're not using/extending the shared test setup stuff - was that intentional? or are you planning to refactor?
  • could be nice to pull out some of the input data to clean up the tests a bit
  • do you mind following the test name pattern as in units? or if you have a suggestion to alter it's welcomed! but would be good to add some structure

} from './test-utils.js'

test('successfully processes order from quote to filled', async () => {
const wagmiConfig = createWagmiConfig()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see createWrapper in react.ts we can lift this out / reduce duplication

@@ -0,0 +1,95 @@
import { act, render, waitFor } from '@testing-library/react'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you planning to create more specific test modules? would be good to decouple a bit

aka test quote and order in isolation, and together

})
await waitFor(() => expect(quoteHook.result.current.isSuccess).toBe(true))

const quote = quoteHook.result.current.query.data as Quote
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious, why do you need this type cast?

const quote = quoteHook.result.current.query.data as Quote
expect(quote).toEqual({
deposit: { token: ZERO_ADDRESS, amount: 2n * ETHER },
expense: { token: ZERO_ADDRESS, amount: 1994017946161515453n },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the expense values are driven by the response from the solver api, so this assertion is unstable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could instead assert the value exists, and is less than or equal to the deposit amount maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants