fix(test): inject locale settings dependencies
This commit is contained in:
@@ -16,7 +16,7 @@ import type {
|
|||||||
ConversationTimelineSnapshot, ConversationTurnDataMap, ConversationViewDefinition,
|
ConversationTimelineSnapshot, ConversationTurnDataMap, ConversationViewDefinition,
|
||||||
ConversationViewNode, ToolResultNode, TurnLocation,
|
ConversationViewNode, ToolResultNode, TurnLocation,
|
||||||
} from '@deepseek-ai/dsh-client-runtime/client'
|
} from '@deepseek-ai/dsh-client-runtime/client'
|
||||||
import { apply as applyLocale } from '@deepseek-ai/dsh-client-locale/client'
|
import { apply as applyLocale, inject as localeInject } from '@deepseek-ai/dsh-client-locale/client'
|
||||||
import type { ChatFileMentions, TurnTailOwnerProps } from '@deepseek-ai/dsh-client-ui-conversation/client'
|
import type { ChatFileMentions, TurnTailOwnerProps } from '@deepseek-ai/dsh-client-ui-conversation/client'
|
||||||
import { makeTranslate, stubSettingsScope } from '@deepseek-ai/dsh-client-test-runtime'
|
import { makeTranslate, stubSettingsScope } from '@deepseek-ai/dsh-client-test-runtime'
|
||||||
import { ProducedFiles } from '../src/client/ProducedFiles.tsx'
|
import { ProducedFiles } from '../src/client/ProducedFiles.tsx'
|
||||||
@@ -344,7 +344,7 @@ describe('plugin registration', () => {
|
|||||||
// ui-theme's Appearance row binds a durable scope through these two.
|
// ui-theme's Appearance row binds a durable scope through these two.
|
||||||
ctx.provide('remote', { $on: () => () => {} } as never)
|
ctx.provide('remote', { $on: () => () => {} } as never)
|
||||||
ctx.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
ctx.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
await ctx.plugin({ inject: ['slots'], apply: applyLocale }).await()
|
await ctx.plugin({ inject: localeInject, apply: applyLocale }).await()
|
||||||
|
|
||||||
const fiber = ctx.plugin({ inject: [...inject], apply })
|
const fiber = ctx.plugin({ inject: [...inject], apply })
|
||||||
await fiber.await()
|
await fiber.await()
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import type {
|
|||||||
ChatConversationViewNode, ConversationEventInput, ConversationMatch, ConversationNodeDefinition,
|
ChatConversationViewNode, ConversationEventInput, ConversationMatch, ConversationNodeDefinition,
|
||||||
ConversationViewDefinition, SessionId, SessionListState,
|
ConversationViewDefinition, SessionId, SessionListState,
|
||||||
} from '@deepseek-ai/dsh-client-runtime/client'
|
} from '@deepseek-ai/dsh-client-runtime/client'
|
||||||
import { apply as applyLocale } from '@deepseek-ai/dsh-client-locale/client'
|
import { apply as applyLocale, inject as localeInject } from '@deepseek-ai/dsh-client-locale/client'
|
||||||
import { makeTranslate } from '@deepseek-ai/dsh-client-test-runtime'
|
import { makeTranslate, stubSettingsScope } from '@deepseek-ai/dsh-client-test-runtime'
|
||||||
import {
|
import {
|
||||||
WorkflowRunPanel, type WorkflowRunInjected, type WorkflowRunPanelProps,
|
WorkflowRunPanel, type WorkflowRunInjected, type WorkflowRunPanelProps,
|
||||||
} from '../src/client/WorkflowRunPanel.tsx'
|
} from '../src/client/WorkflowRunPanel.tsx'
|
||||||
@@ -481,13 +481,15 @@ describe('plugin lifecycle', () => {
|
|||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(SlotsService).await()
|
await ctx.plugin(SlotsService).await()
|
||||||
ctx.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
ctx.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
||||||
|
ctx.provide('remote', { $on: () => () => {} } as never)
|
||||||
|
ctx.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
await ctx.plugin(ConversationEventRegistry).await()
|
await ctx.plugin(ConversationEventRegistry).await()
|
||||||
await ctx.plugin(TestSessions).await()
|
await ctx.plugin(TestSessions).await()
|
||||||
ctx.slots.register({
|
ctx.slots.register({
|
||||||
name: 'root',
|
name: 'root',
|
||||||
children: { 'conversation.chat.node': { kind: 'keyed', scope: 'session' } },
|
children: { 'conversation.chat.node': { kind: 'keyed', scope: 'session' } },
|
||||||
} as never, () => null)
|
} as never, () => null)
|
||||||
await ctx.plugin({ inject: ['slots'], apply: applyLocale }).await()
|
await ctx.plugin({ inject: localeInject, apply: applyLocale }).await()
|
||||||
const fiber = ctx.plugin({ inject: [...inject], apply })
|
const fiber = ctx.plugin({ inject: [...inject], apply })
|
||||||
await fiber.await()
|
await fiber.await()
|
||||||
expect(ctx.conversationEvents.entries().map(entry => entry.kind)).toEqual(['workflow-run'])
|
expect(ctx.conversationEvents.entries().map(entry => entry.kind)).toEqual(['workflow-run'])
|
||||||
|
|||||||
Reference in New Issue
Block a user