mirror of https://github.com/01-edu/public.git
2 changed files with 43 additions and 17 deletions
@ -1,24 +1,22 @@ |
|||||||
|
|
||||||
|
|
||||||
export const tests = [] |
export const tests = [] |
||||||
|
|
||||||
tests.push(async ({ page, eq }) => { |
tests.push(async ({ eq }) => { |
||||||
// check the CSS stylesheet is linked in the head tag
|
// check the CSS stylesheet is linked in the head tag
|
||||||
const CSSLink = await page.$$eval('head', (nodes) => |
|
||||||
[...nodes[0].children].some( |
|
||||||
(node) => node.tagName === 'LINK' && node.rel === 'stylesheet', |
|
||||||
), |
|
||||||
) |
|
||||||
eq(CSSLink, true) |
|
||||||
|
|
||||||
|
return eq.$('head link', { |
||||||
|
rel: 'stylesheet', |
||||||
|
href: 'http://localhost:9898/select-and-style/select-and-style.css', |
||||||
|
}) |
||||||
|
}) |
||||||
|
|
||||||
|
tests.push(async ({ eq }) => { |
||||||
// check the universal selector has been declared properly
|
// check the universal selector has been declared properly
|
||||||
const universalSelectorStyle = await page.evaluate(() => { |
|
||||||
const target = [...window.document.styleSheets[0].cssRules].find( |
return eq.css('*', { |
||||||
(rule) => rule.selectorText === '*', |
margin: '0px', |
||||||
) |
opacity: '0.85', |
||||||
const { margin, opacity, boxSizing } = target.style |
boxSizing: 'border-box', |
||||||
return { margin, opacity, boxSizing } |
|
||||||
}) |
}) |
||||||
eq( |
|
||||||
{ margin: '0px', opacity: '0.85', boxSizing: 'border-box' }, |
|
||||||
universalSelectorStyle, |
|
||||||
) |
|
||||||
}) |
}) |
||||||
|
Loading…
Reference in new issue