test(trajectory): await locale readiness in bundle fixture

This commit is contained in:
Tianyi Cui committed 2026-10-05 12:08:10 +08:00
1 parent f230806884
commit ef29f117da
1 file changed
+3 -2
@@ -11,7 +11,7 @@ import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { Context } from '@deepseek-ai/cordis'
import { stubConfigForm } from '@deepseek-ai/dsh-client-test-runtime'
import { afterEach, describe, expect, it } from 'vitest'
import { afterEach, describe, expect, it, onTestFinished } from 'vitest'
import { UiConversation } from '@deepseek-ai/dsh-client-ui-conversation/client'
import { SlotRegistry } from '@deepseek-ai/dsh-client-ui-renderer/client'
@@ -73,6 +73,7 @@ describe('tsdown client artifact', () => {
it.skipIf(code === undefined)('mounted as an object plugin, apply registers the view tab on the real ring', async () => {
const { exports } = await loadArtifact()
const ctx = new Context()
onTestFinished(() => ctx.fiber.dispose())
const slots = new SlotRegistry(ctx)
ctx.provide('uiSession', { provide: () => () => {} } as never)
// The conversation entry's role: the ring must be declared before riders land.
@@ -92,7 +93,7 @@ describe('tsdown client artifact', () => {
ctx.provide('remote', { $on: () => () => {} } as never)
ctx.provide('configForms', { developerTools: { enabled: createSnapshotStore(true) }, get: () => stubConfigForm().scope } as never)
const locale = await import('@deepseek-ai/dsh-client-locale/client')
ctx.plugin({ inject: [...locale.inject], apply: locale.apply })
await ctx.plugin({ inject: [...locale.inject], apply: locale.apply })
const fiber = ctx.plugin(exports as { apply: (ctx: Context) => void })
await fiber.await()
expect(slots.entries('conversation.view').map(e => e.options.id)).toEqual(['trajectory'])