Skip to content

Commit

Permalink
Don't use unnecessary regex matching
Browse files Browse the repository at this point in the history
Not needed since Playwright v1.28
  • Loading branch information
WunderBart committed Feb 24, 2023
1 parent 3f02486 commit 716a0ce
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/e2e/specs/editor/various/block-deletion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test.describe( 'Block deletion', () => {
.getByRole( 'button', { name: 'Options' } )
.click();
await page
.getByRole( 'menuitem', { name: /Remove Paragraph/i } )
.getByRole( 'menuitem', { name: 'Remove Paragraph' } )
.click();

// Ensure the last block was removed.
Expand Down Expand Up @@ -129,7 +129,7 @@ test.describe( 'Block deletion', () => {
name: 'core/paragraph',
} );
await expect(
editor.canvas.getByRole( 'document', { name: /Empty block/i } )
editor.canvas.getByRole( 'document', { name: 'Empty block' } )
).toBeFocused();

// Hit backspace to remove the empty paragraph.
Expand Down Expand Up @@ -222,7 +222,7 @@ test.describe( 'Block deletion', () => {
// Ensure the empty paragraph is focused.
await expect(
editor.canvas.getByRole( 'document', {
name: /Empty block/i,
name: 'Empty block',
} )
).toBeFocused();

Expand All @@ -245,7 +245,7 @@ test.describe( 'Block deletion', () => {
await expect.poll( editor.getBlocks ).toHaveLength( 3 );
await expect(
editor.canvas.getByRole( 'document', {
name: /Empty block/i,
name: 'Empty block',
} )
).toBeFocused();
} );
Expand All @@ -269,13 +269,13 @@ test.describe( 'Block deletion', () => {
.getByRole( 'button', { name: 'Options' } )
.click();
await page
.getByRole( 'menuitem', { name: /Remove Paragraph/i } )
.getByRole( 'menuitem', { name: 'Remove Paragraph' } )
.click();

// Ensure an empty block was created and focused.
await expect(
editor.canvas.getByRole( 'document', {
name: /Empty block/i,
name: 'Empty block',
} )
).toBeFocused();
await expect.poll( editor.getBlocks ).toEqual( [] );
Expand Down Expand Up @@ -329,7 +329,7 @@ test.describe( 'Block deletion', () => {
// Ensure that there's no blocks.
await expect.poll( editor.getBlocks ).toHaveLength( 0 );
await expect(
editor.canvas.getByRole( 'document', { name: /Empty block/i } )
editor.canvas.getByRole( 'document', { name: 'Empty block' } )
).not.toBeVisible();

// Ensure that the block appender button is visible.
Expand Down

0 comments on commit 716a0ce

Please sign in to comment.