Give a new account a first run, and drop to three tabs
Registering used to land you on a bare form asking for a child, with no hint what came next. A short wizard now walks through the child, whether you are planning alone or together, and where the day balances come from: fetched from Försäkringskassan, entered by hand, or skipped — and if skipped, the figures carry a badge saying they are estimates until real ones arrive. Fetching is the first option rather than a hidden one, so the scraper is on by default and the script that used to force it on no longer needs to. Planning and Tips lose their tabs. Authoring moved to the calendar and the figures moved to the overview, so both pages were only a second way to reach what is already on screen; their routes now redirect rather than dead-end. The dead translations went with them. Dates also follow the chosen language now instead of always formatting as Swedish.
This commit is contained in:
@@ -8,23 +8,21 @@ primary onboarding action. Follows the `test_calendar_router.py` /
|
||||
graph, not just the service, so status codes and wire-shape regressions are
|
||||
caught.
|
||||
|
||||
`settings.scraper_enabled` defaults to `False` in `app/config.py` (the
|
||||
checked-in, CI-facing configuration -- no `APP_SCRAPER_ENABLED` is set in
|
||||
CI). On at least one contributor's machine, an untracked, gitignored
|
||||
`backend/.env` sets `APP_SCRAPER_ENABLED=true` for manual scraper testing
|
||||
(see `AGENTS.md`'s `npm run login` note) -- so `settings.scraper_enabled` at
|
||||
*import time* is genuinely ambient and must not be asserted on directly (it
|
||||
was `True` when this suite was drafted, on the machine that drafted it,
|
||||
despite the shipped default being `False`).
|
||||
`settings.scraper_enabled` defaults to `True` in `app/config.py` (the FK
|
||||
legal/ToS review completed 2026-06; see the field's docstring) but a
|
||||
contributor's untracked, gitignored `backend/.env` can still override it
|
||||
either way -- so `settings.scraper_enabled` at *import time* is genuinely
|
||||
ambient and must not be asserted on directly.
|
||||
|
||||
The scraper-session tests below therefore use `monkeypatch` to pin
|
||||
`app.routers.fetch_data.settings.scraper_enabled` to a known value for the
|
||||
duration of each test, rather than asserting on (or branching on) whatever a
|
||||
contributor's local `.env` happens to set. This is deliberately more robust
|
||||
than reading the live value once and assuming it holds — the disabled path
|
||||
is what both the shipped default and CI exercise; the enabled path is
|
||||
exercised here only far enough to prove the guard flips (`start_session` is
|
||||
faked out, never a real Playwright session -- see the module docstring in
|
||||
is exercised here to prove the guard still works for an environment that
|
||||
opts back out (e.g. one without Playwright chromium installed); the enabled
|
||||
path is exercised only far enough to prove the guard flips (`start_session`
|
||||
is faked out, never a real Playwright session -- see the module docstring in
|
||||
`app/scrapers/fk_scraper.py`; actually driving it here would launch a real,
|
||||
non-headless browser as a fire-and-forget background task, which is unsafe
|
||||
to do from a router test).
|
||||
@@ -181,9 +179,10 @@ class TestGetLatestAndHistory:
|
||||
|
||||
|
||||
class TestScraperEndpointsDisabled:
|
||||
"""`settings.scraper_enabled = False` is the shipped default and what CI
|
||||
exercises (see the module docstring for why this is pinned via
|
||||
`monkeypatch` rather than asserted on ambiently).
|
||||
"""Covers the disabled path (an environment that opts out via
|
||||
`APP_SCRAPER_ENABLED=false`, e.g. one without Playwright chromium
|
||||
installed) — see the module docstring for why this is pinned via
|
||||
`monkeypatch` rather than asserted on ambiently.
|
||||
"""
|
||||
|
||||
async def test_start_returns_501_when_scraper_disabled(
|
||||
|
||||
Reference in New Issue
Block a user