Skip to content

Commit

Permalink
test: chain modal component unit tests (#1370)
Browse files Browse the repository at this point in the history
* chore: upgrade vitest and @vanilla-extract/vite-plugin

* chore: upgrade @types/react-dom and @types/react

* chore: upgrade vitest in rainbowkit package

* example: upgrade testing frameworks in CRA

* chore: add jsdom and @testing-library/react

* chore: add @testing-library/dom,  @testing-library/react, @testing-library/user-event

* fix: update vitest config

* feat: rainbowkit package jest-dom config

* test: renderWithProviders helper

* test: ChainModal component test

* chore: upgrade wagmi, @wagmi/core

* revert: diff chains test

* fix: added alchemy id and walletconnect project id to github actions ci

* chore: fix lockfile

* chore: upgrade viem

* fix: added @wagmi/core to rainbowkit package dev depens

* fix: tsconfig to ignore test files

* fix: projectid default

* fix: alchemy id fallback styling

* revert: github actions secrets

* fix: workflow env styling

* chore: lockfile

* fix: lokijs dev depen for ci tests
  • Loading branch information
DanielSinclair committed Jul 6, 2023
1 parent 365cb3e commit 6389fae
Show file tree
Hide file tree
Showing 24 changed files with 940 additions and 426 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on: [pull_request, push]

env:
pnpm: 8
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: TEST_PROJECT_ID
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: YOUR_PROJECT_ID
WALLETCONNECT_PROJECT_ID: YOUR_PROJECT_ID
ALCHEMY_ID: YOUR_ALCHEMY_ID

jobs:
tests:
Expand Down
14 changes: 7 additions & 7 deletions examples/with-create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"private": true,
"dependencies": {
"@rainbow-me/rainbowkit": "workspace:*",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.5.2",
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"react": "^18.2.0",
"typescript": "^5.0.4",
"util": "0.12.4",
"viem": "~1.1.8",
"wagmi": "~1.3.2",
"viem": "~1.2.9",
"wagmi": "~1.3.7",
"web-vitals": "^2.1.4",
"buffer": "npm:buffer@6.0.3"
},
Expand Down
6 changes: 3 additions & 3 deletions examples/with-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"next": "^13.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.3",
"next": "^13.4.3",
Expand Down
6 changes: 3 additions & 3 deletions examples/with-next-custom-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"next": "^13.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.3",
"typescript": "^5.0.4"
Expand Down
6 changes: 3 additions & 3 deletions examples/with-next-mint-nft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"next": "^13.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.3",
"typescript": "^5.0.4"
Expand Down
6 changes: 3 additions & 3 deletions examples/with-next-siwe-iron-session/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"siwe": "^2.1.4",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.3",
"typescript": "^5.0.4"
Expand Down
6 changes: 3 additions & 3 deletions examples/with-next-siwe-next-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"siwe": "^2.1.4",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.3",
"typescript": "^5.0.4"
Expand Down
6 changes: 3 additions & 3 deletions examples/with-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"next": "^13.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.3",
"typescript": "^5.0.4"
Expand Down
8 changes: 4 additions & 4 deletions examples/with-remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"buffer-polyfill": "npm:buffer@^6.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@remix-run/dev": "^1.5.1",
"@remix-run/eslint-config": "^1.5.1",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"eslint": "^8.15.0",
"typescript": "^5.0.4"
},
Expand Down
8 changes: 4 additions & 4 deletions examples/with-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"buffer": "^6.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@vitejs/plugin-react": "^1.3.0",
"typescript": "^5.0.4",
"vite": "^2.9.9"
Expand Down
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,27 @@
"@rushstack/eslint-patch": "^1.1.0",
"@tanstack/query-core": "^4.3.8",
"@tanstack/react-query": "^4.3.9",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"@vanilla-extract/esbuild-plugin": "^2.2.0",
"@vanilla-extract/vite-plugin": "^3.8.0",
"@wagmi/core": "~1.3.2",
"@vanilla-extract/vite-plugin": "^3.8.2",
"@wagmi/core": "~1.3.6",
"autoprefixer": "^10.4.0",
"esbuild": "^0.14.39",
"eslint": "7.32.0",
"eslint-config-rainbow": "^3.0.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"ethers": "^5.6.8",
"eventemitter3": "^4.0.7",
"husky": "^7.0.4",
"jsdom": "^22.1.0",
"lokijs": "^1.5.12",
"next": "^13.4.3",
"next-auth": "4.20.1",
"postcss": "^8.4.6",
Expand All @@ -77,10 +83,9 @@
"react-dom": "^18.2.0",
"recursive-readdir-files": "^2.0.7",
"typescript": "^5.0.4",
"vitest": "^0.30.0",
"ethers": "^5.6.8",
"wagmi": "~1.3.2",
"viem": "~1.1.8"
"viem": "~1.2.9",
"vitest": "^0.32.4",
"wagmi": "~1.3.7"
},
"pnpm": {
"onlyBuiltDependencies": [
Expand Down
6 changes: 3 additions & 3 deletions packages/create-rainbowkit/generated-test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"next": "^13.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.3",
"typescript": "^5.0.4"
Expand Down
6 changes: 3 additions & 3 deletions packages/create-rainbowkit/templates/next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"next": "^13.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"devDependencies": {
"@types/node": "^18.16.12",
"@types/react": "^18.2.6",
"@types/react": "^18.2.14",
"eslint": "^8.15.0",
"eslint-config-next": "^13.4.3",
"typescript": "^5.0.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"siwe": "^2.1.4",
"viem": "~1.1.8",
"wagmi": "~1.3.2"
"viem": "~1.2.9",
"wagmi": "~1.3.7"
},
"scripts": {
"dev": "next dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/example/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains(
: []),
],
[
alchemyProvider({ apiKey: process.env.NEXT_PUBLIC_ALCHEMY_ID || '' }),
alchemyProvider({ apiKey: process.env.NEXT_PUBLIC_ALCHEMY_ID ?? '' }),
publicProvider(),
]
);
Expand Down
13 changes: 9 additions & 4 deletions packages/rainbowkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,21 @@
"wagmi": "~1.0.1 || ~1.1.0 || ~1.2.0 || ~1.3.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/qrcode": "^1.4.2",
"@vanilla-extract/private": "^1.0.3",
"@vanilla-extract/css-utils": "0.1.2",
"@vanilla-extract/private": "^1.0.3",
"autoprefixer": "^10.4.0",
"viem": "~1.1.8",
"wagmi": "~1.3.2",
"jsdom": "^22.1.0",
"nock": "^13.2.4",
"postcss": "^8.4.4",
"react": "^18.2.0",
"vitest": "^0.30.0"
"viem": "~1.2.9",
"vitest": "^0.32.4",
"wagmi": "~1.3.7",
"@wagmi/core": "~1.3.6"
},
"dependencies": {
"@vanilla-extract/css": "1.9.1",
Expand Down
Loading

2 comments on commit 6389fae

@vercel
Copy link

@vercel vercel bot commented on 6389fae Jul 6, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 6389fae Jul 6, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.