Repository navigation
test(frontend): cover contexts, useDebounce and add a providers render helper - #573
Merged
Merged
Conversation
…r helper Adds browser-mode tests for the settings, date and statistics contexts and for useDebounce, nameOfFactory and the backend client. Adds renderWithProviders / createProvidersWrapper that mirror index.tsx with a fresh jotai store per test, for the component tests that follow. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Visit the preview URL for this PR (updated for commit 6191771): https://tormap-36f44--pr573-chore-frontend-conte-42f1atyl.web.app (expires Mon, 09 Nov 2026 14:08:03 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 0c1f71965de18e60b0e686b0d0356977fec090dc |
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third step of the frontend testing plan (follows #570, #571).
settings-context.test.tsx: defaults, all three input-name branches ofchangeSettings,setSettings, and the selection reset when country/family grouping is off.date-context.test.tsx: latest day selection, manual selection, the "historic data is processing" snackbar and its absence for a complete history, empty list.statistics-context.test.tsx: initial zeros and updates.util.test.ts:useDebounce(initial value, delay, restart on change, ignores undefined; fake timers),nameOfFactory,backendbase URL and headers.src/test/render.tsx:renderWithProvidersandcreateProvidersWrappermirrorindex.tsx(theme, snackbar, jotai, settings, date, statistics) with a fresh jotai store per call and settings overrides. A harness test exercises it. The component and flow tests in the next PR build on it.No production code changed.
Coverage
Whole project: 46.8% lines (was 33.7%).
context/andutil/util.tsare at 100%.Deployment notes
None.
Dependency vetting
No dependency changes.
mswis still unused; it comes with the data-loading flow tests.Verification (Node 24)
tscclean, eslint 0 errors (3 existing warnings).🤖 Generated with Claude Code