mirror of https://github.com/01-edu/public.git
Update test for nesting-organs
This commit is contained in:
parent
913c01184e
commit
b19fc5e1a8
|
@ -15,44 +15,40 @@ tests.push(async ({ page, eq }) => {
|
||||||
return [...nodes[0].children].map(toNode)
|
return [...nodes[0].children].map(toNode)
|
||||||
})
|
})
|
||||||
eq(expectedStructure, elements)
|
eq(expectedStructure, elements)
|
||||||
|
})
|
||||||
|
|
||||||
|
tests.push(async ({ page, eq }) => {
|
||||||
// check the section selector style has been updated properly
|
// check the section selector style has been updated properly
|
||||||
const sectionSelectorStyle = await page.evaluate(() => {
|
eq.css('section', {
|
||||||
const target = [...window.document.styleSheets[0].cssRules].find(
|
display: 'flex',
|
||||||
(rule) => rule.selectorText === 'section',
|
justifyContent: 'center',
|
||||||
)
|
|
||||||
const { display, justifyContent } = target.style
|
|
||||||
return { display, justifyContent }
|
|
||||||
})
|
})
|
||||||
eq({ display: 'flex', justifyContent: 'center' }, sectionSelectorStyle)
|
})
|
||||||
|
|
||||||
// check if the given CSS has been correctly copy pasted
|
tests.push(async ({ page, eq }) => {
|
||||||
|
// check if the provided CSS has been correctly copy pasted
|
||||||
|
eq.css('div, p', {
|
||||||
|
border: '1px solid black',
|
||||||
|
padding: '10px',
|
||||||
|
margin: '0px',
|
||||||
|
borderRadius: '30px',
|
||||||
|
})
|
||||||
|
|
||||||
// div,
|
eq.css('#face', { alignItems: 'center' })
|
||||||
// p {
|
|
||||||
// border: solid 1px black;
|
|
||||||
// padding: 10px;
|
|
||||||
// margin: 0;
|
|
||||||
// border-radius: 30px;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// #face {
|
eq.css('#eyes', {
|
||||||
// align-items: center;
|
display: 'flex',
|
||||||
// }
|
backgroundColor: 'yellow',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
borderRadius: '50px',
|
||||||
|
width: '200px',
|
||||||
|
})
|
||||||
|
|
||||||
// #eyes {
|
eq.css('#torso', {
|
||||||
// display: flex;
|
width: '200px',
|
||||||
// background-color: yellow;
|
backgroundColor: 'violet',
|
||||||
// justify-content: space-between;
|
})
|
||||||
// align-items: center;
|
|
||||||
// border-radius: 50px;
|
|
||||||
// width: 200px;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// #torso {
|
|
||||||
// width: 200px;
|
|
||||||
// background-color: violet;
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const expectedStructure = [
|
const expectedStructure = [
|
||||||
|
|
Loading…
Reference in New Issue