22 lines
754 B
TypeScript
22 lines
754 B
TypeScript
import { theme } from 'antd'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { getInitialTheme, setTheme, themes } from '../../../src/design/theme'
|
|
|
|
describe('theme registry', () => {
|
|
it('uses Ant Design dark rendering for the blue scheme', () => {
|
|
expect(themes.blue.algorithm).toBe(theme.darkAlgorithm)
|
|
})
|
|
|
|
it('registers the blue and light visual schemes', () => {
|
|
expect(Object.keys(themes)).toEqual(['blue', 'light'])
|
|
})
|
|
|
|
it('persists a valid theme and ignores invalid stored values', () => {
|
|
setTheme('light')
|
|
expect(document.documentElement.dataset.theme).toBe('light')
|
|
expect(getInitialTheme()).toBe('light')
|
|
localStorage.setItem('safety-theme', 'unknown')
|
|
expect(getInitialTheme()).toBe('blue')
|
|
})
|
|
})
|