fix(a11y): label dialog close buttons (#654)

This commit is contained in:
InfinityPacer
2026-08-10 06:53:56 +08:00
committed by GitHub
parent e6b26cc831
commit 309ce3c92e
3 changed files with 49 additions and 5 deletions
@@ -220,7 +220,9 @@ describe('SiteImportDialog', () => {
await fireEvent.click(await screen.findByRole('button', { name: '开始导入' }))
expect(await screen.findByText('导入过程中出现 1 个错误')).toBeInTheDocument()
await fireEvent.click(screen.getByRole('button', { name: '关闭' }))
const resultCloseButton = screen.getByText('关闭').closest('button')
expect(resultCloseButton).not.toBeNull()
await fireEvent.click(resultCloseButton!)
expect(events.update).toHaveBeenCalledWith(false)
expect(events.importSuccess).not.toHaveBeenCalled()
})