diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.english.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.english.md index fde6699cb3..dd558769f2 100644 --- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.english.md @@ -33,11 +33,11 @@ Finally don't forget to give your image an alt text. ```yml tests: - text: Your page should have an image element. - testString: assert($("img").length > 0, 'Your page should have an image element.'); + testString: assert($("img").length); - text: Your image should have a src attribute that points to the kitten image. - testString: assert(new RegExp("\/\/bit.ly\/fcc-relaxing-cat|\/\/s3.amazonaws.com\/freecodecamp\/relaxing-cat.jpg", "gi").test($("img").attr("src")), 'Your image should have a src attribute that points to the kitten image.'); - - text: Your image element must have an alt attribute. - testString: assert(code.match(/alt\s*?=\s*?(\"|\').*(\"|\')/), 'Your image element must have an alt attribute.'); + testString: assert(/^https:\/\/bit\.ly\/fcc-relaxing-cat$/i.test($("img").attr("src"))); + - text: Your image element's alt attribute must not be empty. + testString: assert($("img").attr("alt") && $("img").attr("alt").length && /)\S+\1\S*\/?>/.test(code.replace(/\s/g,''))); ```