From dc7a5c69c3b7024ea62d90a8259941bed9ff9e14 Mon Sep 17 00:00:00 2001 From: oumaimafisaoui Date: Wed, 17 Jul 2024 17:13:22 +0100 Subject: [PATCH] test(DPxAI): Added a test for Quest00/Ex02 --- dom/select-then-style_test.js | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 dom/select-then-style_test.js diff --git a/dom/select-then-style_test.js b/dom/select-then-style_test.js new file mode 100644 index 000000000..0ae3dfb13 --- /dev/null +++ b/dom/select-then-style_test.js @@ -0,0 +1,49 @@ + +export const tests = [] + +tests.push(async ({ eq }) => { + // check the CSS stylesheet is linked in the head tag + + await eq.$('head link', { + rel: 'stylesheet', + href: 'http://localhost:9898/select-and-style/select-and-style.css', + }) +}) + + +tests.push(async ({ eq }) => { + // check the universal selector has been declared properly + + await eq.css('*', { + margin: '0px', + opacity: '0.85', + boxSizing: 'border-box', + }) +}) + + +tests.push(async ({ eq }) => { + // check that the body was styled + + await eq.css('body', { height: '100vh' }) +}) + + +tests.push(async ({ eq }) => { + // check that sections elements are styled + + await eq.css('section', { + padding: '20px', + width: '100%', + height: 'calc(33.3333%)', + }) +}) + + +tests.push(async ({ eq }) => { + // check that the individual sections are styled + + await eq.css('#face', { backgroundColor: 'cyan' }) + await eq.css('#upper-body', { backgroundColor: 'blueviolet' }) + await eq.css('#lower-body', { backgroundColor: 'lightsalmon' }) +})