mirror of https://github.com/01-edu/public.git
Test for skeleton
This commit is contained in:
parent
8331a2bcf8
commit
a2a804c5eb
|
@ -0,0 +1,26 @@
|
|||
export const tests = []
|
||||
|
||||
tests.push(async ({ page, eq }) => {
|
||||
// check that the title tag is present & is set with some text
|
||||
const title = await page.$$eval(
|
||||
'title',
|
||||
(nodes) => nodes[0] && nodes[0].innerHTML,
|
||||
)
|
||||
const isValidTitle = title !== undefined && title.length !== 0
|
||||
eq(isValidTitle, true)
|
||||
|
||||
// check the 3 sections have been created with the correct text
|
||||
const sections = await page.$$eval('section', (nodes) =>
|
||||
nodes.map((node) => ({
|
||||
tag: node.tagName.toLowerCase(),
|
||||
text: node.textContent,
|
||||
})),
|
||||
)
|
||||
eq(expectedSections, sections)
|
||||
})
|
||||
|
||||
const expectedSections = [
|
||||
{ tag: 'section', text: 'face' },
|
||||
{ tag: 'section', text: 'upper-body' },
|
||||
{ tag: 'section', text: 'lower-body' },
|
||||
]
|
Loading…
Reference in New Issue