Skip to content

Commit

Permalink
Use check instead of immediately expecting the result
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Jun 9, 2021
1 parent ec1ac44 commit 9f1ad75
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions test/integration/image-component/default/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,15 @@ describe('Image Component Tests', () => {
let browser
try {
browser = await webdriver(appPort, '/blurry-placeholder')
await waitFor(1550)
expect(
await getComputedStyle(
browser,
'blurry-placeholder',
'background-image'
)
).toBe('none')
await check(
async () =>
await getComputedStyle(
browser,
'blurry-placeholder',
'background-image'
),
'none'
)
expect(
await getComputedStyle(
browser,
Expand All @@ -627,13 +628,15 @@ describe('Image Component Tests', () => {

await browser.eval('document.getElementById("spacer").remove()')

expect(
await getComputedStyle(
browser,
'blurry-placeholder-with-lazy',
'background-image'
)
).toBe('none')
await check(
async () =>
await getComputedStyle(
browser,
'blurry-placeholder-with-lazy',
'background-image'
),
'none'
)
} finally {
if (browser) {
await browser.close()
Expand Down

0 comments on commit 9f1ad75

Please sign in to comment.