/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
e2e/setValueWithSchema.spec.ts
41 строка
1 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('form setValue with schema', () => { test('should set input value, trigger validation and clear all errors', async ({ page, }) => { await page.goto('/setValueWithSchema'); await type(page.locator('input[name="firstName"]'), 'a'); await expect(page.locator('input[name="firstName"] + p')).toContainText( 'firstName error', ); await expect(page.locator('p')).toHaveCount(1); await type(page.locator('input[name="firstName"]'), 'asdasdasdasd'); await type(page.locator('input[name="lastName"]'), 'a'); await expect(page.locator('input[name="lastName"] + p')).toContainText( 'lastName error', ); await expect(page.locator('p')).toHaveCount(1); await type(page.locator('input[name="lastName"]'), 'asdasdasdasd'); await type(page.locator('input[name="age"]'), 'a2323'); await page.locator('#submit').click(); await expect(page.locator('p')).toHaveCount(1); await expect(page.locator('input[name="requiredField"] + p')).toContainText( 'RequiredField error', ); await page.locator('#setValue').click(); await expect(page.locator('input[name="requiredField"]')).toHaveValue( 'test123456789', ); await expect(page.locator('p')).toHaveCount(0); await expect(page.locator('#renderCount')).toContainText('35'); }); });