From 636e16d5221fb59414875a89dffcdd4417a47cd3 Mon Sep 17 00:00:00 2001 From: Ionut Costica Date: Fri, 21 Aug 2015 15:18:40 +0300 Subject: [PATCH] [Waypoint: Remove Classes from an element with jQuery] usually expected to not validate if using removeClass() without parameters Added extra test to the waypoint to check if `.removeClass` was used with the `"btn-default"` parameter as most people expect to have to do (and are confused when the code validates before they've finished writing their function, as seen by the myriad of issues opened about it). Closes #2302 Closes #2402 Closes #2301 Closes #2197 Closes #2160 Closes #1923 Closes #1898 --- seed/challenges/jquery.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index aecaf645a6..99a8984a85 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -314,7 +314,8 @@ ], "tests": [ "assert($(\".btn-default\").length === 0, 'Remove the btn-default class from all of your button elements.')", - "assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')" + "assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')", + "assert(editor.match(/\\.[\\v\\s]*removeClass[\\s\\v]*\\([\\s\\v]*('|\")\\s*btn-default\\s*('|\")[\\s\\v]*\\)/gm), 'Only remove the btn-default class.'" ], "challengeSeed": [ "fccss",