style(test): align reasoning fixtures with lint rules

This commit is contained in:
imccyu committed 2026-10-09 01:59:37 +08:00
1 parent 6576ff5bf1
commit 70caea2ee3
3 files changed
+8 -5

No files matched your search

@@ -70,7 +70,7 @@ describe('reasoning Content Factory', () => {
const view = b.render(b.renderSlot('conversation.chat.reasoning.body', { text: 'Original thought', running: false }))
expect(view.getByText('Original thought')).toBeTruthy()
expect(b.runtime.slots.entries('conversation.chat.reasoning.body')[0]?.options.priority).toBe(100)
const plugin = await b.runtime.mount({ inject: ['slots'], apply: ctx => {
const plugin = await b.runtime.mount({ inject: ['slots'], apply: (ctx) => {
ctx.slots.inject('conversation.chat.reasoning.body', () => ctx.slots.register({
name: 'conversation.chat.reasoning.body',
}, WrappedBody))
@@ -41,9 +41,11 @@ export async function createReasoningRenderFixture(language = 'zh') {
})
const owner = await runtime.mount({
inject: ['slots'],
apply: ctx => registerChatNodeRenderers(ctx,
createSnapshotStore<PerformanceUsageMode>('detailed'),
derivePresentationPolicy(createSnapshotStore<TranscriptViewMode>('detailed'))),
apply: (ctx) => {
registerChatNodeRenderers(ctx,
createSnapshotStore<PerformanceUsageMode>('detailed'),
derivePresentationPolicy(createSnapshotStore<TranscriptViewMode>('detailed')))
},
})
await runtime.sessions.add({ id: 'reasoning-fixture' })
const session = runtime.sessions.retainFor(runtime.ctx, SessionId('reasoning-fixture'))
@@ -48,7 +48,8 @@ describe('ReasoningRow', () => {
['First\r\n \t\r\nNext complete\r\n', 'Next complete'],
['First\n\n\n', 'First'],
])('previews the completed paragraph first line for %j', (text, summary) => {
const view = render(<ReasoningRow renderSlot={renderSlot} useDisclosure={useDisclosure} text={text} running usePresentation={useDetailedPresentation} t={t} />)
const view = render(<ReasoningRow renderSlot={renderSlot} useDisclosure={useDisclosure}
text={text} running usePresentation={useDetailedPresentation} t={t} />)
const root = view.container.querySelector('[data-variant="think"]')!
expect(root.querySelector('[class*="summaryText"]')?.textContent).toBe(summary)
expect(root.hasAttribute('data-preview')).toBe(summary !== '')