Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Jan 3, 2024
1 parent b58c224 commit 5cf39f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/e2e-tests/specs/editor/various/nux.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ describe( 'New User Experience (NUX)', () => {
const postTitle = await canvas().waitForSelector(
'h1[aria-label="Add title"'
);
await expect( postTitle ).toHaveFocus();
await expect(
postTitle.evaluate(
( node ) => node === node.ownerDocument.activeElement
)
).resolves.toBe( true );
} );

it( 'should show the welcome guide if it is manually opened', async () => {
Expand Down
10 changes: 8 additions & 2 deletions test/e2e/specs/widgets/editing-widgets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,13 @@ class WidgetsScreen {
};

saveWidgets = async () => {
await this.updateButton.click();
await this.updateButton.waitFor( { state: 'disabled' } );
await test.step(
'save widgets',
async () => {
await this.updateButton.click();
await expect( this.updateButton ).toBeDisabled();
},
{ box: true }
);
};
}

0 comments on commit 5cf39f6

Please sign in to comment.