Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[BUG]: SettingsPage.test.jsx "Clear All" tests fail on main — confirmation step not handled

Cerrado Apto para principiantes
#283 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@RounakKumarAgarwal ya está trabajando en esto.

Desde el 1/10/2026.

  • #286 de @RounakKumarAgarwal — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
90/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript
Área
frontend, testing

Línea de trabajo

Empieza con src/pages/SettingsPage.test.jsx y ejecuta npx vitest run src/pages/SettingsPage.test.jsx para reproducir los dos fallos. Lee las pruebas de Clear All junto con el comportamiento de confirmación descrito para SettingsPage.jsx y, después, actualiza la configuración de las pruebas para que se acepte la confirmación. La tarea está terminada cuando las tres pruebas pasan y se alcanza la aserción del botón "cleared".

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Bug Description

Two of the three tests in src/pages/SettingsPage.test.jsx fail on current main. The
"Clear All" tests wait for a button labeled "cleared" to appear after clicking "Clear all":

expect(await screen.findByRole('button', { name: /cleared/i })).toBeInTheDocument()

This times out. It looks like #267 (two-step confirmation for destructive actions)
changed the Clear All flow — there's now a confirmation step before the action completes —
but the test wasn't updated to click through the new confirmation, so it never reaches
the "cleared" state.

Steps to Reproduce
  1. On current main, run: npx vitest run src/pages/SettingsPage.test.jsx
  2. Observe 2 of 3 tests fail at the findByRole('button', { name: /cleared/i }) assertion.
Logs and Screenshots

FAIL src/pages/SettingsPage.test.jsx
❯ findByRole('button', { name: /cleared/i }) timed out
at src/pages/SettingsPage.test.jsx:59

Tests 2 failed | 1 passed (3)

Environment Details
  • Branch: main (with #267 merged)
  • Node.js: 22.17.0
  • Root cause: #267 added window.confirm('Clear all cached data?') at the start of
    handleClear in SettingsPage.jsx. The test (added in an earlier PR) clicks "Clear All"
    but doesn't handle the new confirm dialog, so handleClear returns early and never
    reaches the "Cleared" state. Fix: the test should mock window.confirm to return true.
Impact

Medium - Feature works but has issues

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
Lenguaje dominante
JavaScript
Estrellas
45
Forks
148
Merge medio
5 d 15 h
PR fusionados (30 d)
28

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de AOSSIE-Org/OrgExplorer

Todos los issues de AOSSIE-Org/OrgExplorer

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.