mirror of https://github.com/01-edu/public.git
2 changed files with 39 additions and 20 deletions
@ -1,19 +1,19 @@ |
|||||||
export const tests = [] |
export const tests = [] |
||||||
|
|
||||||
tests.push(async ({ page, eq }) => { |
tests.push(async ({ page, eq }) => { |
||||||
// check the 3 sections have the correct id and no text
|
// check the face
|
||||||
const elements = await page.$$eval('body', (nodes) => |
|
||||||
[...nodes[0].children].map((node) => ({ |
return eq.$('section#face', { textContent: '' }) |
||||||
tag: node.tagName.toLowerCase(), |
}) |
||||||
text: node.textContent, |
|
||||||
id: node.id, |
tests.push(async ({ page, eq }) => { |
||||||
})), |
// check the upper-body
|
||||||
) |
|
||||||
eq(expectedSections, elements) |
return eq.$('section#upper-body', { textContent: '' }) |
||||||
}) |
}) |
||||||
|
|
||||||
const expectedSections = [ |
tests.push(async ({ page, eq }) => { |
||||||
{ tag: 'section', text: '', id: 'face' }, |
// check the lower-body, my favorite part
|
||||||
{ tag: 'section', text: '', id: 'upper-body' }, |
|
||||||
{ tag: 'section', text: '', id: 'lower-body' }, |
return eq.$('section#lower-body', { textContent: '' }) |
||||||
] |
}) |
||||||
|
Loading…
Reference in new issue