Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

473
Views
Las pruebas en React pasan si se ejecutan por separado, pero arrojan un error cuando se ejecutan ambas

Tener el siguiente archivo de prueba:

 import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; import TaskModal from './task-modal'; describe('TaskModal', () => { const title = 'title'; const selectedOption = { id: '1', name: 'test' }; const options = [{ id: '1', name: 'test' }]; it('should render successfully', () => { const { baseElement, getByText } = render( <TaskModal title={title} open={true} toggle={jest.fn()} initialScriptNameSelectedOption={selectedOption} scriptNameOptions={options} /> ); expect(baseElement).toBeTruthy(); expect(getByText(title)).toBeTruthy(); }); it('should check if TaskModal renders Textarea successfully', () => { const { getByTestId } = render( <TaskModal hasTextarea title={title} open={true} toggle={jest.fn()} initialScriptNameSelectedOption={selectedOption} scriptNameOptions={options} /> ); const textarea = getByTestId('has-textarea'); expect(textarea).toBeInTheDocument(); }); });

Cuando ejecuto cada prueba por separado, pasan, cuando ejecuto el archivo completo, la segunda prueba falla con el siguiente mensaje:

Error: no capturado [ReferenceError: IntersectionObserver no está definido]

¿Por qué está pasando esto?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!