Skip to content

Commit 9c910a6

Browse files
committed
make sure global block default gets updated
1 parent 59b37ed commit 9c910a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

e2e/tests/global-settings.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,17 @@ test.describe( 'Global Settings', () => {
129129
await defaultBlockPage.getByLabel( 'Hex color' ).fill( 'ff0000' )
130130
await defaultBlockPage.locator( '.stk-color-palette-control .stk-control-content > .components-dropdown > .components-button' ).first().click()
131131

132+
const updateRequest = page.waitForResponse( response => response.url().includes( 'update_block_style' ) && response.request().method() === 'POST' )
133+
132134
// In older WP versions, the button text is 'Update' instead of 'Save'
133135
if ( await defaultBlockPage.getByRole( 'button', { name: 'Save', exact: true } ).isVisible() ) {
134136
await defaultBlockPage.getByRole( 'button', { name: 'Save', exact: true } ).click()
135-
await expect( defaultBlockPage.getByRole( 'button', { name: 'Saving' } ) ).toBeVisible()
136-
await expect( defaultBlockPage.getByRole( 'button', { name: 'Save', exact: true } ) ).toBeVisible()
137137
} else {
138138
await defaultBlockPage.getByRole( 'button', { name: 'Update' } ).click()
139-
await expect( defaultBlockPage.getByRole( 'button', { name: 'Updating' } ) ).toBeVisible()
140-
await expect( defaultBlockPage.getByRole( 'button', { name: 'Update' } ) ).toBeVisible()
141139
}
142140

141+
// Make sure default block has been updated before closing the tab
142+
await updateRequest
143143
await defaultBlockPage.close()
144144

145145
// 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)