@@ -1819,15 +1819,17 @@ test.describe('Actions', () => {
1819
1819
test ( 'use:enhance' , async ( { page } ) => {
1820
1820
await page . goto ( '/actions/enhance' ) ;
1821
1821
1822
- expect ( await page . textContent ( 'pre' ) ) . toBe ( JSON . stringify ( null ) ) ;
1822
+ expect ( await page . textContent ( 'pre.formdata1' ) ) . toBe ( JSON . stringify ( null ) ) ;
1823
+ expect ( await page . textContent ( 'pre.formdata2' ) ) . toBe ( JSON . stringify ( null ) ) ;
1823
1824
1824
1825
await page . type ( 'input[name="username"]' , 'foo' ) ;
1825
1826
await Promise . all ( [
1826
1827
page . waitForRequest ( ( request ) => request . url ( ) . includes ( '/actions/enhance' ) ) ,
1827
1828
page . click ( 'button.form1' )
1828
1829
] ) ;
1829
1830
1830
- await expect ( page . locator ( 'pre' ) ) . toHaveText ( JSON . stringify ( { result : 'foo' } ) ) ;
1831
+ await expect ( page . locator ( 'pre.formdata1' ) ) . toHaveText ( JSON . stringify ( { result : 'foo' } ) ) ;
1832
+ await expect ( page . locator ( 'pre.formdata2' ) ) . toHaveText ( JSON . stringify ( { result : 'foo' } ) ) ;
1831
1833
} ) ;
1832
1834
1833
1835
test ( 'use:enhance abort controller' , async ( { page, javaScriptEnabled } ) => {
@@ -1850,15 +1852,17 @@ test.describe('Actions', () => {
1850
1852
test ( 'use:enhance button with formAction' , async ( { page, app } ) => {
1851
1853
await page . goto ( '/actions/enhance' ) ;
1852
1854
1853
- expect ( await page . textContent ( 'pre' ) ) . toBe ( JSON . stringify ( null ) ) ;
1855
+ expect ( await page . textContent ( 'pre.formdata1 ' ) ) . toBe ( JSON . stringify ( null ) ) ;
1854
1856
1855
1857
await page . type ( 'input[name="username"]' , 'foo' ) ;
1856
1858
await Promise . all ( [
1857
1859
page . waitForRequest ( ( request ) => request . url ( ) . includes ( '/actions/enhance' ) ) ,
1858
1860
page . click ( 'button.form1-register' )
1859
1861
] ) ;
1860
1862
1861
- await expect ( page . locator ( 'pre' ) ) . toHaveText ( JSON . stringify ( { result : 'register: foo' } ) ) ;
1863
+ await expect ( page . locator ( 'pre.formdata1' ) ) . toHaveText (
1864
+ JSON . stringify ( { result : 'register: foo' } )
1865
+ ) ;
1862
1866
} ) ;
1863
1867
1864
1868
test ( 'redirect' , async ( { page } ) => {
0 commit comments