Improve frontend coverage for entrypoint/bootstrap code and untested UI branches - #636
Conversation
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/745198ed-f0bf-478d-ae52-07ce01fe6a60 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/745198ed-f0bf-478d-ae52-07ce01fe6a60 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR increases frontend test coverage for entrypoint/bootstrap code (index.js, reportWebVitals.js) and adds missing branch coverage for navbar collapse toggling and footer non-OK fetch handling.
Changes:
- Added unit tests for
reportWebVitalscovering both “no callback” and “callback provided” flows. - Added an entrypoint test that exercises
index.jsbootstrap/render wiring. - Extended existing component tests to cover navbar collapse open/close and footer
response.ok === falsebehavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| frontend/src/reportWebVitals.test.js | Adds tests validating metric forwarding behavior and the no-op path. |
| frontend/src/index.test.js | Adds a bootstrap test that imports index.js and asserts initial wrapper render. |
| frontend/src/App.test.js | Adds tests for navbar collapse toggling and footer non-OK fetch response branch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/e3f7f864-5167-4ae8-aa2a-e973cdc42171 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
Applied the requested review-thread updates. The bootstrap test now uses isolated module mocks ( |
Applied in |
frontend/src/index.test.jsto mock bootstrap dependencies (createRoot,App,AppNavbar,Footer) and assert render wiringfrontend/src/App.test.jsnavbar toggle test to assert queried elements exist before interactionfrontend/src/App.test.jsfooter non-OK response test to await async assertions withwaitFor