feat: animate completed items out
ci / gitleaks (push) Successful in 7s
ci / docker (push) Successful in 3m25s

This commit is contained in:
2026-09-11 08:56:51 +08:00
parent 36952fdbcc
commit 8b475e4df5
7 changed files with 121 additions and 22 deletions
+25
View File
@@ -78,6 +78,31 @@ describe('request generation protection', () => {
await Promise.all([first, second])
})
it('waits for current-context success work before refreshing', async () => {
const events: string[] = []
let releaseExit!: () => void
const reconciler = createMutationReconciler(
() => ({ view: 'today' }),
(left, right) => left.view === right.view,
async () => { events.push('refresh') },
)
const mutation = reconciler.run(
async () => 'done',
() => events.push('success'),
undefined,
async () => {
events.push('exit:start')
await new Promise<void>((resolve) => { releaseExit = resolve })
events.push('exit:end')
},
)
await Promise.resolve()
expect(events).toEqual(['success', 'exit:start'])
releaseExit()
await mutation
expect(events).toEqual(['success', 'exit:start', 'exit:end', 'refresh'])
})
it('refreshes again when the first refresh finishes before the second mutation commits', async () => {
const events: string[] = []
const context = { view: 'today' }