test(client): cover the fixture noteAgentPreset write-back; refresh the module graph

The stub's confirmed-switch write-back landed with the header-label work
but nothing exercised it, and the module graph regen after the master
merge had been swallowed by a silenced generator run.
This commit is contained in:
Yichen Jiang
2026-08-09 00:52:38 +08:00
parent 6451ea0ea2
commit 236fe9759d
2 changed files with 16 additions and 2 deletions

View File

@@ -220,6 +220,13 @@ describe('sessions', () => {
.toMatchObject({ displayTitle: 'renamed', running: true })
runtime.sessions.setSubagentCatalogOpen('s2' as SessionId, true)
await runtime.sessions.refreshSubagents('s2' as SessionId)
// The confirmed-switch write-back lands on the row it names and ignores
// one the fixture never added, exactly as production's list upsert does.
runtime.sessions.noteAgentPreset('s1' as SessionId, 'minimal')
runtime.sessions.noteAgentPreset('missing' as SessionId, 'minimal')
await runtime.flush()
expect(runtime.sessions.list.getSnapshot().byId['s1' as SessionId])
.toMatchObject({ agentPreset: 'minimal' })
runtime.sessions.open('s1' as SessionId)
await runtime.flush()
expect(runtime.sessions.list.getSnapshot().current).toBe('s1')