Browse Source

Update the-calling test to check all the elements of the body

pull/748/head
Marie Malarme 3 years ago committed by Clément
parent
commit
d753240d20
  1. 6
      dom/the-calling_test.js

6
dom/the-calling_test.js

@ -2,14 +2,14 @@ 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 3 sections have the correct id and no text
const sections = await page.$$eval('section', (nodes) => const elements = await page.$$eval('body', (nodes) =>
nodes.map((node) => ({ [...nodes[0].children].map((node) => ({
tag: node.tagName.toLowerCase(), tag: node.tagName.toLowerCase(),
text: node.textContent, text: node.textContent,
id: node.id, id: node.id,
})), })),
) )
eq(expectedSections, sections) eq(expectedSections, elements)
}) })
const expectedSections = [ const expectedSections = [

Loading…
Cancel
Save