test(quick-261016-0fm): theme switch, language switcher and footer offset

- theme: light and dark ignore prefers-color-scheme, choices and guard
- i18n: ?locale= only with a preference, availableLocales from meta
- usePreferences: cache validation, cycle order and PUT bodies, revert
  with a danger toast, profile apply, setLocale save, cache and reload
- rail theme button, user menu language group, --shell-offset and the
  form save bar offset; fixture strings and resetState theme reset
This commit is contained in:
Jakub Zych
2026-10-16 11:48:39 +02:00
parent 119f1f8d54
commit f0ab26b93f
9 changed files with 416 additions and 7 deletions

View File

@@ -116,4 +116,21 @@ describe('View site link (Phase 16.2 quick follow-up)', () => {
expect(yaml).toMatch(new RegExp(`^nav:[\\s\\S]*?^ view_site: ${label}$`, 'm'))
}
})
it('exposes --shell-offset: the rail, plus the section panel when it shows', async () => {
const wrapper = await mountShell('/acme/demo/widgets')
const root = wrapper.element as HTMLElement
expect(root.style.getPropertyValue('--shell-offset')).toBe('calc(var(--spacing-rail) + var(--spacing-panel))')
setCollapsed(true)
await flushPromises()
expect(root.style.getPropertyValue('--shell-offset')).toBe('var(--spacing-rail)')
setCollapsed(false)
await flushPromises()
expect(root.style.getPropertyValue('--shell-offset')).toBe('calc(var(--spacing-rail) + var(--spacing-panel))')
})
it('offsets by the rail alone without a section panel', async () => {
const wrapper = await mountShell('/settings')
expect((wrapper.element as HTMLElement).style.getPropertyValue('--shell-offset')).toBe('var(--spacing-rail)')
})
})