o meu código import { render, screen } from '@testing-library/react'; import App from './App';
test('renders learn react link', () => { render(); const linkElement = screen.getByText(/learn react/i); expect(linkElement).toBeInTheDocument(); }); o erro que aparece Jest (ebook)
[info] auto config:
found: rootPath: /Users/gabrielgalvaodosanjos/ebook jestCommandLine: npm test --
ebook@0.1.0 test /Users/gabrielgalvaodosanjos/ebook react-scripts test "--testLocationInResults" "--json" "--useStderr" "--outputFile" "/var/folders/z6/91qd74f96dj3p_2gf5yc64gm0000gn/T/jest_runner_ebook_501.json" "--watch" "--no-coverage" "--reporters" "default" "--reporters" "/Users/gabrielgalvaodosanjos/.vscode/extensions/orta.vscode-jest-5.2.3/out/reporter.js" "--colors"
Test run started at 02/04/2023 11:46:29 <
console.error Warning: Each child in a list should have a unique "key" prop.
Check the render method of `OpcoesHeader`. See https://reactjs.org/link/warning-keys for more information.
at li
at OpcoesHeader
at header
at Header
at div
at App
4 | function OpcoesHeader(){
5 | return(
> 6 | <ul className='opcoes'>
| ^
7 | { textoOpcoes.map( (texto) => (
8 | <li className='opcao'><p>{texto}</p></li>
9 | ) ) }
at printWarning (node_modules/react/cjs/react-jsx-dev-runtime.development.js:87:30)
at error (node_modules/react/cjs/react-jsx-dev-runtime.development.js:61:7)
at validateExplicitKey (node_modules/react/cjs/react-jsx-dev-runtime.development.js:1078:5)
at validateChildKeys (node_modules/react/cjs/react-jsx-dev-runtime.development.js:1105:11)
at jsxWithValidation (node_modules/react/cjs/react-jsx-dev-runtime.development.js:1276:11)
at OpcoesHeader (src/componentes/OpcoesHeader/index.js:6:9)
at renderWithHooks (node_modules/react-dom/cjs/react-dom.development.js:16305:18)
console.error Warning: is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements. at iconesHeader at header at Header at div at App
at printWarning (node_modules/react-dom/cjs/react-dom.development.js:86:30)
at error (node_modules/react-dom/cjs/react-dom.development.js:60:7)
at createElement (node_modules/react-dom/cjs/react-dom.development.js:9761:9)
at createInstance (node_modules/react-dom/cjs/react-dom.development.js:10941:20)
at completeWork (node_modules/react-dom/cjs/react-dom.development.js:22187:28)
at completeUnitOfWork (node_modules/react-dom/cjs/react-dom.development.js:26593:16)
at performUnitOfWork (node_modules/react-dom/cjs/react-dom.development.js:26568:5)
console.error Warning: The tag is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter. at iconesHeader at header at Header at div at App
at printWarning (node_modules/react-dom/cjs/react-dom.development.js:86:30)
at error (node_modules/react-dom/cjs/react-dom.development.js:60:7)
at createElement (node_modules/react-dom/cjs/react-dom.development.js:9816:9)
at createInstance (node_modules/react-dom/cjs/react-dom.development.js:10941:20)
at completeWork (node_modules/react-dom/cjs/react-dom.development.js:22187:28)
at completeUnitOfWork (node_modules/react-dom/cjs/react-dom.development.js:26593:16)
at performUnitOfWork (node_modules/react-dom/cjs/react-dom.development.js:26568:5)
FAIL src/App.test.js (6.343 s) ✕ renders learn react link (1009 ms)