test: expand FSM path pool to exercise LRU eviction and assert metadata on reset

Address review feedback:
- Expand pathPool from 6 to 35 paths (exceeds MAX_DRAFTS=32) to exercise LRU eviction
- Assert name and isTemporary fields in ResetCommand, not just data

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
dante01yoon
2026-03-04 17:55:48 +09:00
parent e348e61d5c
commit 1e31873a66

View File

@@ -254,6 +254,8 @@ class ResetCommand implements Command<PersistenceModel, PersistenceReal> {
const draft = real.draftStore.getDraft(path)
expect(draft, `Draft lost after reset: ${path}`).not.toBeNull()
expect(draft!.data).toBe(expected.data)
expect(draft!.name).toBe(expected.name)
expect(draft!.isTemporary).toBe(expected.isTemporary)
}
assertIndexPayloadConsistency()
}
@@ -278,13 +280,9 @@ describe('workflowDraftStoreV2 FSM', () => {
sessionStorage.clear()
})
// 33+ unique paths to exceed MAX_DRAFTS (32) and exercise LRU eviction
const pathPool = fc.constantFrom(
'workflows/a.json',
'workflows/b.json',
'workflows/c.json',
'workflows/d.json',
'workflows/e.json',
'workflows/f.json'
...Array.from({ length: 35 }, (_, i) => `workflows/${i}.json`)
)
const dataPool = fc.constantFrom(