Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa Adatta ai principianti
#283 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@RounakKumarAgarwal ci sta già lavorando.

Dal 1/10/2026.

  • #286 di @RounakKumarAgarwal — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
90/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend, testing

Direzione di ricerca

Inizia con src/pages/SettingsPage.test.jsx ed esegui npx vitest run src/pages/SettingsPage.test.jsx per riprodurre i due errori. Leggi i test di Clear All insieme al comportamento di conferma descritto per SettingsPage.jsx, quindi aggiorna la configurazione dei test in modo che la conferma venga accettata. Il lavoro è completato quando tutti e tre i test passano e viene raggiunta l'asserzione del pulsante "cleared".

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
JavaScript
Stelle
44
Fork
133
Merge medio
5g 5h
PR unite (30g)
27

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/OrgExplorer

Tutte le issue di AOSSIE-Org/OrgExplorer

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.