@@ -1871,31 +1871,38 @@ test.describe('remote functions', () => {
18711871
18721872 await page . goto ( '/remote/form/validate' ) ;
18731873
1874+ const myForm = page . locator ( 'form#my-form' ) ;
18741875 const foo = page . locator ( 'input[name="foo"]' ) ;
18751876 const bar = page . locator ( 'input[name="bar"]' ) ;
18761877 const submit = page . locator ( 'button:has-text("imperative validation")' ) ;
18771878
18781879 await foo . fill ( 'a' ) ;
1879- await expect ( page . locator ( 'form' ) ) . not . toContainText ( 'Invalid type: Expected' ) ;
1880+ await expect ( myForm ) . not . toContainText ( 'Invalid type: Expected' ) ;
18801881
18811882 await bar . fill ( 'g' ) ;
1882- await expect ( page . locator ( 'form' ) ) . toContainText (
1883- 'Invalid type: Expected ("d" | "e") but received "g"'
1884- ) ;
1883+ await expect ( myForm ) . toContainText ( 'Invalid type: Expected ("d" | "e") but received "g"' ) ;
18851884
18861885 await bar . fill ( 'd' ) ;
1887- await expect ( page . locator ( 'form' ) ) . not . toContainText ( 'Invalid type: Expected' ) ;
1886+ await expect ( myForm ) . not . toContainText ( 'Invalid type: Expected' ) ;
18881887
18891888 await page . locator ( '#trigger-validate' ) . click ( ) ;
1890- await expect ( page . locator ( 'form' ) ) . toContainText (
1889+ await expect ( myForm ) . toContainText (
18911890 'Invalid type: Expected "submitter" but received "incorrect_value"'
18921891 ) ;
18931892
18941893 // Test imperative validation
18951894 await foo . fill ( 'c' ) ;
18961895 await bar . fill ( 'd' ) ;
18971896 await submit . click ( ) ;
1898- await expect ( page . locator ( 'form' ) ) . toContainText ( 'Imperative: foo cannot be c' ) ;
1897+ await expect ( myForm ) . toContainText ( 'Imperative: foo cannot be c' ) ;
1898+
1899+ const nestedValue = page . locator ( 'input[name="nested.value"]' ) ;
1900+ const validate = page . locator ( 'button#validate' ) ;
1901+ const allIssues = page . locator ( '#allIssues' ) ;
1902+
1903+ await nestedValue . fill ( 'in' ) ;
1904+ await validate . click ( ) ;
1905+ await expect ( allIssues ) . toContainText ( '"path":["nested","value"]' ) ;
18991906 } ) ;
19001907
19011908 test ( 'form inputs excludes underscore-prefixed fields' , async ( { page, javaScriptEnabled } ) => {
0 commit comments