Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/e2e/specs/site-editor/block-style-variations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ test.describe( 'Block Style Variations', () => {
},
},
} );
// The save button has been re-enabled.

// Wait for the save button to be re-enabled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers here, just making sure I understand the change here:

This change is now checking that that Save is visible, rather than enabled. From looking at the editor manually, while saving, the button says "Saving" rather than "Save", so .toBeVisible() is a good check to use, as it'll only pass if the button says "Save" rather than "Saving". Also, once the revision has been saved the button is in a disabled state, so toBeVisible is a more reliable check than toBeEnabled.

Assuming that's all how it's meant to be, that sounds great to me!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly what you said, thanks for confirming.

Much better expressed than what my caveman brain was thinking: "Wait for save. Save there. Good save."

await expect(
page
.getByRole( 'region', { name: 'Editor top bar' } )
.getByRole( 'button', { name: 'Save' } )
).toBeEnabled();
).toBeVisible();

// Second revision (current).
await siteEditorBlockStyleVariations.saveRevision( stylesPostId, {
blocks: {
Expand Down