Browse Source

Update test for nesting-organs

pull/748/head
Marie Malarme 3 years ago committed by Clément
parent
commit
b19fc5e1a8
  1. 58
      dom/nesting-organs_test.js

58
dom/nesting-organs_test.js

@ -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
// div, tests.push(async ({ page, eq }) => {
// p { // check if the provided CSS has been correctly copy pasted
// border: solid 1px black; eq.css('div, p', {
// padding: 10px; border: '1px solid black',
// margin: 0; padding: '10px',
// border-radius: 30px; margin: '0px',
// } borderRadius: '30px',
})
// #face { eq.css('#face', { alignItems: 'center' })
// align-items: center;
// }
// #eyes { eq.css('#eyes', {
// display: flex; display: 'flex',
// background-color: yellow; backgroundColor: 'yellow',
// justify-content: space-between; justifyContent: 'space-between',
// align-items: center; alignItems: 'center',
// border-radius: 50px; borderRadius: '50px',
// width: 200px; width: '200px',
// } })
// #torso { eq.css('#torso', {
// width: 200px; width: '200px',
// background-color: violet; backgroundColor: 'violet',
// } })
}) })
const expectedStructure = [ const expectedStructure = [

Loading…
Cancel
Save