test(web): refresh affected snapshot fixtures

This commit is contained in:
imccyu
2026-07-29 22:08:16 +08:00
parent 354aeae35a
commit e0dd4028d0
3 changed files with 7 additions and 2 deletions

View File

@@ -143,7 +143,7 @@ it('projects titles and routes the next turn through the selected model in the b
// allowed for the next turn; stop the fixture's resident run before sending
// the route-report prompt.
fireEvent.click(screen.getByRole('button', { name: 'Stop generating' }))
const composer = await screen.findByPlaceholderText('Message the agent')
const composer = await screen.findByPlaceholderText('给智能体发消息')
fireEvent.change(composer, { target: { value: 'report model' } })
fireEvent.keyDown(composer, { key: 'Enter' })
await screen.findByText('当前模型openai/gpt-5 · 推理等级max', {}, { timeout: 10_000 })

View File

@@ -57,12 +57,16 @@ class ResizeObserverStub {
unobserve(): void {}
}
// jsdom has no scrollIntoView; the slash menu follows its highlighted option.
const scrollIntoView = vi.fn()
const win = window as FixtureWindow
let unmount: (() => void) | undefined
beforeEach(() => {
localStorage.clear()
document.title = 'DeepSeek Harness'
Element.prototype.scrollIntoView = scrollIntoView
scrollIntoView.mockClear()
vi.stubGlobal('ResizeObserver', ResizeObserverStub)
vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) =>
setTimeout(() => { callback(0) }, 0) as unknown as number)
@@ -80,6 +84,7 @@ afterEach(() => {
document.head.querySelectorAll('style[data-plugin]').forEach((style) => { style.remove() })
document.title = ''
history.replaceState(null, '', '/')
Reflect.deleteProperty(Element.prototype, 'scrollIntoView')
vi.unstubAllGlobals()
})

View File

@@ -196,7 +196,7 @@ it('hides the plan strip when the next turn starts', async () => {
await openFixtureSession()
expect(document.querySelector('[data-testid="todo-panel"]')).not.toBeNull()
const composer = await screen.findByPlaceholderText('Message the agent', {}, { timeout: 10_000 })
const composer = await screen.findByPlaceholderText('给智能体发消息', {}, { timeout: 10_000 })
fireEvent.change(composer, { target: { value: '下一轮清空计划' } })
fireEvent.keyDown(composer, { key: 'Enter' })