/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
e2e/delayError.spec.ts
55 строк
2 KB
Bill
🥗 migrate to playwright & fix delay error feature (#13589)
11 июл 2026, 12:39
Не верифицирован
11 июл 2026, 12:39
11bd6df
Код
Авторство
О чём код?
import { expect, test } from '@playwright/test'; import { type } from './utils'; test.describe('delayError', () => { test('should delay from errors appear', async ({ page }) => { await page.goto('/delayError'); const firstInput = page.locator('input[name="first"]'); const firstInputError = page.locator('input[name="first"] + p'); const lastInput = page.locator('input[name="last"]'); const lastInputError = page.locator('input[name="last"] + p'); await type(firstInput, '123'); await expect(firstInputError).toContainText('First too long.'); await type(lastInput, '123567'); await expect(lastInputError).toContainText('Last too long.'); await lastInput.blur(); await page.locator('button').click(); await type(firstInput, '123'); await type(lastInput, '123567'); await expect(firstInputError).toContainText('First too long.'); await expect(lastInputError).toContainText('Last too long.'); await firstInput.clear(); await type(firstInput, '1'); await lastInput.clear(); await type(lastInput, '12'); await lastInput.blur(); await expect(page.locator('p')).toHaveCount(0); await page.locator('button').click(); await type(firstInput, 'aa'); await type(lastInput, 'a'); await expect(firstInputError).toContainText('First too long.'); await expect(lastInputError).toContainText('Last too long.'); await firstInput.clear(); await type(firstInput, '1'); await lastInput.clear(); await type(lastInput, '12'); await lastInput.blur(); await expect(page.locator('p')).toHaveCount(0); }); });