test(web): align trajectory client-bundle spec with the sessionHistory injection
This commit is contained in:
@@ -60,7 +60,7 @@ describe('tsdown client artifact', () => {
|
|||||||
const { handoff, surface } = await loadArtifact()
|
const { handoff, surface } = await loadArtifact()
|
||||||
expect(handoff.id).toBe(PLUGIN_ID)
|
expect(handoff.id).toBe(PLUGIN_ID)
|
||||||
expect(surface.apply).toBeTypeOf('function')
|
expect(surface.apply).toBeTypeOf('function')
|
||||||
expect(surface.inject).toEqual(['slots', 'conversation', 'sessions'])
|
expect(surface.inject).toEqual(['slots', 'conversation', 'sessionHistory'])
|
||||||
})
|
})
|
||||||
|
|
||||||
it.skipIf(code === undefined)('mounted as an object plugin, apply registers the view tab on the real ring', async () => {
|
it.skipIf(code === undefined)('mounted as an object plugin, apply registers the view tab on the real ring', async () => {
|
||||||
@@ -72,10 +72,11 @@ describe('tsdown client artifact', () => {
|
|||||||
name: 'root',
|
name: 'root',
|
||||||
children: { 'conversation.view': { kind: 'list', scope: 'session' } },
|
children: { 'conversation.view': { kind: 'list', scope: 'session' } },
|
||||||
}, (_p: { renderSlot?: unknown }) => null)
|
}, (_p: { renderSlot?: unknown }) => null)
|
||||||
// The plugin injects 'conversation' as an ordering edge and 'sessions'
|
// The plugin injects 'conversation' as an ordering edge and
|
||||||
// for its per-session history callback; this bench supplies both.
|
// 'sessionHistory' for its per-session history callback; this bench
|
||||||
|
// supplies both.
|
||||||
ctx.provide('conversation', {})
|
ctx.provide('conversation', {})
|
||||||
ctx.provide('sessions', {})
|
ctx.provide('sessionHistory', {})
|
||||||
const fiber = ctx.plugin(surface as { apply: (ctx: Context) => void })
|
const fiber = ctx.plugin(surface as { apply: (ctx: Context) => void })
|
||||||
await fiber.await()
|
await fiber.await()
|
||||||
expect(slots.entries('conversation.view').map(e => e.options.id)).toEqual(['trajectory'])
|
expect(slots.entries('conversation.view').map(e => e.options.id)).toEqual(['trajectory'])
|
||||||
|
|||||||
Reference in New Issue
Block a user