Skip to content

Commit

Permalink
Add waiting for the selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed Mar 24, 2022
1 parent d1bef82 commit aea6688
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ describe( 'Comment Query Loop', () => {
await page.click( '.wp-block-comments-pagination-previous' );

// We check that there are a previous and a next link.
await page.waitForSelector( '.wp-block-comments-pagination-previous' );
await page.waitForSelector( '.wp-block-comments-pagination-next' );
expect(
await page.$( '.wp-block-comments-pagination-previous' )
).not.toBeNull();
Expand All @@ -73,6 +75,7 @@ describe( 'Comment Query Loop', () => {
await page.click( '.wp-block-comments-pagination-previous' );

// We check that there is only have a next link
await page.waitForSelector( '.wp-block-comments-pagination-next' );
expect(
await page.$( '.wp-block-comments-pagination-previous' )
).toBeNull();
Expand Down

0 comments on commit aea6688

Please sign in to comment.