Why: The first S4 pass makes the project the navigation context, keeps deep views in one overlay, and leaves domain panels empty until a plugin declares them. Evidence: npx tsc -b and npm test (61 passed) in modules/frontend. Impact: Top bar, project sidebar, inbox all/todo filter, one-way scroll sync, drag-and-drop on the whole chat column, and local molv/system themes. Refs: feature/s4-shell-overhaul Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
918 B
TypeScript
26 lines
918 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { projectStage } from '../src/projectmeta'
|
|
import { resolveTheme } from '../src/theme'
|
|
|
|
describe('resolveTheme', () => {
|
|
it('跟随系统只在深色与浅色之间解析', () => {
|
|
expect(resolveTheme('system', true)).toBe('dark')
|
|
expect(resolveTheme('system', false)).toBe('light')
|
|
})
|
|
|
|
it('墨绿与浅色原样上屏,未知值回落深色', () => {
|
|
expect(resolveTheme('molv', true)).toBe('molv')
|
|
expect(resolveTheme('light', true)).toBe('light')
|
|
expect(resolveTheme('nope', false)).toBe('dark')
|
|
})
|
|
})
|
|
|
|
describe('projectStage', () => {
|
|
it('只在 settings.stage 是非空字符串时显示', () => {
|
|
expect(projectStage({ stage: '设计输入' })).toBe('设计输入')
|
|
expect(projectStage({ stage: ' ' })).toBeNull()
|
|
expect(projectStage({ stage: 3 })).toBeNull()
|
|
expect(projectStage(undefined)).toBeNull()
|
|
})
|
|
})
|