From b4afc3430a0c364242fc1399fcf2e64b1bf53e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADnez?= Date: Sun, 16 Aug 2015 21:11:36 +0000 Subject: [PATCH 01/54] Fixed #1090 --- seed/challenges/html5-and-css.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index 4d4ae95cad..e25c317578 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -867,8 +867,8 @@ "tests": [ "assert($(\"img\").hasClass(\"smaller-image\"), 'Your img element should have the class smaller-image.')", "assert($(\"img\").hasClass(\"thick-green-border\"), 'Your img element should have the class thick-green-border.')", - "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\")), 'Give your image a border width of 10px.')", - "assert(new RegExp(\"solid\", \"gi\").test(editor), 'Give your image a border style of solid.')", + "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) === 10, 'Give your image a border width of 10px.')", + "assert($(\"img\").css(\"border-right-style\") === \"solid\", 'Give your image a border style of solid.')", "assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your img element should be green.')" ], "challengeSeed": [ From 2fade59319e08b26941261ecbbbd7206b0fe23e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADnez?= Date: Mon, 17 Aug 2015 16:01:51 +0000 Subject: [PATCH 02/54] Changed test case for Waypoint: target elements by id --- seed/challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index f2dfcb08e1..cd059066b1 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -161,7 +161,7 @@ ], "tests": [ "assert($(\"#target3\").hasClass(\"animated\"), 'Select the buttonelement with the id of target3 and use the jQuery addClass() function to give it the class of animated.');", - "assert($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\"), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.')", + "assert(($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\")) && editor.match(/\\$\\(.#target3.\\)/g), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.');", "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')" ], "challengeSeed": [ From 23139ff45fbe0a936fff2d8d9e927b1fb3bce5c4 Mon Sep 17 00:00:00 2001 From: Mark Surnin Date: Thu, 20 Aug 2015 12:01:38 +0500 Subject: [PATCH 03/54] Added a test for factorial(0) to be equal to 1. --- seed/challenges/basic-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 6f1cf7b9d4..84f92e15dd 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -90,7 +90,8 @@ "expect(factorialize(5)).to.be.a(\"Number\");", "expect(factorialize(5)).to.equal(120);", "expect(factorialize(10)).to.equal(3628800);", - "expect(factorialize(20)).to.equal(2432902008176640000);" + "expect(factorialize(20)).to.equal(2432902008176640000);", + "expect(factorialize(0)).to.equal(1);" ], "difficulty": "1.02", "description": [ From 636e16d5221fb59414875a89dffcdd4417a47cd3 Mon Sep 17 00:00:00 2001 From: Ionut Costica Date: Fri, 21 Aug 2015 15:18:40 +0300 Subject: [PATCH 04/54] [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", From 0132a1afcae227ea80934ae61e64e0c7d2c81bc5 Mon Sep 17 00:00:00 2001 From: Jakob Dahl Date: Fri, 21 Aug 2015 17:45:30 +0200 Subject: [PATCH 05/54] 2324 for id attributes to be under relevant parents --- seed/challenges/bootstrap.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index da7a510236..a447d6bffa 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -1949,8 +1949,8 @@ "Give the well on the left the id of left-well. Give the well on the right the id of right-well." ], "tests": [ - "assert($(\"#left-well\") && $(\"#left-well\").length > 0, 'Give your left well the id of left-well.')", - "assert($(\"#right-well\") && $(\"#right-well\").length > 0, 'Give your right well the id of right-well.')" + "assert($(\".col-xs-6\").children(\"#left-well\") && $(\".col-xs-6\").children(\"#left-well\").length > 0, 'Give your left well the id of left-well.')", + "assert($(\".col-xs-6\").children(\"#right-well\") && $(\".col-xs-6\").children(\"#right-well\").length > 0, 'Give your right well the id of right-well.')" ], "challengeSeed": [ "
", @@ -2046,12 +2046,12 @@ "Give each of your buttons a unique id like, starting with target1 and ending with target6." ], "tests": [ - "assert($(\"#target1\") && $(\"#target1\").length > 0, 'One button element should have the id target1.')", - "assert($(\"#target2\") && $(\"#target2\").length > 0, 'One button element should have the id target2.')", - "assert($(\"#target3\") && $(\"#target3\").length > 0, 'One button element should have the id target3.')", - "assert($(\"#target4\") && $(\"#target4\").length > 0, 'One button element should have the id target4.')", - "assert($(\"#target5\") && $(\"#target5\").length > 0, 'One button element should have the id target5.')", - "assert($(\"#target6\") && $(\"#target6\").length > 0, 'One button element should have the id target6.')" + "assert($(\"#left-well\").children(\"#target1\") && $(\"#left-well\").children(\"#target1\").length > 0, 'One button element should have the id target1.')", + "assert($(\"#left-well\").children(\"#target2\") && $(\"#left-well\").children(\"#target2\").length > 0, 'One button element should have the id target2.')", + "assert($(\"#left-well\").children(\"#target3\") && $(\"#left-well\").children(\"#target3\").length > 0, 'One button element should have the id target3.')", + "assert($(\"#right-well\").children(\"#target4\") && $(\"#right-well\").children(\"#target4\").length > 0, 'One button element should have the id target4.')", + "assert($(\"#right-well\").children(\"#target5\") && $(\"#right-well\").children(\"#target5\").length > 0, 'One button element should have the id target5.')", + "assert($(\"#right-well\").children(\"#target6\") && $(\"#right-well\").children(\"#target6\").length > 0, 'One button element should have the id target6.')" ], "challengeSeed": [ "
", From 67158e876db1da0ed05dddd9e5557ee840b676b1 Mon Sep 17 00:00:00 2001 From: ahstro Date: Sun, 23 Aug 2015 15:18:17 +0200 Subject: [PATCH 06/54] Check all children instead of just one in 'Target Children with jQuery' --- seed/challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index 8576e4bc0d..75de836abf 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -679,7 +679,7 @@ "Here's an example of how you would use the children() function: $(\"#left-well\").children().css(\"color\", \"blue\")" ], "tests": [ - "assert($(\"#target6\").css(\"color\") === 'rgb(0, 128, 0)', 'Your target6 element should have green text.')", + "assert($(\"#right-well\").children().css(\"color\") === 'rgb(0, 128, 0)', 'All children of #right-well should have green text.')", "assert(editor.match(/\\.children\\(\\)\\.css/g), 'You should use the children() function to modify these elements.')", "assert(editor.match(/
/g), 'Only use jQuery to add these classes to the element.')" ], From 16579fdd4b270e2aa9f33ab94a8080e0565a7dda Mon Sep 17 00:00:00 2001 From: bugron Date: Wed, 26 Aug 2015 11:51:36 +0400 Subject: [PATCH 07/54] Fixes indoor, personality and label issues --- seed/challenges/html5-and-css.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index e55619b87b..0463430e38 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -1998,8 +1998,8 @@ ], "tests": [ "assert($('input[type=\"radio\"]').length > 1, 'Your page should have two radio button elements.')", - "assert($('input[type=\"radio\"]:nth-child(1)').attr('name') === 'indoor-outdoor', 'Give your radio buttons the name attribute of indoor-outdoor.')", - "assert($(\"label\").length > 1, 'Each of your two radio button elements should be nested in a label element.')", + "assert($('label > input[type=\"radio\"]').filter(\"[name='indoor-outdoor']\").length > 1, 'Give your radio buttons the name attribute of indoor-outdoor.')", + "assert($('label > input[type=\"radio\"]:only-child').length > 1, 'Each of your two radio button elements should be nested in its own label element.')", "assert(editor.match(/<\\/label>/g) && editor.match(/