Advertisement
rluca6448

Untitled

Oct 20th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.43 KB | None | 0 0
  1. FAIL  src/tests/AcademicDetail.test.js
  2.   ● Console
  3.  
  4.     console.error
  5.       Warning: ReactDOMTestUtils.act is deprecated in favor of React.act. Import act from react instead of react-dom/test-utils. See https://react.dev/warnings/react-dom-test-utils for more info.
  6.  
  7.       35 |   test('renders loading state initially', () => {
  8.       36 |     // Renderiza el componente
  9.     > 37 |     render(
  10.          |           ^
  11.       38 |       <MemoryRouter>
  12.       39 |         <AcademicDetail />
  13.       40 |       </MemoryRouter>
  14.  
  15.       at printWarning (node_modules/react-dom/cjs/react-dom-test-utils.development.js:71:30)
  16.       at error (node_modules/react-dom/cjs/react-dom-test-utils.development.js:45:7)
  17.       at actWithWarning (node_modules/react-dom/cjs/react-dom-test-utils.development.js:1736:7)
  18.       at node_modules/@testing-library/react/dist/act-compat.js:63:25
  19.       at renderRoot (node_modules/@testing-library/react/dist/pure.js:159:26)
  20.       at render (node_modules/@testing-library/react/dist/pure.js:246:10)
  21.       at Object.<anonymous> (src/tests/AcademicDetail.test.js:37:11)
  22.  
  23.     console.error
  24.       Error: Uncaught [TypeError: Cannot read properties of undefined (reading 'pathname')]
  25.           at reportException (C:\Users\elfam\OneDrive\Desktop\ITBA\3erAño\PrimerCuatri\IngeSoft\Proyecto_G3\Proyecto_Ing_Soft\studenthub\node_modules\jsdom\lib\jsdom\living\helpers\runtime-script-errors.js:66:24)
  26.           at innerInvokeEventListeners (C:\Users\elfam\OneDrive\Desktop\ITBA\3erAño\PrimerCuatri\IngeSoft\Proyecto_G3\Proyecto_Ing_Soft\studenthub\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:341:9)
  27.           at invokeEventListeners (C:\Users\elfam\OneDrive\Desktop\ITBA\3erAño\PrimerCuatri\IngeSoft\Proyecto_G3\Proyecto_Ing_Soft\studenthub\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:274:3)
  28.           at HTMLUnknownElementImpl._dispatch (C:\Users\elfam\OneDrive\Desktop\ITBA\3erAño\PrimerCuatri\IngeSoft\Proyecto_G3\Proyecto_Ing_Soft\studenthub\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:221:9)
  29.           at HTMLUnknownElementImpl.dispatchEvent (C:\Users\elfam\OneDrive\Desktop\ITBA\3erAño\PrimerCuatri\IngeSoft\Proyecto_G3\Proyecto_Ing_Soft\studenthub\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.js:94:17)
  30. ...
  31.           at runTest (C:\Users\elfam\OneDrive\Desktop\ITBA\3erAño\PrimerCuatri\IngeSoft\Proyecto_G3\Proyecto_Ing_Soft\studenthub\node_modules\jest-runner\build\runTest.js:475:34)
  32.           at Object.worker (C:\Users\elfam\OneDrive\Desktop\ITBA\3erAño\PrimerCuatri\IngeSoft\Proyecto_G3\Proyecto_Ing_Soft\studenthub\node_modules\jest-runner\build\testWorker.js:133:12)
  33.  
  34.  ● AcademicDetail Frontend Tests › renders NavBar and DetailCard when activity is loaded
  35.                                                                                                                                                                                                                                              
  36.     TestingLibraryElementError: Unable to find an element with the text: /Mocked NavBar/i. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.                                                                                                                                                                                                                            
  37.                                                                                                                                                                                                                                              
  38.     Ignored nodes: comments, script, style                                                                                                                                                                                                    
  39.     <body>                                                                                                                                                                                                                                    
  40.       <div>                                                                                                                                                                                                                                  
  41.         <div>
  42.           Loading...
  43.         </div>
  44.       </div>
  45.     </body>
  46.  
  47.       64 |
  48.       65 |     // Verifica que se renderice el NavBar mockeado
  49.     > 66 |     expect(screen.getByText(/Mocked NavBar/i)).toBeInTheDocument();
  50.          |                   ^
  51.       67 |
  52.       68 |     // Espera a que se renderice el DetailCard y verifica su contenido
  53.       69 |     await waitFor(() => {
  54.  
  55.       at Object.getElementError (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19)
  56.       at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
  57.       at node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
  58.       at getByText (node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19)
  59.       at Object.<anonymous> (src/tests/AcademicDetail.test.js:66:19)
  60.  
  61. Test Suites: 1 failed, 2 passed, 3 total
  62. Tests:       1 failed, 3 passed, 4 total
  63. Snapshots:   0 total
  64. Time:        3.85 s
  65. Ran all test suites.
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement