Skip to content

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Dec 22, 2024
1 parent e1b487c commit 4e043a2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/e2e/specs/widgets/editing-widgets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ test.describe( 'Widgets screen', () => {
{ name: /^Empty block/ }
);

// When the block is focused, the global inserter is closed,
// which in turn focuses the global inserter toggle.
// So we need to explicitly focus the paragraph block again.
await addedParagraphBlockInFirstWidgetArea.focus();
await addedParagraphBlockInFirstWidgetArea.focus();
await page.keyboard.type( 'First Paragraph' );

Expand All @@ -91,6 +95,10 @@ test.describe( 'Widgets screen', () => {
// TODO: We can add a test for the insertion indicator here.
await addParagraphBlock.click();

// When the block is focused, the global inserter is closed,
// which in turn focuses the global inserter toggle.
// So we need to explicitly focus the paragraph block again.
await addedParagraphBlockInFirstWidgetArea.focus();
await addedParagraphBlockInFirstWidgetArea.focus();
await page.keyboard.type( 'Second Paragraph' );

Expand All @@ -116,6 +124,11 @@ test.describe( 'Widgets screen', () => {
secondWidgetArea.getByRole( 'document', {
name: /^Empty block/,
} );

// When the block is focused, the global inserter is closed,
// which in turn focuses the global inserter toggle.
// So we need to explicitly focus the paragraph block again.
await addedParagraphBlockInSecondWidgetArea.focus();
await addedParagraphBlockInSecondWidgetArea.focus();
await page.keyboard.type( 'Third Paragraph' );

Expand Down

0 comments on commit 4e043a2

Please sign in to comment.