From 626d243db4d37a2bd39c4406fb8aff670569cf4d Mon Sep 17 00:00:00 2001 From: Timo Date: Fri, 25 Aug 2017 01:40:59 +0200 Subject: [PATCH] fix(challenges): Revert CSS regex test Some CSS tests were changed to regex tests while the CSS tests weren't working on Firefox. Now that the original issue has been fixed, these changes can be reverted. Closes #15567 --- .../01-responsive-web-design/applied-visual-design.json | 6 +++--- seed/challenges/01-responsive-web-design/basic-css.json | 2 +- .../01-responsive-web-design/responsive-web-design.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/seed/challenges/01-responsive-web-design/applied-visual-design.json b/seed/challenges/01-responsive-web-design/applied-visual-design.json index c01f499a62e..245c94bfd65 100644 --- a/seed/challenges/01-responsive-web-design/applied-visual-design.json +++ b/seed/challenges/01-responsive-web-design/applied-visual-design.json @@ -1387,9 +1387,9 @@ "
" ], "tests": [ - "assert(code.match(/.orange\\s*\\{\\s*background-color:\\s*(#FF7D00|#ff7d00);?\\s*\\}/g), 'message: The div element with class orange should have a background-color of orange.');", - "assert(code.match(/.cyan\\s*\\{\\s*background-color:\\s*(#00FFFF|#00ffff);?\\s*\\}/g), 'message: The div element with class cyan should have a background-color of cyan.');", - "assert(code.match(/.raspberry\\s*\\{\\s*background-color:\\s*(#FF007D|#ff007d);?\\s*\\}/g), 'message: The div element with class raspberry should have a background-color of raspberry.');" + "assert($('.orange').css('background-color') == 'rgb(255, 125, 0)', 'message: The div element with class orange should have a background-color of orange.');", + "assert($('.cyan').css('background-color') == 'rgb(0, 255, 255)', 'message: The div element with class cyan should have a background-color of cyan.');", + "assert($('.raspberry').css('background-color') == 'rgb(255, 0, 125)', 'message: The div element with class raspberry should have a background-color of raspberry.');" ], "solutions": [], "hints": [], diff --git a/seed/challenges/01-responsive-web-design/basic-css.json b/seed/challenges/01-responsive-web-design/basic-css.json index c0f09e5062f..859c66073e1 100644 --- a/seed/challenges/01-responsive-web-design/basic-css.json +++ b/seed/challenges/01-responsive-web-design/basic-css.json @@ -88,7 +88,7 @@ "" ], "tests": [ - "assert(code.match(/\\s*CatPhotoApp\\s*<\\/h2>/), 'message: Your h2 element should be red.');", + "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'message: Your h2 element should be red.');", "assert(code.match(/\\s*CatPhotoApp\\s*<\\/h2>/),' message: Your style declaration should end with a ; .');" ], "type": "waypoint", diff --git a/seed/challenges/01-responsive-web-design/responsive-web-design.json b/seed/challenges/01-responsive-web-design/responsive-web-design.json index 2f338794af7..02b04920e93 100644 --- a/seed/challenges/01-responsive-web-design/responsive-web-design.json +++ b/seed/challenges/01-responsive-web-design/responsive-web-design.json @@ -97,7 +97,7 @@ "

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.

" ], "tests": [ - "assert(code.match(/p\\s*\\{\\s*font-size:\\s*10px;\\s*\\}/g), 'message: Your p element should have the font-size of 10px when the device height is less than or equal to 800px.');", + "assert($('p').css('font-size') == '10px', 'message: Your p element should have the font-size of 10px when the device height is less than or equal to 800px.');", "assert(code.match(/@media \\(max-height:\\s*?800px\\)/g), 'message: Declare a @media query for devices with a height less than or equal to 800px.');" ], "type": "waypoint",