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:
@@ -8,6 +8,7 @@ import App from '../src/App.vue'
|
||||
import { createAdminRouter } from '../src/app/router'
|
||||
import { setBundle } from '../src/app/i18n'
|
||||
import { clearUser, me } from '../src/state/useAuth'
|
||||
import { applyProfilePreferences } from '../src/state/usePreferences'
|
||||
import { clearRecordCrumb } from '../src/state/useBreadcrumbs'
|
||||
import { loadNavigation, setNavigation } from '../src/state/useNavigation'
|
||||
import { setSettings } from '../src/state/useSettings'
|
||||
@@ -158,7 +159,7 @@ export function fakeMedia(initial: Record<string, boolean>) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Module state back to a signed-out, Polish-strings start. */
|
||||
/** Module state back to a signed-out, Polish-strings, system-theme start. */
|
||||
export function resetState(): void {
|
||||
clearUser()
|
||||
setNavigation([])
|
||||
@@ -166,6 +167,9 @@ export function resetState(): void {
|
||||
clearToasts()
|
||||
clearRecordCrumb()
|
||||
setBundle(langFixture.data, 'pl')
|
||||
// Theme back to system and no stored admin language (runs synchronously:
|
||||
// an empty locale never awaits).
|
||||
void applyProfilePreferences(profile.data)
|
||||
window.localStorage.clear()
|
||||
// Re-reads the (cleared) preference and the desktop viewport of setup.ts,
|
||||
// so a narrow or collapsed sidebar never leaks into the next test.
|
||||
|
||||
Reference in New Issue
Block a user