From 1957b1f63665f888b459215ffacb055f959a7b51 Mon Sep 17 00:00:00 2001 From: Alan Nguy Date: Fri, 1 Mar 2019 13:20:09 -0500 Subject: [PATCH] fix: added test case and working solution for empty li elements in the 'Create an ordered list' challenge. (#35177) * fix: added test case for empty li elements * fix: added error message in test case of empty li elements. * fix: corrected error in test case. * fix: added valid working solution * fix: migrated test case to challenge: create-an-ordered-list (working solution included) * fix: adjusted condition for empty li elements and fixed typo. --- ...reate-a-bulleted-unordered-list.english.md | 16 ++++++++++-- .../create-an-ordered-list.english.md | 26 +++++++++++++++++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.english.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.english.md index 476c4650a6..4f83b49ae1 100644 --- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-a-bulleted-unordered-list.english.md @@ -64,7 +64,19 @@ tests: ## Solution
-```js -// solution required +```html +

CatPhotoApp

+
+

Click here to view more cat photos.

+ + A cute orange cat lying on its back. + +
    +
  • milk
  • +
  • mice
  • +
  • catnip
  • +
+
``` +
diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-an-ordered-list.english.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-an-ordered-list.english.md index 2143daee70..49884d2172 100644 --- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-an-ordered-list.english.md +++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-an-ordered-list.english.md @@ -42,6 +42,10 @@ tests: testString: assert(code.match(/<\/ol>/g) && code.match(/<\/ol>/g).length === code.match(/
    /g).length, 'Make sure your ol element has a closing tag.'); - text: Make sure your li element has a closing tag. testString: assert(code.match(/<\/li>/g) && code.match(/
  1. /g) && code.match(/<\/li>/g).length === code.match(/
  2. /g).length, 'Make sure your li element has a closing tag.'); + - text: The li elements in your unordered list should not be empty. + testString: $('ul li').each((i, val) => assert(val.textContent.replace(/\s/g, ''), 'Your li elements in your unordered list should not be empty.')); + - text: The li elements in your ordered list should not be empty. + testString: $('ol li').each((i, val) => assert(!!val.textContent.replace(/\s/g, ''), 'Your li elements in your ordered list should not be empty.')); ``` @@ -79,7 +83,25 @@ tests: ## Solution
    -```js -// solution required +```html +

    CatPhotoApp

    +
    +

    Click here to view more cat photos.

    + + A cute orange cat lying on its back. + +

    Things cats love:

    +
      +
    • cat nip
    • +
    • laser pointers
    • +
    • lasagna
    • +
    +

    Top 3 things cats hate:

    +
      +
    1. hate 1
    2. +
    3. hate 2
    4. +
    5. hate 3
    6. +
    +
    ```