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:
2026-09-17 22:05:54 +02:00
parent 064bcc2b3a
commit a4fce16dd1
40 changed files with 1060 additions and 4986 deletions
+34 -4
View File
@@ -30,10 +30,6 @@ vi.mock('@/pages/Settings', () => ({
Settings: () => <div data-testid="settings-page">Settings Page</div>,
}))
vi.mock('@/pages/Tips', () => ({
Tips: () => <div data-testid="tips-page">Tips Page</div>,
}))
vi.mock('@/pages/DevFetch', () => ({
DevFetch: () => <div data-testid="dev-fetch-page">DevFetch Page</div>,
}))
@@ -126,6 +122,40 @@ describe('App', () => {
})
})
describe('retired /plan and /tips routes', () => {
// The Plan and Tips tabs were removed (leave is now authored on the
// calendar, and Översikt carries the headline figures) — neither route
// is registered any more, so both now fall through to the catch-all
// and redirect to "/" instead of rendering a page or 404ing.
it('redirects /plan to the dashboard when authenticated', async () => {
vi.mocked(api.refreshToken).mockResolvedValue({
access_token: 'test-token',
token_type: 'bearer',
expires_in: 3600,
})
vi.mocked(api.setAccessToken).mockImplementation(() => {})
renderWithRoute('/plan')
await waitFor(() => {
expect(screen.getByTestId('dashboard-page')).toBeInTheDocument()
})
})
it('redirects /tips to the dashboard when authenticated', async () => {
vi.mocked(api.refreshToken).mockResolvedValue({
access_token: 'test-token',
token_type: 'bearer',
expires_in: 3600,
})
vi.mocked(api.setAccessToken).mockImplementation(() => {})
renderWithRoute('/tips')
await waitFor(() => {
expect(screen.getByTestId('dashboard-page')).toBeInTheDocument()
})
})
})
describe('app structure', () => {
it('wraps app with AuthProvider and WorkspaceProvider', async () => {
// Verify the provider wrappers are in place by checking that auth flow works