test: update conversation assembly coverage and docs

This commit is contained in:
imccyu
2026-08-09 15:48:56 +08:00
parent 6d09b3168d
commit 522acc7432
101 changed files with 3970 additions and 2295 deletions
@@ -7,6 +7,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
interface SlotMap {
'surface.a': { kind: 'single'; scope: 'root' }
'surface.b': { kind: 'single'; scope: 'root' }
'surface.injected': { kind: 'single'; scope: 'root'; inject: { token: string } }
}
}
@@ -28,6 +29,16 @@ describe('dynamic-key escape hatch', () => {
expect(core.spec('surface.b')).toBeUndefined()
})
it('records the parent-declared Slot inject on the runtime spec', () => {
const core = new SlotCore()
const inject = { token: 'shared' }
core.register({
name: 'root',
children: { 'surface.injected': { kind: 'single', scope: 'root', inject } },
}, Comp as never)
expect(core.spec('surface.injected')?.inject).toBe(inject)
})
it('entries/getVersion on an untouched key return the frozen empty array and 0', () => {
const core = new SlotCore()
expect(core.entries('surface.b')).toHaveLength(0)