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:
@@ -59,11 +59,29 @@ describe('Header', () => {
|
||||
renderWithRouter(<Header />)
|
||||
expect(screen.getByText('Översikt')).toBeInTheDocument()
|
||||
expect(screen.getByText('Kalender')).toBeInTheDocument()
|
||||
expect(screen.getByText('Planering')).toBeInTheDocument()
|
||||
expect(screen.getByText('Tips')).toBeInTheDocument()
|
||||
expect(screen.getByText('Inställningar')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('does not render the retired Plan/Tips nav entries', () => {
|
||||
renderWithRouter(<Header />)
|
||||
expect(screen.queryByText('Planering')).not.toBeInTheDocument()
|
||||
expect(screen.queryByText('Tips')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('sets an aria-label on the child select for accessibility', () => {
|
||||
const childrenList = [
|
||||
{ id: '1', name: 'Emma' },
|
||||
{ id: '2', name: 'Oscar' },
|
||||
]
|
||||
renderWithRouter(<Header childrenList={childrenList} selectedChildId="1" />)
|
||||
expect(screen.getByTestId('child-select')).toHaveAttribute('aria-label', 'Välj barn')
|
||||
})
|
||||
|
||||
it('sets an aria-label on the logout button for accessibility', () => {
|
||||
renderWithRouter(<Header onLogout={vi.fn()} />)
|
||||
expect(screen.getByTestId('logout-button')).toHaveAttribute('aria-label', 'Logga ut')
|
||||
})
|
||||
|
||||
it('renders logout button when onLogout provided', () => {
|
||||
const onLogout = vi.fn()
|
||||
renderWithRouter(<Header onLogout={onLogout} />)
|
||||
@@ -103,16 +121,6 @@ describe('Header', () => {
|
||||
expect(screen.getByText('Översikt')).not.toHaveClass('header__nav-link--active')
|
||||
})
|
||||
|
||||
it('marks the plan link active on the plan route', () => {
|
||||
renderAtPath(<Header />, '/plan')
|
||||
expect(screen.getByText('Planering')).toHaveClass('header__nav-link--active')
|
||||
})
|
||||
|
||||
it('marks the tips link active on the tips route', () => {
|
||||
renderAtPath(<Header />, '/tips')
|
||||
expect(screen.getByText('Tips')).toHaveClass('header__nav-link--active')
|
||||
})
|
||||
|
||||
it('marks the settings link active on the settings route, and the overview link inactive', () => {
|
||||
renderAtPath(<Header />, '/settings')
|
||||
expect(screen.getByText('Inställningar')).toHaveClass('header__nav-link--active')
|
||||
|
||||
Reference in New Issue
Block a user