[BUG]: Missing ResizeObserver guard in Navbar causes App.test.jsx test suite failure under jsdom
Maintainers usually reply within 1 day
@AyushSrivastava1818 is already working on this.
Since Nov 14, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript, react
- Domain
- frontend, testing-qa
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- JavaScript
- Stars
- 53
- Forks
- 187
- Avg merge
- 18m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/OrgExplorer
-
[BUG]: Organization filter dropdown in AnalyticsPage renders empty list due to truthy evaluation of empty issuesDataPossibly taken @havyasreekuppam claimed this 5 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
AOSSIE-Org/OrgExplorer#476 · 5 comments ·
Maintainers usually reply within 1 day
-
Add Pat for 5000 req/hr button not visible when pat expiresPossibly taken @Rajvardhan-Singh-Rathore claimed this 6 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AOSSIE-Org/OrgExplorer#473 · 6 comments ·
Maintainers usually reply within 1 day
-
[BUG]: PAT popup input lacks label association and visibility button lacks an accessible namePossibly taken @prasanm1423 claimed this 10 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/OrgExplorer#466 · 2 comments ·
Maintainers usually reply within 1 day
-
[FEATURE]: Set dynamic document.title based on active page routePossibly taken @23241a6749 claimed this 8 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/OrgExplorer#462 · 2 comments ·
Maintainers usually reply within 1 day
-
[BUG]: SocialShareButton logs unconditional console.warn when script is not loadedPossibly taken @vivekrajputofficial29-afk claimed this 8 days ago. Openbug enhancement
Difficulty 1/5 Under an hour Newbie friendliness 89/100
AOSSIE-Org/OrgExplorer#461 · 1 comment ·
Maintainers usually reply within 1 day
All issues in AOSSIE-Org/OrgExplorer
Similar issues
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Kanevry/session-orchestrator#108 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
awesomemotive/all-in-one-seo-pack#3238 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
andromarces/agent-loops#2055 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days