mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
758 B
24 lines
758 B
export const tests = [] |
|
|
|
tests.push(async ({ page, eq }) => { |
|
// 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) |
|
|
|
// check the universal selector has been declared properly |
|
const universalSelectorStyle = await page.evaluate(() => { |
|
const target = [...window.document.styleSheets[0].cssRules].find( |
|
(rule) => rule.selectorText === '*', |
|
) |
|
const { margin, opacity, boxSizing } = target.style |
|
return { margin, opacity, boxSizing } |
|
}) |
|
eq( |
|
{ margin: '0px', opacity: '0.85', boxSizing: 'border-box' }, |
|
universalSelectorStyle, |
|
) |
|
})
|
|
|