Import the client, server, skills, tests, and build scripts as the starting point for the rebuild, then trim the surfaces this project does not ship: Electron desktop packaging, the marketing website, and the ESP32 firmware tree. CI keeps the web build, e2e, lockfile, release, and Docker workflows. Rename the package and CLI entry points to hermes-ui, drop the prepare hook so npm ci no longer triggers a build, and drop the removed tsconfig and nodemon references. Rewrite AGENTS.md, ARCHITECTURE.md, DEVELOPMENT.md, and the READMEs so the documented package map and hard rules match this repository. reference_code/ is ignored: it is a read-only snapshot, not an input to the build.
29 lines
948 B
TypeScript
29 lines
948 B
TypeScript
// @vitest-environment jsdom
|
|
import { beforeEach, describe, expect, it } from 'vitest'
|
|
import { usePersistentRecord } from '@/composables/usePersistentRecord'
|
|
|
|
describe('usePersistentRecord', () => {
|
|
beforeEach(() => localStorage.clear())
|
|
|
|
it('loads saved record and persists updates', () => {
|
|
localStorage.setItem('hermes.sidebar.collapsedGroups', JSON.stringify({ agent: true }))
|
|
const state = usePersistentRecord('hermes.sidebar.collapsedGroups')
|
|
|
|
expect(state.record.agent).toBe(true)
|
|
state.record.system = true
|
|
state.persist()
|
|
|
|
expect(JSON.parse(localStorage.getItem('hermes.sidebar.collapsedGroups') || '{}')).toEqual({
|
|
agent: true,
|
|
system: true,
|
|
})
|
|
})
|
|
|
|
it('ignores invalid stored values', () => {
|
|
localStorage.setItem('hermes.sidebar.collapsedGroups', 'not-json')
|
|
const state = usePersistentRecord('hermes.sidebar.collapsedGroups')
|
|
|
|
expect({ ...state.record }).toEqual({})
|
|
})
|
|
})
|