diff --git a/src/blocks/test/e2e/blocks/timeline.spec.js b/src/blocks/test/e2e/blocks/timeline.spec.js new file mode 100644 index 000000000..a3371afeb --- /dev/null +++ b/src/blocks/test/e2e/blocks/timeline.spec.js @@ -0,0 +1,29 @@ +/** + * WordPress dependencies + */ +import { test, expect } from '@wordpress/e2e-test-utils-playwright'; + +test.describe( 'Timeline Block', () => { + test.beforeEach( async({ admin }) => { + await admin.createNewPost(); + }); + + test( 'insert block', async({ editor, page }) => { + + await editor.insertBlock({ + name: 'themeisle-blocks/timeline' + }); + + await expect( page.locator( '.o-timeline-content' ).first() ).toBeVisible(); // First container visible. + await expect( page.getByText( 'Project Launch' ) ).toBeVisible(); // Content visible. + + const postId = await editor.publishPost(); + await page.goto( `/?p=${postId}` ); + + await expect( page.locator( '.o-timeline-content' ).first() ).toBeVisible(); // First container visible. + await expect( page.getByText( 'Project Launch' ) ).toBeVisible(); // Content visible. + + await page.waitForTimeout( 1000 ); + }); + +});