From e7fbb88180f53acc77acf4c0c3859e81675ab4de Mon Sep 17 00:00:00 2001 From: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> Date: Fri, 22 Apr 2022 11:18:22 +0200 Subject: [PATCH] Remove testid and update tests (#40534) --- packages/block-library/src/comment-template/edit.js | 6 +----- .../e2e-tests/specs/editor/blocks/comments-query.test.js | 8 +------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/block-library/src/comment-template/edit.js b/packages/block-library/src/comment-template/edit.js index 6027ec3f78e723..a2acb7c6d38d94 100644 --- a/packages/block-library/src/comment-template/edit.js +++ b/packages/block-library/src/comment-template/edit.js @@ -288,11 +288,7 @@ export default function CommentTemplateEdit( { } if ( ! commentTree.length ) { - return ( -
- { __( 'No results found.' ) } -
- ); + return{ __( 'No results found.' ) }
; } return ( diff --git a/packages/e2e-tests/specs/editor/blocks/comments-query.test.js b/packages/e2e-tests/specs/editor/blocks/comments-query.test.js index 5d706b3cf52108..5f142aee56c75a 100644 --- a/packages/e2e-tests/specs/editor/blocks/comments-query.test.js +++ b/packages/e2e-tests/specs/editor/blocks/comments-query.test.js @@ -28,13 +28,7 @@ describe( 'Comment Query Loop', () => { await trashAllComments(); await createNewPost(); await insertBlock( 'Comments Query Loop' ); - await page.waitForSelector( '[data-testid="noresults"]' ); - expect( - await page.evaluate( - ( el ) => el.innerText, - await page.$( '[data-testid="noresults"]' ) - ) - ).toEqual( 'No results found.' ); + await page.waitForXPath( '//p[contains(text(), "No results found.")]' ); } ); it( 'Pagination links are working as expected', async () => { await createNewPost();