Преглед изворни кода

test(web): refresh affected snapshot fixtures

imccyu пре 1 месец
родитељ
комит
e0dd4028d0

+ 1 - 1
apps/web/tests/session-title.snapshot.ts

@@ -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 })

+ 5 - 0
apps/web/tests/slash-flow.snapshot.ts

@@ -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()
 })
 

+ 1 - 1
apps/web/tests/todo-display.snapshot.ts

@@ -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' })