Browse Source

action-reaction: update test

pull/761/head
Marie Malarme 3 years ago committed by Clément
parent
commit
4c08ac50c4
  1. 22
      dom/action-reaction_test.js

22
dom/action-reaction_test.js

@ -19,15 +19,12 @@ tests.push(async ({ eq, page }) => {
await page.waitForSelector('#eye-left.eye.eye-closed', { timeout: 150 }) await page.waitForSelector('#eye-left.eye.eye-closed', { timeout: 150 })
// check the background color has changed // check the background color has changed
const eyeLeft = await page.$eval( await eq.$('#eye-left.eye.eye-closed', {
'#eye-left.eye.eye-closed', style: { backgroundColor: 'black' },
(node) => node.style.backgroundColor, })
)
eq(eyeLeft, 'black')
// check that the text of the button changed to 'open' // check that the text of the button changed to 'open'
const buttonText = await page.$eval('button', (node) => node.textContent) await eq.$('button', { textContent: 'Click to open the left eye' })
eq(buttonText, 'Click to open the left eye')
}) })
tests.push(async ({ eq, page }) => { tests.push(async ({ eq, page }) => {
@ -39,13 +36,10 @@ tests.push(async ({ eq, page }) => {
await page.waitForSelector('#eye-left.eye:not(.eye-closed)', { timeout: 150 }) await page.waitForSelector('#eye-left.eye:not(.eye-closed)', { timeout: 150 })
// check the background color has changed // check the background color has changed
const eyeLeft = await page.$eval( await eq.$('#eye-left.eye:not(.eye-closed)', {
'#eye-left.eye:not(.eye-closed)', style: { backgroundColor: 'red' },
(node) => node.style.backgroundColor, })
)
eq(eyeLeft, 'red')
// check that the text of the button changed to 'close' // check that the text of the button changed to 'close'
const buttonText = await page.$eval('button', (node) => node.textContent) await eq.$('button', { textContent: 'Click to close the left eye' })
eq(buttonText, 'Click to close the left eye')
}) })

Loading…
Cancel
Save