From bbaa51810aa3678694eccccf3fcdd4d098bd795a Mon Sep 17 00:00:00 2001 From: Dieter Daems Date: Fri, 4 Dec 2015 11:50:04 +0100 Subject: [PATCH] Properly detect hex color codes in test. Origenally you could pass all tests without ever placing the hex code in the correct place, als abbreviates didn't work either for background and hex code - Can use the shortcode to pass the test now. - Atleasts needs a body present with curly brackets - Needs a background property being present in the body element - The background property must be followed by a the proper hex color --- .../html5-and-css.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/html5-and-css.json b/seed/challenges/01-front-end-development-certification/html5-and-css.json index 443c796409..8a1cbe6438 100644 --- a/seed/challenges/01-front-end-development-certification/html5-and-css.json +++ b/seed/challenges/01-front-end-development-certification/html5-and-css.json @@ -3777,7 +3777,7 @@ ], "tests": [ "assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 0)\", 'message: Give your body element the background-color of black.');", - "assert(code.match(/#000000/g) && code.match(/#000000/g).length > 0, 'message: Use the hex code for the color black instead of the word black. For example body { color: #000000; }');" + "assert(code.match(/body\\s*{(([\\s\\S]*;\\s*?)|\\s*?)background.*\\s*:\\s*?#000(000)?((\\s*})|(;[\\s\\S]*?}))/gi), 'message: Use the hex code for the color black instead of the word black. For example body { color: #000000; }');" ], "challengeSeed": [ "