From 438e7d4c51389363a445040c4d518d01589734b2 Mon Sep 17 00:00:00 2001 From: Steven Failla Date: Fri, 28 Jun 2019 18:49:00 -0400 Subject: [PATCH] =?UTF-8?q?fixed=20testString=20to=20disallow=20any=20extr?= =?UTF-8?q?a=20characters=20from=20passing.=20Also=20=E2=80=A6=20(#35987)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixed testString to disallow any extra characters from passing. Also changed markup in testString and text * Update curriculum/challenges/english/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.english.md Co-Authored-By: Stevo99 * fixed test so it won't pass if datetime attr is left blank * fixed test so it will not pass if datetime attribute is left empty * fixed error in testString where test would pass if user runs test right away * added tear-down div to make test code look cleaner * fixed merge conflict. added tear-down div to make code look cleaner * fixed testString to disallow any extra characters from passing. Also changed markup in testString and text * Update curriculum/challenges/english/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.english.md improvement to test case where element should have closing tag. Co-Authored-By: Oliver Eyton-Williams * fixed conflict in git * Update curriculum/challenges/english/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.english.md removed unnecessary test Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * Update curriculum/challenges/english/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.english.md removed unnecessary test Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> --- ...th-the-html5-datetime-attribute.english.md | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.english.md b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.english.md index 969ce98133..c9d6ba2f22 100644 --- a/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/applied-accessibility/standardize-times-with-the-html5-datetime-attribute.english.md @@ -22,15 +22,14 @@ Camper Cat's Mortal Kombat survey results are in! Wrap a time tag a ```yml tests: - - text: Your time tags should wrap around the text "Thursday, September 15<sup>th</sup>". - testString: assert($('time').text().match(/Thursday, September 15th/g), 'Your time tags should wrap around the text "Thursday, September 15<sup>th</sup>".'); - - text: Your time tag should have a datetime attribute that is not empty. - testString: assert($('time').attr('datetime'), 'Your time tag should have a datetime attribute that is not empty.'); - - text: Your datetime attribute should be set to a value of 2016-09-15. - testString: assert($('time').attr('datetime') === "2016-09-15", 'Your datetime attribute should be set to a value of 2016-09-15.'); - - text: Make sure your time element has a closing tag. - testString: assert(code.match(/<\/time>/g) && code.match(/<\/time>/g).length === 4, 'Make sure your time element has a closing tag.'); - + - text: Your code should have a p element which includes the text "Thank you to everyone for responding to Master Camper Cat's survey." and include a time element. + testString: assert(timeElement.length); + - text: Your added time tags should wrap around the text "Thursday, September 15<sup>th</sup>". + testString: assert(timeElement.length && $(timeElement).html().trim() === "Thursday, September 15th"); + - text: Your added time tag should have a datetime attribute that is not empty. + testString: assert(datetimeAttr && datetimeAttr.length); + - text: Your added datetime attribute should be set to a value of 2016-09-15. + testString: assert(datetimeAttr === "2016-09-15"); ``` @@ -76,7 +75,18 @@ tests: +
+```html + +``` + +