fix(ui-trajectory): preserve thinking label
This commit is contained in:
@@ -1232,7 +1232,7 @@ function MarkdownRecordContent({
|
|||||||
aria-expanded={thinkingExpanded}
|
aria-expanded={thinkingExpanded}
|
||||||
onClick={() => { onThinkingExpandedChange(!thinkingExpanded) }}
|
onClick={() => { onThinkingExpandedChange(!thinkingExpanded) }}
|
||||||
>
|
>
|
||||||
{thinkingExpanded ? 'Hide thinking' : 'Show thinking'}
|
Thinking
|
||||||
<IconChevronRightOutline14 className={css.thinkingChevron} size={12} />
|
<IconChevronRightOutline14 className={css.thinkingChevron} size={12} />
|
||||||
</button>
|
</button>
|
||||||
{thinkingExpanded && (
|
{thinkingExpanded && (
|
||||||
|
|||||||
@@ -101,12 +101,12 @@ describe('TrajectoryTable', () => {
|
|||||||
render(<TrajectoryTable turns={turns} {...FOLD_PROPS} />)
|
render(<TrajectoryTable turns={turns} {...FOLD_PROPS} />)
|
||||||
|
|
||||||
fireEvent.click(screen.getByRole('row', { name: /ASSISTANT/ }))
|
fireEvent.click(screen.getByRole('row', { name: /ASSISTANT/ }))
|
||||||
const toggle = screen.getByRole('button', { name: 'Show thinking' })
|
const toggle = screen.getByRole('button', { name: 'Thinking' })
|
||||||
expect(toggle.getAttribute('aria-expanded')).toBe('false')
|
expect(toggle.getAttribute('aria-expanded')).toBe('false')
|
||||||
expect(screen.queryByText(thinking)).toBeNull()
|
expect(screen.queryByText(thinking)).toBeNull()
|
||||||
|
|
||||||
fireEvent.click(toggle)
|
fireEvent.click(toggle)
|
||||||
expect(screen.getByRole('button', { name: 'Hide thinking' })).toBe(toggle)
|
expect(screen.getByRole('button', { name: 'Thinking' })).toBe(toggle)
|
||||||
expect(toggle.getAttribute('aria-expanded')).toBe('true')
|
expect(toggle.getAttribute('aria-expanded')).toBe('true')
|
||||||
expect(toggle.parentElement?.textContent?.length).toBeGreaterThan(thinking.length)
|
expect(toggle.parentElement?.textContent?.length).toBeGreaterThan(thinking.length)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user