hololake-system-architecture/product-source/hololake-platform/src/lib/guanghuTheme.test.ts

41 lines
1.3 KiB
TypeScript
Raw Normal View History

import { describe, expect, it } from 'vitest'
import {
GUANGHU_THEMES,
normalizeGuanghuTheme,
readGuanghuTheme,
} from './guanghuTheme'
describe('guanghuTheme', () => {
it('keeps the companion theme choices explicit and stable', () => {
expect(GUANGHU_THEMES).toEqual([
'native',
'guanghu-native-galaxy',
'lake-light',
'lake-dark',
'aurora-dark',
'ice-heart',
'yaoming-purple',
'starfield-indigo',
'dawn-gold',
'tundra-green',
'peach-mist',
])
})
it('falls back to the native Tolaria theme for unknown values', () => {
expect(normalizeGuanghuTheme('old-blue-skin')).toBe('native')
expect(normalizeGuanghuTheme(null)).toBe('native')
})
it('starts a new installation with the Guanghu native galaxy theme', () => {
expect(readGuanghuTheme({ getItem: () => null })).toBe('guanghu-native-galaxy')
})
it('accepts every supported companion theme', () => {
expect(normalizeGuanghuTheme('guanghu-native-galaxy')).toBe('guanghu-native-galaxy')
expect(normalizeGuanghuTheme('lake-light')).toBe('lake-light')
expect(normalizeGuanghuTheme('lake-dark')).toBe('lake-dark')
expect(normalizeGuanghuTheme('yaoming-purple')).toBe('yaoming-purple')
expect(normalizeGuanghuTheme('dawn-gold')).toBe('dawn-gold')
})
})