Skip to content

Commit 3ea41db

Browse files
committed
update failing tests in premium
1 parent a6e52da commit 3ea41db

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

e2e/tests/block-editor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test.describe( 'Block Editor', () => {
4242

4343
const settings = page.getByLabel( 'Settings', { exact: true } )
4444

45-
if ( ! await settings.getAttribute( 'aria-pressed' ) ) {
45+
if ( await settings.getAttribute( 'aria-pressed' ) === 'false' ) {
4646
await settings.click()
4747
}
4848

e2e/tests/global-settings.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,18 @@ test.describe( 'Global Settings', () => {
119119
await defaultBlockPage.getByLabel( 'Hex color' ).fill( color.slice( 1 ) )
120120
await defaultBlockPage.locator( '.stk-color-palette-control .stk-control-content > .components-dropdown > .components-button' ).first().click()
121121

122+
const saveBlock = defaultBlockPage.waitForResponse( response =>
123+
response.url().includes( 'update_block_style' ) && response.request().method() === 'POST' )
124+
122125
// In older WP versions, the button text is 'Update' instead of 'Save'
123126
if ( await defaultBlockPage.getByRole( 'button', { name: 'Save', exact: true } ).isVisible() ) {
124127
await defaultBlockPage.getByRole( 'button', { name: 'Save', exact: true } ).click()
125128
} else {
126129
await defaultBlockPage.getByRole( 'button', { name: 'Update' } ).click()
127130
}
128131

132+
// Ensure block is saved before closing the Default Block Editor
133+
await saveBlock
129134
await defaultBlockPage.close()
130135

131136
// Insert a Stackable Text Block, and check if the color is the same as the one set in the default block

0 commit comments

Comments
 (0)