fix(web): keep trajectory toolbar Duration/Turns/Calls/Export untranslated
Show the four toolbar terms in English even in the Simplified Chinese dictionary, including their tooltips, aria labels, and the export failure message, and update the pinned-zh specs to match.
This commit is contained in:
@@ -39,7 +39,7 @@ describe('TrajectoryToolbar export', () => {
|
||||
it('renders the export button and dispatches the export callback on click', () => {
|
||||
const onExport = vi.fn()
|
||||
render(<TrajectoryToolbar {...baseProps({ onExport })} />)
|
||||
const button = screen.getByRole('button', { name: '导出会话日志' })
|
||||
const button = screen.getByRole('button', { name: 'Export session log' })
|
||||
fireEvent.click(button)
|
||||
expect(onExport).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
@@ -47,15 +47,15 @@ describe('TrajectoryToolbar export', () => {
|
||||
it('disables the button while an export is in flight and blocks dispatch', () => {
|
||||
const onExport = vi.fn()
|
||||
render(<TrajectoryToolbar {...baseProps({ exporting: true, onExport })} />)
|
||||
const button = screen.getByRole('button', { name: '导出会话日志' }) as HTMLButtonElement
|
||||
const button = screen.getByRole('button', { name: 'Export session log' }) as HTMLButtonElement
|
||||
expect(button.disabled).toBe(true)
|
||||
fireEvent.click(button)
|
||||
expect(onExport).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('surfaces an export failure as the button title', () => {
|
||||
render(<TrajectoryToolbar {...baseProps({ exportError: '导出失败:internal boom' })} />)
|
||||
const button = screen.getByRole('button', { name: '导出会话日志' })
|
||||
expect(button.title).toBe('导出失败:internal boom')
|
||||
render(<TrajectoryToolbar {...baseProps({ exportError: 'Export failed: internal boom' })} />)
|
||||
const button = screen.getByRole('button', { name: 'Export session log' })
|
||||
expect(button.title).toBe('Export failed: internal boom')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user