Several assertions could not fail:
- "the catch update remains saved" was `caught.isChecked() || notes.includes(...)`
shared by two scenarios, so either half satisfied both. Split into two steps
that each assert the outcome their own scenario is about.
- The token-refresh check read a global counter with `> 0` and asserted an upload
had happened `some(...)`, both already satisfied by the preceding scenario. It
now asserts exactly one refresh, ordered before the upload.
- The box step ignored its box argument and asserted on the first N entries on
the page; it now scopes to that box and checks its full contents.
- The filter step asserted on whichever entry was first after filtering; it now
records the caught entry beforehand and names it, and checks the filter did not
exclude everything.
- The empty-state precondition asserted emptiness instead of establishing it,
which a fresh user satisfies for free.
- Offline coverage was `caches.keys().length > 0`. It now checks the precache
contract: one workbox cache holding the shell and a revisioned web manifest,
with _app/immutable assets cached without a revision query. The scenario that
claimed to test a trailing slash did not; it is replaced with real offline
client-side navigation.
The mock provider kept recorded requests, its refresh counter and the
fail-uploads switch in one process-wide object that only one step reset, so
scenario order was load-bearing and the failing-upload scenario poisoned
everything after it. An auto fixture now resets it per scenario, and the mock no
longer records its own control-plane calls. That reset is why the suite stays on
a single worker, which is now documented.
Coverage was gated at 90% per file over an allowlist of exactly the five files
that had tests, so new code was invisible to it permanently. It now measures all
of src/lib with global thresholds at the measured baseline, and no longer runs
the unit tests twice.
Also: a global teardown removes the users each run creates, the Supabase wrapper
distinguishes a stopped stack from a broken CLI call and detects an unseeded
database, the sign-in rate limit is raised above what one serial run needs, and
the integration suite no longer falls back to a hard-coded anon key that would
mask a misconfigured run.
The password-reset scenarios are renamed to what they actually cover: following a
real recovery link bounces to /signin, because the browser client persists no
cookies and so cannot keep the session it parses out of the URL. The helper for
the real flow is left in place and the gap is documented.
`npm run check` reported 15 errors and `npm run lint` 20, all pre-existing, so
neither gate could pass. Fixing them turned up three real bugs:
- SignOut destructured `{ error }` off `.then(() => {})`, which resolves to
undefined, so every sign-out threw a TypeError - after the signed-out event had
already been emitted. Sign-out also left the user on the protected page they
were on, still showing its content; it now returns them to the home page and
re-runs the server loads.
- SignUp passed `redirectTo`, which is not a signUp option and was silently
ignored, so the confirmation link has always used Supabase's configured site
URL. Documented rather than changed, since pointing it elsewhere needs an
absolute allow-listed URL.
- The Pokédex page tracked totalRecordsCreated but never passed it to the box
view, so the "Processed N entries so far" progress message never rendered.
The rest is typing and dead code: cookie callback parameters in hooks.server.ts
and +layout.ts, the untyped supabase props, a query-builder type that made
PostgREST rows untyped downstream, an unused session destructure, and
`while (true)` paging loops rewritten as `for (;;)`.
The endpoint overrides are read through `$env/dynamic/private`, so they are
evaluated per request in production, not baked in at build time. That made a
single injected environment variable enough to redirect the authorization-code
and refresh-token POSTs - which carry the OAuth client secret and the user's
refresh token - to an arbitrary host, and to redirect the user's authorize hop
to an arbitrary URL.
Overrides are now ignored unless ALLOW_PROVIDER_ENDPOINT_OVERRIDES is exactly
"true" and the value is a loopback URL. `npm run test:bdd` sets the flag;
nothing else should. resolveProviderEndpoints is pure so the refusals are unit
tested, including near-miss hosts such as http://127.0.0.1.example.
Also drops the unused `pokedex` parameter from buildCsv rather than silencing it
with `void`, and the dead hasGigantamaxed field from its fallback record.
Three defects that together meant `npm run test:build` could not pass in any of
its four variants:
- svelte.config.js constructed adapter-netlify inline and never used the
`adapter` export from adapter.mjs, so NODE_ADAPTER=true still produced a flat
build/ directory while the build test expects the node adapter's build/client
layout. adapter.mjs now returns netlify (the deployment target) or node, and
svelte.config.js consumes it.
- No route is prerendered, so workbox's glob found no HTML document and a
generateSW build precached nothing navigable: the app had no offline support
in that mode at all. Adds the root entry and a navigation fallback, matching
what prompt-sw.ts already did by hand for injectManifest builds.
- The build scripts used by the tests skipped the tailwind step that `build`
runs, so static/output.css was never generated on a clean checkout and the
app under test had no stylesheet.
The offline entry point assertion now also accepts the unquoted object key that
prompt-sw.ts's own precache call survives minification as.
Splits testing into five layers so a failure points at the responsible one:
- tests/unit isolated utility, repository and service tests
- tests/data validates the tracked Pokémon, game, region and dex files
- tests/integration schema, views, constraints, RLS and repositories
- tests/bdd executable Gherkin for user-visible behaviour
- tests/build service worker and manifest artifacts per build variant
Replaces the two Playwright specs in client-test/ and the two Vitest files in
test/. Adds a GitHub Actions workflow running the layers as separate jobs, a
mock OAuth provider server so the Drive and Dropbox scenarios never touch real
accounts, and a wrapper that reads the local Supabase keys from
`supabase status` rather than hard-coding them.
Extracts the pure formatting helpers out of PokedexExportService so they can be
unit tested, and makes the provider endpoints configurable so the mock server
can stand in for Google and Dropbox.
`prettier --check .` failed on 22 files, so gating CI on `npm run lint` was
never going to pass. These changes are whitespace only.
Adds the two remaining generated data exports to .prettierignore so this class
of churn cannot recur, along with machine-local settings files.
These two files are generated exports that prettier was not ignoring, so
`prettier --check .` failed on them. Reformatting is isolated here because the
diff is ~124k lines and would otherwise bury real changes.
The only semantic change in this commit is the apostrophe in Farfetch'd and
Sirfetch'd: U+0027 -> U+2019, matching the spelling the rest of the data
already used. Everything else is whitespace.
Female Sneasel was absent from all 5 Gen 2 games (Gold, Silver, Crystal,
HeartGold, SoulSilver) and Female Indeedee was absent from Sword, despite
their base forms being present. Both found during QA of the form dex
game-scope feature.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a Pokédex has a game scope set and isFormDex=true, alternate forms
were not appearing because game_pokedex_entries only contains base-form
Pokémon. This adds fetchFormsForGame() to pull supplemental form entries
from pokedex_entries filtered by gamesToCatchIn, then merges and sorts
them using the base form's regional dex number so ordering is preserved.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>