rainbowkit icon indicating copy to clipboard operation
rainbowkit copied to clipboard

test: cover default config and wallet hooks

Open DanielSinclair opened this issue 10 months ago • 2 comments

Summary

  • add tests for getDefaultWallets
  • add tests for getDefaultConfig
  • add tests for useWalletConnectors

Testing

  • pnpm lint
  • pnpm test

https://chatgpt.com/codex/tasks/task_e_6851b442262c83259cc0222f42a5fd9d


PR-Codex overview

This PR focuses on adding unit tests for various wallet-related functionalities in the rainbowkit package, including getDefaultWallets, getDefaultConfig, and useWalletConnectors, while also making some adjustments to the test setup.

Detailed summary

  • Added unit tests for getDefaultWallets in packages/rainbowkit/src/wallets/getDefaultWallets.test.ts.
  • Added unit tests for getDefaultConfig in packages/rainbowkit/src/config/getDefaultConfig.test.ts.
  • Added unit tests for useWalletConnectors in packages/rainbowkit/src/wallets/useWalletConnectors.test.tsx.
  • Updated getDefaultWallets to return ReturnType<typeof connectorsForWallets> for connectors.
  • Modified the setup.ts file to include beforeAll and afterAll for silencing logs during tests.
  • Adjusted WalletButton.test.tsx to simplify error handling and improve test readability.
  • Updated MobileOptions.test.tsx to define failingWallet using type assertion.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

DanielSinclair avatar Jun 17 '25 18:06 DanielSinclair

🦋 Changeset detected

Latest commit: 21c27fb898b14f5aa75a7960605c7a29107be986

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@rainbow-me/rainbowkit Patch
example Patch
@rainbow-me/rainbow-button Patch
rainbowkit-next-app Patch
site Patch
with-create-react-app Patch
with-next-app-i18n Patch
with-next-app Patch
with-next-custom-button Patch
with-next-mint-nft Patch
with-next-siwe-iron-session Patch
with-next-siwe-next-auth Patch
with-next-wallet-button Patch
with-next Patch
with-react-router Patch
with-remix Patch
with-vite Patch
with-next-rainbow-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jun 17 '25 18:06 changeset-bot[bot]

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

Name Status Preview Comments Updated (UTC)
rainbowkit-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2025 9:07pm
rainbowkit-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2025 9:07pm

vercel[bot] avatar Jun 17 '25 18:06 vercel[bot]