[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
This commit is contained in:
Ionut Costica
2015-08-21 15:18:40 +03:00
parent adc50b764d
commit 636e16d522

View File

@ -314,7 +314,8 @@
], ],
"tests": [ "tests": [
"assert($(\".btn-default\").length === 0, 'Remove the <code>btn-default</code> class from all of your <code>button</code> elements.')", "assert($(\".btn-default\").length === 0, 'Remove the <code>btn-default</code> class from all of your <code>button</code> 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 <code>btn-default</code> class.'"
], ],
"challengeSeed": [ "challengeSeed": [
"fccss", "fccss",