feat(ts): 实现 Polaris 可交互首页
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { describe, expect, it } from "vitest"
|
||||
|
||||
import { parseSidebarPreference } from "./sidebar-preference"
|
||||
|
||||
describe("侧栏持久化值", () => {
|
||||
it("解析显式布尔字符串", () => {
|
||||
expect(parseSidebarPreference("true", false)).toBe(true)
|
||||
expect(parseSidebarPreference("false", true)).toBe(false)
|
||||
})
|
||||
|
||||
it("损坏或缺失值回退设置默认值", () => {
|
||||
expect(parseSidebarPreference("collapsed", false)).toBe(false)
|
||||
expect(parseSidebarPreference(null, true)).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user