diff --git a/tests/auth-login-contract.spec.ts b/tests/auth-login-contract.spec.ts index e3fa6b8..1572af2 100644 --- a/tests/auth-login-contract.spec.ts +++ b/tests/auth-login-contract.spec.ts @@ -357,11 +357,14 @@ test.describe('登录上下文 UI 契约', () => { await expect(page.locator('.login-password-toggle')).toBeVisible() await expect(page.locator('.login-password-toggle svg')).toHaveCount(1) await expect(page.locator('.login-password-toggle')).toHaveAttribute('aria-label', '显示密码') + await expect(page.locator('[data-password-visibility-icon="hidden"]')).toBeVisible() await page.locator('.login-password-toggle').click() await expect(passwordInput(page)).toHaveAttribute('type', 'text') await expect(page.locator('.login-password-toggle')).toHaveAttribute('aria-label', '隐藏密码') + await expect(page.locator('[data-password-visibility-icon="visible"]')).toBeVisible() await page.locator('.login-password-toggle').click() await expect(passwordInput(page)).toHaveAttribute('type', 'password') + await expect(page.locator('[data-password-visibility-icon="hidden"]')).toBeVisible() expect(await adminUsernameInput(page).getAttribute('list')).toBeNull() await expect(page.locator('datalist')).toHaveCount(0) await expect(page.locator('select[name*="user" i], select[name*="account" i]')).toHaveCount(0)