Merge pull request #3110 from natac13/added-test-to-allow-single-double-qoutes-and-fixed-typo
General improvements to jquery challenge file
This commit is contained in:
@ -263,9 +263,9 @@
|
||||
"Use the <code>addClass()</code> jQuery function to give the element one new class for each selector: <code>animated</code>, <code>shake</code>, and <code>btn-primary</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert(editor.match(/\\$\\(.*button/g), 'Use the <code>$(\"button\")</code> selector.')",
|
||||
"assert(editor.match(/\\$\\(.*\\.btn/g), 'Use the <code>$(\".btn\")</code> selector.')",
|
||||
"assert(editor.match(/\\$\\(.*#target1/g), 'Use the <code>$(\"#target1\")</code> selector.')",
|
||||
"assert((editor.match(/\\$\\(\\'button\\'/g) || editor.match(/\\$\\(\"button\"/g)), 'Use the <code>$(\"button\")</code> selector.')",
|
||||
"assert((editor.match(/\\$\\(\\'\\.btn\\'/g) || editor.match(/\\$\\(\"\\.btn\"/g)), 'Use the <code>$(\".btn\")</code> selector.')",
|
||||
"assert((editor.match(/\\$\\(\\'#target1\\'/g) || editor.match(/\\$\\(\"#target1\"/g)), 'Use the <code>$(\"#target1\")</code> selector.')",
|
||||
"assert(editor.match(/addClass/g) && editor.match(/addClass/g).length > 2, 'Only add one class with each of your three selectors.')",
|
||||
"assert($(\"#target1\").hasClass(\"animated\") && $(\"#target1\").hasClass(\"shake\") && $(\"#target1\").hasClass(\"btn-primary\"), 'Your <code>#target1</code> element should have the classes <code>animated</code>‚ <code>shake</code> and <code>btn-primary</code>.')",
|
||||
"assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')"
|
||||
@ -627,7 +627,8 @@
|
||||
],
|
||||
"tests": [
|
||||
"assert($(\"#left-well\").css(\"background-color\") === 'red' || $(\"#left-well\").css(\"background-color\") === 'rgb(255, 0, 0)' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#ff0000' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#f00', 'Your <code>left-well</code> element should have a red background.')",
|
||||
"assert(editor.match(/\\.parent\\(\\)\\.css/g), 'You should use the <code>parent()</code> function to modify this element.')",
|
||||
"assert(editor.match(/\\.parent\\(\\)\\.css/g), 'You should use the <code>.parent()</code> function to modify this element.')",
|
||||
"assert((editor.match(/\\$\\(\\'#target1\\'\\)\\.parent/g) || editor.match(/\\$\\(\"#target1\"\\)\\.parent/g)), 'The <code>.parent()</code> method should be called on the <code>#target1</code> element.')",
|
||||
"assert(editor.match(/<div class=\"well\" id=\"left-well\">/g), 'Only use jQuery to add these classes to the element.')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
|
Reference in New Issue
Block a user