From fc09fcb98b46f1608826e1b6e047ef9fae044a3c Mon Sep 17 00:00:00 2001 From: Pavel Tsurbeleu Date: Sat, 7 Nov 2015 21:56:58 -0800 Subject: [PATCH] fix count a element assertion to avoid 'undefined is not an object' error message when the element is missing, closes #899 --- challenges/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/html5-and-css.json b/challenges/html5-and-css.json index 2cd296e3c6..87bde582a0 100644 --- a/challenges/html5-and-css.json +++ b/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.')",