Skip to content

Commit 4d63cbb

Browse files
committed
update failing test
1 parent 0e0a1af commit 4d63cbb

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

e2e/tests/global-settings.spec.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,22 @@ test.describe( 'Global Settings', () => {
155155
await defaultBlockPage.getByRole( 'button', { name: 'Update' } ).click()
156156
}
157157

158-
// Make sure default block has been updated before closing the tab
158+
// Make sure default block has been updated
159159
await updateRequest
160-
await defaultBlockPage.close()
161160

162161
// Insert a Stackable Text Block, and check if the color is the same as the one set in the default block
163-
await page.reload()
164-
await editor.insertBlock( {
165-
name: 'stackable/text',
166-
attributes: {
167-
text: 'test',
168-
},
169-
} )
170-
171-
await expect( editor.canvas.locator( '[data-type="stackable/text"] > .stk-block-text > p[role="textbox"]' ) ).toHaveCSS( 'color', 'rgb(255, 0, 0)' )
162+
// Wrap the expect in a function in case the default block is not yet updated
163+
await expect( async () => {
164+
await page.reload()
165+
await editor.insertBlock( {
166+
name: 'stackable/text',
167+
attributes: {
168+
text: 'test',
169+
},
170+
} )
171+
172+
await expect( editor.canvas.locator( '[data-type="stackable/text"] > .stk-block-text > p[role="textbox"]' ) ).toHaveCSS( 'color', 'rgb(255, 0, 0)' )
173+
} ).toPass( { intervals: [ 1_000, 5_000, 30_000 ] } )
172174

173175
// Reset Default Block
174176
await page.getByLabel( 'Stackable Settings' ).click()

0 commit comments

Comments
 (0)