mirror of https://github.com/01-edu/public.git
action-reaction: update test
This commit is contained in:
parent
e218615d8d
commit
4c08ac50c4
|
@ -19,15 +19,12 @@ tests.push(async ({ eq, page }) => {
|
|||
await page.waitForSelector('#eye-left.eye.eye-closed', { timeout: 150 })
|
||||
|
||||
// check the background color has changed
|
||||
const eyeLeft = await page.$eval(
|
||||
'#eye-left.eye.eye-closed',
|
||||
(node) => node.style.backgroundColor,
|
||||
)
|
||||
eq(eyeLeft, 'black')
|
||||
await eq.$('#eye-left.eye.eye-closed', {
|
||||
style: { backgroundColor: 'black' },
|
||||
})
|
||||
|
||||
// check that the text of the button changed to 'open'
|
||||
const buttonText = await page.$eval('button', (node) => node.textContent)
|
||||
eq(buttonText, 'Click to open the left eye')
|
||||
await eq.$('button', { textContent: 'Click to open the left eye' })
|
||||
})
|
||||
|
||||
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 })
|
||||
|
||||
// check the background color has changed
|
||||
const eyeLeft = await page.$eval(
|
||||
'#eye-left.eye:not(.eye-closed)',
|
||||
(node) => node.style.backgroundColor,
|
||||
)
|
||||
eq(eyeLeft, 'red')
|
||||
await eq.$('#eye-left.eye:not(.eye-closed)', {
|
||||
style: { backgroundColor: 'red' },
|
||||
})
|
||||
|
||||
// check that the text of the button changed to 'close'
|
||||
const buttonText = await page.$eval('button', (node) => node.textContent)
|
||||
eq(buttonText, 'Click to close the left eye')
|
||||
await eq.$('button', { textContent: 'Click to close the left eye' })
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue