- useSidebar: collapsed below 1100px (matchMedia) or by the admin's choice, persisted as a boolean under summer-admin.sidebar; the viewport never overwrites the stored choice - SectionPanel collapse and rail expand buttons; SectionFlyout (role menu) opens on hover, focus, Enter or ArrowDown on a rail item, closes on Esc or about 200 ms after leaving and returns focus to the rail item - Breadcrumbs with plugin, controller and record crumbs; UserMenu (Reka DropdownMenu) with initials, name, role and Wyloguj - useAuth.logout POSTs /auth/logout, clears user, navigation and settings and routes to login even when the call fails - applyColorScheme toggles .dark from prefers-color-scheme (no toggle, A6) - newest toast first, 200 ms fade and scale for dialogs and toasts - one relation-manager type constant in the registry - shell smoke tests; tests default to a desktop, light matchMedia
22 lines
862 B
TypeScript
22 lines
862 B
TypeScript
// The served index.html carries the admin base in a meta element; tests use a
|
|
// non-default base to prove the SPA reads it at runtime (D-02, D-03).
|
|
const meta = document.createElement('meta')
|
|
meta.setAttribute('name', 'summer-admin-base')
|
|
meta.setAttribute('content', '/admin-test')
|
|
document.head.appendChild(meta)
|
|
|
|
// happy-dom's default viewport is 1024px wide, below the 1100px sidebar
|
|
// breakpoint. Tests get a desktop, light-mode media environment; the shell
|
|
// smoke test spies on matchMedia to simulate narrow or dark screens.
|
|
window.matchMedia = (query: string): MediaQueryList =>
|
|
({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addEventListener: () => undefined,
|
|
removeEventListener: () => undefined,
|
|
addListener: () => undefined,
|
|
removeListener: () => undefined,
|
|
dispatchEvent: () => false,
|
|
}) as MediaQueryList
|