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

Remove DOM and React warnings from grant-explorer test output #2717

Open
bard opened this issue Dec 1, 2023 · 1 comment
Open

Remove DOM and React warnings from grant-explorer test output #2717

bard opened this issue Dec 1, 2023 · 1 comment

Comments

@bard
Copy link
Contributor

bard commented Dec 1, 2023

Examples:

stderr | src/features/contributors/__tests__/ViewContributionHistory.test.tsx > <ViewContributionHistory/> > Should show donation impact & donation history
Warning: validateDOMNesting(...): <tr> cannot appear as a child of <table>. Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.
    at tr
    at table
    at DonationsTable (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/contributors/DonationsTable.tsx:104:17)
    at main
    at div
    at ViewContributionHistory (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/contributors/ViewContributionHistory.tsx:172:13)
    at Router (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/umd/react-router.development.js:1085:17)
    at MemoryRouter (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/umd/react-router.development.js:985:7)
 ✓ src/features/api/__tests__/voting.test.tsx  (5 tests) 38ms
stderr | src/features/common/__tests__/Navbar.test.tsx > <Navbar> > SHOULD display home-link
Warning: Invalid DOM property `stroke-width`. Did you mean `strokeWidth`?
    at circle
    at svg
    at a
    at div
    at div
    at div
    at div
    at nav
    at Navbar (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/common/Navbar.tsx:28:39)
    at DataLayerProvider (/home/bard/projects/gitcoin/grants-stack/packages/data-layer/dist/react.js:7:30)
    at Router (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/umd/react-router.development.js:1085:17)
    at MemoryRouter (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/umd/react-router.development.js:985:7)
    at EnvironmentProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected][email protected]/node_modules/@chakra-ui/react-env/dist/chunk-VMD3UMGK.mjs:26:11)
    at ColorModeProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected][email protected]/node_modules/@chakra-ui/color-mode/dist/chunk-AMBGAKG2.mjs:23:5)
    at ThemeProvider (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32)
    at ThemeProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@chakra-ui/system/dist/chunk-UBPTU7WB.mjs:15:11)
    at ChakraProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@chakra-ui/provider/dist/chunk-3DDHO3UN.mjs:17:5)
    at ChakraProvider2 (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_fr_l6ziguyqzjnjjaly5at3bpc2wq/node_modules/@chakra-ui/react/dist/chunk-QAITB7GG.mjs:15:5)
Warning: Each child in a list should have a unique "key" prop.

Check the render method of `CategoryBanner`. See https://reactjs.org/link/warning-keys for more information.
    at div
    at CategoryBanner (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/discovery/CardBanner.tsx:159:27)
    at div
    at /home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/tailwind-styled-components/dist/tailwind-styled-components.cjs.js:1:2200
    at a
    at div
    at /home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/tailwind-styled-components/dist/tailwind-styled-components.cjs.js:1:2200
    at CategoryCard (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/categories/CategoryCard.tsx:7:25)
    at div
    at CategoriesGrid (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/categories/CategoriesGrid.tsx:5:27)
    at div
    at section
    at LandingSection (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/discovery/LandingSection.tsx:15:3)
    at div
    at main
    at DefaultLayout (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/common/DefaultLayout.tsx:8:3)
    at LandingPage (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/discovery/LandingPage.tsx:57:46)
    at DataLayerProvider (/home/bard/projects/gitcoin/grants-stack/packages/data-layer/dist/react.js:7:30)
    at Router (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/umd/react-router.development.js:1085:17)
    at MemoryRouter (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/umd/react-router.development.js:985:7)
    at EnvironmentProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected][email protected]/node_modules/@chakra-ui/react-env/dist/chunk-VMD3UMGK.mjs:26:11)
    at ColorModeProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected][email protected]/node_modules/@chakra-ui/color-mode/dist/chunk-AMBGAKG2.mjs:23:5)
    at ThemeProvider (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32)
    at ThemeProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@chakra-ui/system/dist/chunk-UBPTU7WB.mjs:15:11)
    at ChakraProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@chakra-ui/provider/dist/chunk-3DDHO3UN.mjs:17:5)
    at ChakraProvider2 (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_fr_l6ziguyqzjnjjaly5at3bpc2wq/node_modules/@chakra-ui/react/dist/chunk-QAITB7GG.mjs:15:5)
stderr | src/features/discovery/__tests__/LandingPage.test.tsx > LandingPage > fetches and displays active rounds and rounds in application phase
Warning: Encountered two children with the same key, `0x8f56aa55c8e6b9f4fdbbaffedbff286b8dfcfdb0`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
    at div
    at RoundsGrid (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/discovery/RoundsGrid.tsx:10:3)
    at div
    at section
    at LandingSection (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/discovery/LandingSection.tsx:15:3)
    at div
    at main
    at DefaultLayout (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/common/DefaultLayout.tsx:8:3)
    at LandingPage (/home/bard/projects/gitcoin/grants-stack/packages/grant-explorer/src/features/discovery/LandingPage.tsx:57:46)
    at DataLayerProvider (/home/bard/projects/gitcoin/grants-stack/packages/data-layer/dist/react.js:7:30)
    at Router (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/umd/react-router.development.js:1085:17)
    at MemoryRouter (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/[email protected][email protected]/node_modules/react-router/dist/umd/react-router.development.js:985:7)
    at EnvironmentProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected][email protected]/node_modules/@chakra-ui/react-env/dist/chunk-VMD3UMGK.mjs:26:11)
    at ColorModeProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected][email protected]/node_modules/@chakra-ui/color-mode/dist/chunk-AMBGAKG2.mjs:23:5)
    at ThemeProvider (/home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32)
    at ThemeProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@chakra-ui/system/dist/chunk-UBPTU7WB.mjs:15:11)
    at ChakraProvider (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@chakra-ui/provider/dist/chunk-3DDHO3UN.mjs:17:5)
    at ChakraProvider2 (file:///home/bard/projects/gitcoin/grants-stack/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_fr_l6ziguyqzjnjjaly5at3bpc2wq/node_modules/@chakra-ui/react/dist/chunk-QAITB7GG.mjs:15:5)
@bard
Copy link
Contributor Author

bard commented Dec 8, 2023

The DevTools message should be fixed by upgrading vitest, see vitest-dev/vitest#4107.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants