From c5f4f1f5f40b5c9043f8d4c9b3fd7665fdbc2c29 Mon Sep 17 00:00:00 2001 From: Pavel Tsurbeleu Date: Sat, 7 Nov 2015 21:56:58 -0800 Subject: [PATCH 1/2] fix count a element assertion to avoid 'undefined is not an object' error message when the element is missing, closes #899 --- seed/challenges/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index 2cd296e3c64..87bde582a08 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -1168,7 +1168,7 @@ "Now nest your existing a element within a new p element so that the surrounding paragraph says \"View more cat photos\", but where only \"cat photos\" is a link, and the rest of the text is plain text." ], "tests": [ - "assert($(\"a\").attr(\"href\").match(/freecatphotoapp.com/gi).length > 0, 'You need an a element that links to \"freecatphotoapp.com\".')", + "assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").length > 0, 'You need an a element that links to \"freecatphotoapp.com\".')", "assert($(\"a\").text().match(/cat\\sphotos/gi), 'Your a element should have the anchor text of \"cat photos\"')", "assert($(\"p\") && $(\"p\").length > 2, 'Create a new p element around your a element.')", "assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\"), 'Your a element should be nested within your new p element.')", From f473d6116d8214780bae34237c0cde5ade13125c Mon Sep 17 00:00:00 2001 From: Pavel Tsurbeleu Date: Mon, 9 Nov 2015 10:53:13 -0800 Subject: [PATCH 2/2] update count a element assertion's message in 'waypoint-nest-an-anchor-element-within-a-paragraph' challenge to precisely reflect the requirements and avoid confusion --- seed/challenges/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index 87bde582a08..b4864540519 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -1168,7 +1168,7 @@ "Now nest your existing a element within a new p element so that the surrounding paragraph says \"View more cat photos\", but where only \"cat photos\" is a link, and the rest of the text is plain text." ], "tests": [ - "assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").length > 0, 'You need an a element that links to \"freecatphotoapp.com\".')", + "assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").length > 0, 'You need an a element that links to \"http://www.freecatphotoapp.com\".')", "assert($(\"a\").text().match(/cat\\sphotos/gi), 'Your a element should have the anchor text of \"cat photos\"')", "assert($(\"p\") && $(\"p\").length > 2, 'Create a new p element around your a element.')", "assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\"), 'Your a element should be nested within your new p element.')",