From 9079110612a7422d019c7f5f52982190c605d2f6 Mon Sep 17 00:00:00 2001 From: Ella Date: Thu, 8 Feb 2024 10:59:07 +0200 Subject: [PATCH] Use toHaveText --- test/e2e/specs/editor/various/footnotes.spec.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/e2e/specs/editor/various/footnotes.spec.js b/test/e2e/specs/editor/various/footnotes.spec.js index e204790737bfb1..47fccee2e208b8 100644 --- a/test/e2e/specs/editor/various/footnotes.spec.js +++ b/test/e2e/specs/editor/various/footnotes.spec.js @@ -61,11 +61,7 @@ test.describe( 'Footnotes', () => { ] ); // Check if the numbers in the editor content updated. - const anchorNumber = await editor.canvas - .locator( ':root' ) - .evaluate( () => document.querySelector( '.fn' ).textContent ); - - expect( anchorNumber ).toBe( '1' ); + await expect( editor.canvas.locator( '.fn' ) ).toHaveText( '1' ); await editor.canvas.locator( 'p:text("first paragraph")' ).click();