Files
orca/mobile/src/cache/worktree-cache.test.ts

16 lines
609 B
TypeScript

import { describe, expect, it } from 'vitest'
import { setCachedWorktrees, getCachedWorktrees } from './worktree-cache'
// A persisted cold-start seed must not truncate the rows a live worktree.ps listed.
describe('worktree-cache provenance', () => {
it('keeps a fresh host-listed catalog when a cold-start seed lands after it', () => {
const hostId = 'host-kept'
const listed = [{ worktreeId: 'a' }, { worktreeId: 'b' }]
setCachedWorktrees(hostId, listed, { proven: true })
setCachedWorktrees(hostId, [{ worktreeId: 'a' }])
expect(getCachedWorktrees(hostId)).toEqual(listed)
})
})