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

348
Views
Pruebas unitarias: cómo simular un clic en el botón Atrás en el navegador

Tengo un caso de prueba que necesito Simular haga clic en el botón Atrás en el navegador

lo que intenté hacer así:

 test('Then i click on back button on the brwoser should stay on Bills Page',()=>{ const data = [] const loading = false const error = null const pathname = ROUTES_PATH['Bills'] const html = ROUTES({ pathname, data, loading, error }) document.body.innerHTML = html const back=jest.fn(window.history.back()) userEvent.click(back) expect(back).toHaveBeenCalled() expect(screen.getAllByText('Mes notes de frais')).toBeTruthy() })

No sé si lo que escribo es correcto, por qué tengo un error en mi broma. ingrese la descripción de la imagen aquí

corríjame si lo que intento hacer es incorrecto, uso la biblioteca @testing-library/user-event

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!