Add the settings home screen (mock 1p)
/settings now renders the Settings home: the "Our kitchen" shared household banner and grouped cards for Household (Regular dinners, Google Calendar, Household), Alerts (Notifications & Google Chat) and Admin (AI assistant, with the Admin tag and grape-300 inset ring). Each row links to its settings page. The Household row shows the live timezone and dinner time from GET /api/v1/settings/household, and the AI assistant row the live provider and model from GET /api/v1/settings/ai. Regular dinners, Google Calendar and Notifications show no status line: the server has no dinners, Google Calendar or notification endpoint yet. Shell tests now render the routes inside the API and query providers. Maestro task: 97b50e29-b8a7-4e99-918d-99fa1b239313 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,9 @@ import { fireEvent, render, screen, within } from '@testing-library/react'
|
||||
import { MemoryRouter } from 'react-router'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest'
|
||||
import { AppRoutes } from '../App.tsx'
|
||||
import { ApiProviders, SETTINGS_API } from '../test/ApiProviders.tsx'
|
||||
import { declaredStyle } from '../test/cssRules.ts'
|
||||
import { stubFetchByPath } from '../test/fetchStub.ts'
|
||||
import { mockViewport } from '../test/matchMedia.ts'
|
||||
import styles from './BottomBar.module.css'
|
||||
|
||||
@@ -65,13 +67,17 @@ afterEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
Reflect.deleteProperty(Element.prototype, 'animate')
|
||||
Reflect.deleteProperty(window, 'matchMedia')
|
||||
vi.unstubAllGlobals()
|
||||
})
|
||||
|
||||
function renderAt(path: string, reducedMotion = false) {
|
||||
mockViewport(MOBILE, { reducedMotion })
|
||||
stubFetchByPath(SETTINGS_API)
|
||||
render(
|
||||
<MemoryRouter initialEntries={[path]}>
|
||||
<AppRoutes />
|
||||
<ApiProviders>
|
||||
<AppRoutes />
|
||||
</ApiProviders>
|
||||
</MemoryRouter>,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user