[BUG]: Missing ResizeObserver guard in Navbar causes App.test.jsx test suite failure under jsdom
I maintainer di solito rispondono entro 1 giorno
@AyushSrivastava1818 ci sta già lavorando.
Dal 14/11/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 20/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, react
- Ambito
- frontend, testing-qa
Direzione di ricerca
The failure comes from the new ResizeObserver(measureOverflow) call inside the useEffect in src/components/Navbar.jsx, which jsdom does not provide. Read src/test/setup.js and vite.config.js to see how the test environment is set up, then run src/App.test.jsx to reproduce. Done means the suite passes; a linked pull request (#457) already targets this, so check it before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Description
In src/components/Navbar.jsx, new ResizeObserver(measureOverflow) is instantiated directly inside useEffect:
const observer = new ResizeObserver(measureOverflow)
observer.observe(navbar)
observer.observe(links)
measureOverflow()
return () => observer.disconnect()
While ResizeObserver is supported natively in modern browsers, jsdom (which Vitest uses as configured in vite.config.js) does not implement ResizeObserver. Furthermore, src/test/setup.js does not provide a mock or polyfill for it.
As a result, running npm test fails with an uncaught ReferenceError: ResizeObserver is not defined when mounting <Navbar /> in src/App.test.jsx.
Steps to Reproduce
- Clone the repository on a clean environment.
- Run
npm ci. - Run
npm test. - Observe the failure in
src/App.test.jsx.
Logs and Screenshots
FAIL src/App.test.jsx > App routing > renders the Not Found page for an unknown route
ReferenceError: ResizeObserver is not defined
❯ src/components/Navbar.jsx:49:22
47| }
48|
49| const observer = new ResizeObserver(measureOverflow)
| ^
50| observer.observe(navbar)
51| observer.observe(links)
Test Files 1 failed | 11 passed (12)
Tests 1 failed | 97 passed (98)
Suggested fix:
- Guard
ResizeObserverinsrc/components/Navbar.jsx:
if (typeof ResizeObserver === 'undefined') {
measureOverflow()
return
}
const observer = new ResizeObserver(measureOverflow)
observer.observe(navbar)
observer.observe(links)
measureOverflow()
return () => observer.disconnect()
- Or provide a stub mock in
src/test/setup.js:
global.ResizeObserver = class ResizeObserver {
observe() {}
unobserve() {}
disconnect() {}
}
Environment Details
- Node.js version: 18+ / 20+
- Test Runner: Vitest / jsdom
- OS: Windows / Linux / macOS
- Branch: main
Impact
Low - Minor inconvenience
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
- 53
- Fork
- 182
- Merge medio
- 18m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/OrgExplorer
-
[BUG]: PAT popup input lacks label association and visibility button lacks an accessible nameForse già presa @prasanm1423 l’ha presa 3 giorni fa. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/OrgExplorer#466 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[FEATURE]: Set dynamic document.title based on active page routeForse già presa @23241a6749 l’ha presa 1 giorno fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/OrgExplorer#462 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: SocialShareButton logs unconditional console.warn when script is not loadedForse già presa @vivekrajputofficial29-afk l’ha presa 1 giorno fa. Apertabug enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
AOSSIE-Org/OrgExplorer#461 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: governance page shows "No dead issues" before the audit has runForse di nuovo libera @SYED-IRTEZA-HUSSAIN-RIZVI l’ha presa 8 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
AOSSIE-Org/OrgExplorer#453 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: User-controlled org/repo names are interpolated into API URLs unencodedForse già presa @AbhishekKumar-cse l’ha presa 10 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
AOSSIE-Org/OrgExplorer#449 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di AOSSIE-Org/OrgExplorer
Issue simili
-
marketing
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[bug]: Maximizing the Windows dashboard covers the taskbarForse già presa @xiufengsun l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
xiufengsun/TokenTracker#1152 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
parity: scripting.net's net-http row fails on macOS with errno 61 where the BDS golden has 111ApertaBug Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
JSPrismarine/JSPrismarine#3384 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
desec-io/desec-stack#1312 ·
I maintainer di solito rispondono entro 14 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
w3c/csswg-drafts#14848 ·
I maintainer di solito rispondono entro 1 giorno