From c3987e9f559562a20896744ca976710e2eb4bc81 Mon Sep 17 00:00:00 2001 From: Marie Malarme Date: Tue, 2 Mar 2021 23:00:44 +0000 Subject: [PATCH] Test for class-that --- dom/class-that_test.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 dom/class-that_test.js diff --git a/dom/class-that_test.js b/dom/class-that_test.js new file mode 100644 index 00000000..f84a4459 --- /dev/null +++ b/dom/class-that_test.js @@ -0,0 +1,36 @@ +export const tests = [] + +tests.push(async ({ page, eq }) => { + // check the class 'eye' has been declared properly in the CSS + eq.css('.eye', { + width: '60px', + height: '60px', + backgroundColor: 'red', + borderRadius: '50%', + }) +}) + +tests.push(async ({ page, eq }) => { + // check the class 'arm' has been declared properly in the CSS + eq.css('.arm', { backgroundColor: 'aquamarine' }) +}) + +tests.push(async ({ page, eq }) => { + // check the class 'leg' has been declared properly in the CSS + eq.css('.leg', { backgroundColor: 'dodgerblue' }) +}) + +tests.push(async ({ page, eq }) => { + // check the class 'body-member' has been declared properly in the CSS + eq.css('.body-member', { width: '50px', margin: '30px' }) +}) + +tests.push(async ({ page, eq }) => { + // check that the targetted elements have the correct class names + await eq.$('p#eye-left', { className: 'eye' }) + await eq.$('p#eye-right', { className: 'eye' }) + await eq.$('div#arm-left', { className: 'arm body-member' }) + await eq.$('div#arm-right', { className: 'arm body-member' }) + await eq.$('div#leg-left', { className: 'leg body-member' }) + await eq.$('div#leg-right', { className: 'leg body-member' }) +})