first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user