test(ui): close trajectory inspection gates

This commit is contained in:
_Kerman
2026-07-28 10:46:39 +08:00
parent 71f1f36175
commit 43d9fbaf08
7 changed files with 75 additions and 5 deletions

View File

@@ -37,9 +37,6 @@ function inlineText(node: MarkdownNode): string {
return '\n'
case 'html':
return ''
case 'thematicBreak':
case 'definition':
return ''
default:
return node.children?.map(inlineText).join('') ?? ''
}

View File

@@ -123,6 +123,7 @@ describe('Menu', () => {
render(
<Menu
open
compact
anchor={<span>trigger</span>}
items={[
{ id: 'a', label: 'Alpha', icon: <svg data-testid="ic" /> },
@@ -186,6 +187,7 @@ describe('Menu', () => {
render(
<Menu
open
compact
anchor={<span>trigger</span>}
items={[
{ id: 'plain', label: 'Plain' },

View File

@@ -39,4 +39,25 @@ describe('extractMarkdownPlainText', () => {
expect(extractMarkdownPlainText(markdown)).toBe('Safe heading')
expect(extractMarkdownPlainText(markdown, { mode: 'first-paragraph' })).toBe('Safe heading')
})
it('projects GFM tables, references, hard breaks, and block structure', () => {
const markdown = [
'> first\\',
'> second with ![diagram][asset] and <span>visible</span>',
'',
'---',
'',
'| Name | Value |',
'| --- | --- |',
'| alpha | `1` |',
'',
'[asset]: diagram.png',
].join('\n')
expect(extractMarkdownPlainText(markdown)).toBe([
'first second with diagram and visible',
'',
'Name\tValue',
'alpha\t1',
].join('\n'))
})
})

View File

@@ -47,6 +47,7 @@ describe('tsdown client artifact', () => {
const modules = new Map<string, unknown>([
['react', await import('react')],
['react/jsx-runtime', await import('react/jsx-runtime')],
['@deepseek-ai/dsh-client-ui-primitives', await import('@deepseek-ai/dsh-client-ui-primitives')],
])
const surface = handoff!.factory((spec) => {
if (!modules.has(spec)) throw new Error(`unexpected require: ${spec}`)