fix: fix e2e errors of dialog-select and modal (#4256)

* fix: fix dialog-select  e2e error

* fix: 修改model-event e2e测试

* fix: 还原文件
This commit is contained in:
申君健 2026-07-23 14:41:28 +08:00 committed by GitHub
parent c94102a989
commit c6783e2b7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,8 @@ test('dialogSelect 设置多选状态', async ({ page }) => {
const trs = await page.locator('.tiny-grid table tbody tr').all()
for (let i = 0; i < trs.length; i++) {
const classes = await trs[i].getAttribute('class')
if (i === 1) {
// 第1行2行都选被中
if (i === 0 || i === 1) {
expect(classes?.includes('row__selected')).toBeTruthy()
} else {
expect(classes?.includes('row__selected')).toBeFalsy()

View File

@ -10,6 +10,6 @@ test('弹窗的事件', async ({ page }) => {
await expect(content.nth(1)).toHaveText(/cancel 事件触发了/)
await page.getByRole('button', { name: '打开带事件弹窗' }).nth(1).click()
await page.getByRole('button', { name: '确定' }).click()
await expect(content.nth(2)).toHaveText(/hide 事件触发了/)
await expect(content.nth(2)).toHaveText(/confirm 事件触发了/)
await expect(content.filter({ hasText: /hide 事件触发了/ })).toBeVisible()
await expect(content.filter({ hasText: /confirm 事件触发了/ })).toBeVisible()
})