Skip to content

Commit

Permalink
test(e2e): add Timeline block
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Aug 5, 2024
1 parent a1536b7 commit f74be4e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/blocks/test/e2e/blocks/timeline.spec.js
Original file line number Diff line number Diff line change
@@ -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 );
});

});

0 comments on commit f74be4e

Please sign in to comment.