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

239
Views
Prueba de broma si el elemento oculto por desbordamiento es visible

Tengo un componente de reacción que se comporta como un control deslizante. Quiero probar si uno de los elementos que está oculto por el desbordamiento es visible o no.

Deslizador

Lo que tengo hasta ahora es

 const prevBtn = screen.getByRole('button', { name: /prev slide/i }) const juneTwentySix = await screen.findByTestId('Sun 26 Jun') const juneThird = await screen.findByTestId('Sun 30 Jun') expect(prevBtn).toBeDisabled() expect(juneTwentySix).toBeVisible() <-- ok expect(juneThird).toBeInTheDocument() <-- it's in the DOM, so it's ok to be in the document expect(juneThird).not.toBeVisible() <-- this is where I want to check if the element is visible or not.

Cómo se construye este control deslizante: el componente principal tiene un ancho fijo: es decir, 300 px, y lo que hace que el componente secundario (el que contiene las fechas) sea transform: translateX(-${currentSlide * 100}%)

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!