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 })
|
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…
Reference in New Issue