Просмотр исходного кода

test(web): give the browse-dialog snapshot finds the lane's standard 10s timeout

CI's cold jsdom needs more than findByRole's 1s default between opening the
dialog and the fixture listing's first paint; the surrounding helpers already
wait 10s.
creatixchu 2 месяцев назад
Родитель
Сommit
0d9ac53fb0
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      apps/web/tests/workspace-flow.snapshot.ts

+ 3 - 3
apps/web/tests/workspace-flow.snapshot.ts

@@ -196,9 +196,9 @@ it('adopts a directory through the composed in-app browse flow and lands in its
   fireEvent.click(within(menu).getByRole('menuitem', { name: 'Open local folder…' }))
   // The browse occupant renders the Select Workspace Directory dialog at the
   // fixture home; select Documents, advance into project, and adopt it.
-  const dialog = await screen.findByRole('dialog', { name: '选择工作区目录' })
-  fireEvent.click(await within(dialog).findByRole('listitem', { name: /Documents/ }))
-  fireEvent.click(await within(dialog).findByRole('listitem', { name: /^project/ }))
+  const dialog = await screen.findByRole('dialog', { name: '选择工作区目录' }, { timeout: 10_000 })
+  fireEvent.click(await within(dialog).findByRole('listitem', { name: /Documents/ }, { timeout: 10_000 }))
+  fireEvent.click(await within(dialog).findByRole('listitem', { name: /^project/ }, { timeout: 10_000 }))
   fireEvent.click(within(dialog).getByRole('button', { name: '打开' }))
   await findHeroComposer()
   await waitFor(() => {