diff --git a/packages/e2e-tests/specs/blocks/__snapshots__/table.test.js.snap b/packages/e2e-tests/specs/blocks/__snapshots__/table.test.js.snap index 955d6f95e06fd..7a7a911a0b8a9 100644 --- a/packages/e2e-tests/specs/blocks/__snapshots__/table.test.js.snap +++ b/packages/e2e-tests/specs/blocks/__snapshots__/table.test.js.snap @@ -1,5 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Table allows a caption to be added 1`] = ` +" +
Caption!
+" +`; + exports[`Table allows header and footer rows to be switched on and off 1`] = ` "
header
body
footer
diff --git a/packages/e2e-tests/specs/blocks/table.test.js b/packages/e2e-tests/specs/blocks/table.test.js index 3a61f5e5eda59..de2f83f5cda0a 100644 --- a/packages/e2e-tests/specs/blocks/table.test.js +++ b/packages/e2e-tests/specs/blocks/table.test.js @@ -113,4 +113,19 @@ describe( 'Table', () => { // Expect the table to have only a body with written content. expect( await getEditedPostContent() ).toMatchSnapshot(); } ); + + it( 'allows a caption to be added', async () => { + await insertBlock( 'Table' ); + + // Create the table. + const createButton = await page.$x( "//div[@data-type='core/table']//button[text()='Create']" ); + await createButton[ 0 ].click(); + + // Click the first cell and add some text. + await page.click( '.wp-block-table__caption-content' ); + await page.keyboard.type( 'Caption!' ); + + // Expect the post to have the correct written content inside the table. + expect( await getEditedPostContent() ).toMatchSnapshot(); + } ); } );