From a32f719d3ad607aa410626041d0986e98136f31f Mon Sep 17 00:00:00 2001
From: Fabricio Asfora Lira <32206134+minggas@users.noreply.github.com>
Date: Tue, 2 Jul 2019 20:30:12 -0300
Subject: [PATCH] Fix/add a stricter test for the Add Placeholder Text to a
Text Field challenge (#36186)
* fix: add test for input closing tag
* fix: add condintion to final syntax test
This wil test if there's any character after the input tag that isn't a white space
* fix/tests+remove-not-needed-text
---
.../add-placeholder-text-to-a-text-field.english.md | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.english.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.english.md
index 4df1684497..ee5a958a0a 100644
--- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.english.md
+++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-placeholder-text-to-a-text-field.english.md
@@ -24,12 +24,13 @@ Set the placeholder value of your text input to "cat p
```yml
tests:
- text: Add a placeholder attribute to the existing text input element.
- testString: assert($("input[placeholder]").length > 0, 'Add a placeholder attribute to the existing text input element.');
+ testString: assert($("input[placeholder]").length > 0);
- text: Set the value of your placeholder attribute to "cat photo URL".
- testString: assert($("input") && $("input").attr("placeholder") && $("input").attr("placeholder").match(/cat\s+photo\s+URL/gi), 'Set the value of your placeholder attribute to "cat photo URL".');
+ testString: assert($("input") && $("input").attr("placeholder") && $("input").attr("placeholder").match(/cat\s+photo\s+URL/gi));
+ - text: The finished input element should not have a closing tag.
+ testString: assert(!code.match(/.*<\/input>/gi));
- text: The finished input element should have valid syntax.
- testString: assert($("input[type=text]").length > 0 && code.match(/\s]+))?)+\s*|\s*)\/?>/gi), 'The finished input element should have valid syntax.');
-
+ testString: assert($("input[type=text]").length > 0);
```