fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes * fix(curriculum): fill seed-teardown * fix(curriculum): fix tests and remove unneeded seed-teardown
This commit is contained in:
committed by
mrugesh mohapatra
parent
96eb124163
commit
79d9012432
@ -24,8 +24,8 @@ Camper Cat happens to be both a coding ninja and an actual ninja, and is buildin
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: 'Your <code>img</code> tag should have an <code>alt</code> attribute, and it should not be empty.'
|
||||
testString: 'assert($("img").attr("alt"), "Your <code>img</code> tag should have an <code>alt</code> attribute, and it should not be empty.");'
|
||||
- text: Your <code>img</code> tag should have an <code>alt</code> attribute, and it should not be empty.
|
||||
testString: assert($('img').attr('alt'), 'Your <code>img</code> tag should have an <code>alt</code> attribute, and it should not be empty.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,13 +25,13 @@ Camper Cat is setting up a Mortal Kombat tournament and wants to ask his competi
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should add one <code>input</code> tag for the date selector field.
|
||||
testString: 'assert($("input").length == 2, "Your code should add one <code>input</code> tag for the date selector field.");'
|
||||
testString: assert($('input').length == 2, 'Your code should add one <code>input</code> tag for the date selector field.');
|
||||
- text: Your <code>input</code> tag should have a <code>type</code> attribute with a value of date.
|
||||
testString: 'assert($("input").attr("type") == "date", "Your <code>input</code> tag should have a <code>type</code> attribute with a value of date.");'
|
||||
testString: assert($('input').attr('type') == 'date', 'Your <code>input</code> tag should have a <code>type</code> attribute with a value of date.');
|
||||
- text: Your <code>input</code> tag should have an <code>id</code> attribute with a value of pickdate.
|
||||
testString: 'assert($("input").attr("id") == "pickdate", "Your <code>input</code> tag should have an <code>id</code> attribute with a value of pickdate.");'
|
||||
testString: assert($('input').attr('id') == 'pickdate', 'Your <code>input</code> tag should have an <code>id</code> attribute with a value of pickdate.');
|
||||
- text: Your <code>input</code> tag should have a <code>name</code> attribute with a value of date.
|
||||
testString: 'assert($("input").attr("name") == "date", "Your <code>input</code> tag should have a <code>name</code> attribute with a value of date.");'
|
||||
testString: assert($('input').attr('name') == 'date', 'Your <code>input</code> tag should have a <code>name</code> attribute with a value of date.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Camper Cat is testing different styles for an important button, but the yellow (
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should change the text <code>color</code> for the <code>button</code> to the dark blue.
|
||||
testString: 'assert($("button").css("color") == "rgb(0, 51, 102)", "Your code should change the text <code>color</code> for the <code>button</code> to the dark blue.");'
|
||||
testString: assert($('button').css('color') == 'rgb(0, 51, 102)', 'Your code should change the text <code>color</code> for the <code>button</code> to the dark blue.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,9 +24,9 @@ Camper Cat is experimenting with using color for his blog text and background, b
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should only change the lightness value for the text <code>color</code> property to a value of 15%.
|
||||
testString: 'assert(code.match(/color:\s*?hsl\(0,\s*?55%,\s*?15%\)/gi), "Your code should only change the lightness value for the text <code>color</code> property to a value of 15%.");'
|
||||
testString: assert(code.match(/color:\s*?hsl\(0,\s*?55%,\s*?15%\)/gi), 'Your code should only change the lightness value for the text <code>color</code> property to a value of 15%.');
|
||||
- text: Your code should only change the lightness value for the <code>background-color</code> property to a value of 55%.
|
||||
testString: 'assert(code.match(/background-color:\s*?hsl\(120,\s*?25%,\s*?55%\)/gi), "Your code should only change the lightness value for the <code>background-color</code> property to a value of 55%.");'
|
||||
testString: assert(code.match(/background-color:\s*?hsl\(120,\s*?25%,\s*?55%\)/gi), 'Your code should only change the lightness value for the <code>background-color</code> property to a value of 55%.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,9 +22,9 @@ The link text that Camper Cat is using is not very descriptive without the surro
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should move the anchor <code>a</code> tags from around the words "Click here" to wrap around the words "information about batteries".
|
||||
testString: 'assert($("a").text().match(/^(information about batteries)$/g), "Your code should move the anchor <code>a</code> tags from around the words "Click here" to wrap around the words "information about batteries".");'
|
||||
testString: assert($('a').text().match(/^(information about batteries)$/g), 'Your code should move the anchor <code>a</code> tags from around the words "Click here" to wrap around the words "information about batteries".');
|
||||
- text: Make sure your <code>a</code> element has a closing tag.
|
||||
testString: 'assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(/<a href=(""|"")>/g).length, "Make sure your <code>a</code> element has a closing tag.");'
|
||||
testString: assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(/<a href=(''|"")>/g).length, 'Make sure your <code>a</code> element has a closing tag.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,19 +26,19 @@ Time to take a break from Camper Cat and meet fellow camper Zersiax (@zersiax),
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have one <code>audio</code> tag.
|
||||
testString: 'assert($("audio").length === 1, "Your code should have one <code>audio</code> tag.");'
|
||||
testString: assert($('audio').length === 1, 'Your code should have one <code>audio</code> tag.');
|
||||
- text: Make sure your <code>audio</code> element has a closing tag.
|
||||
testString: 'assert(code.match(/<\/audio>/g).length === 1 && code.match(/<audio.*>[\s\S]*<\/audio>/g), "Make sure your <code>audio</code> element has a closing tag.");'
|
||||
testString: assert(code.match(/<\/audio>/g).length === 1 && code.match(/<audio.*>[\s\S]*<\/audio>/g), 'Make sure your <code>audio</code> element has a closing tag.');
|
||||
- text: The <code>audio</code> tag should have the <code>controls</code> attribute.
|
||||
testString: 'assert($("audio").attr("controls"), "The <code>audio</code> tag should have the <code>controls</code> attribute.");'
|
||||
testString: assert($('audio').attr('controls'), 'The <code>audio</code> tag should have the <code>controls</code> attribute.');
|
||||
- text: Your code should have one <code>source</code> tag.
|
||||
testString: 'assert($("source").length === 1, "Your code should have one <code>source</code> tag.");'
|
||||
testString: assert($('source').length === 1, 'Your code should have one <code>source</code> tag.');
|
||||
- text: Your <code>source</code> tag should be inside the <code>audio</code> tags.
|
||||
testString: 'assert($("audio").children("source").length === 1, "Your <code>source</code> tag should be inside the <code>audio</code> tags.");'
|
||||
testString: assert($('audio').children('source').length === 1, 'Your <code>source</code> tag should be inside the <code>audio</code> tags.');
|
||||
- text: The value for the <code>src</code> attribute on the <code>source</code> tag should match the link in the instructions exactly.
|
||||
testString: 'assert($("source").attr("src") === "https://s3.amazonaws.com/freecodecamp/screen-reader.mp3", "The value for the <code>src</code> attribute on the <code>source</code> tag should match the link in the instructions exactly.");'
|
||||
testString: assert($('source').attr('src') === 'https://s3.amazonaws.com/freecodecamp/screen-reader.mp3', 'The value for the <code>src</code> attribute on the <code>source</code> tag should match the link in the instructions exactly.');
|
||||
- text: Your code should include a <code>type</code> attribute on the <code>source</code> tag with a value of audio/mpeg.
|
||||
testString: 'assert($("source").attr("type") === "audio/mpeg", "Your code should include a <code>type</code> attribute on the <code>source</code> tag with a value of audio/mpeg.");'
|
||||
testString: assert($('source').attr('type') === 'audio/mpeg', 'Your code should include a <code>type</code> attribute on the <code>source</code> tag with a value of audio/mpeg.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,17 +24,17 @@ Camper Cat is hard at work creating a stacked bar chart showing the amount of ti
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have one <code>figure</code> tag.
|
||||
testString: 'assert($("figure").length == 1, "Your code should have one <code>figure</code> tag.");'
|
||||
testString: assert($('figure').length == 1, 'Your code should have one <code>figure</code> tag.');
|
||||
- text: Your code should have one <code>figcaption</code> tag.
|
||||
testString: 'assert($("figcaption").length == 1, "Your code should have one <code>figcaption</code> tag.");'
|
||||
testString: assert($('figcaption').length == 1, 'Your code should have one <code>figcaption</code> tag.');
|
||||
- text: Your code should not have any <code>div</code> tags.
|
||||
testString: 'assert($("div").length == 0, "Your code should not have any <code>div</code> tags.");'
|
||||
testString: assert($('div').length == 0, 'Your code should not have any <code>div</code> tags.');
|
||||
- text: Your code should not have any <code>p</code> tags.
|
||||
testString: 'assert($("p").length == 0, "Your code should not have any <code>p</code> tags.");'
|
||||
testString: assert($('p').length == 0, 'Your code should not have any <code>p</code> tags.');
|
||||
- text: The <code>figcaption</code> should be a child of the <code>figure</code> tag.
|
||||
testString: 'assert($("figure").children("figcaption").length == 1, "The <code>figcaption</code> should be a child of the <code>figure</code> tag.");'
|
||||
testString: assert($('figure').children('figcaption').length == 1, 'The <code>figcaption</code> should be a child of the <code>figure</code> tag.');
|
||||
- text: Make sure your <code>figure</code> element has a closing tag.
|
||||
testString: 'assert(code.match(/<\/figure>/g) && code.match(/<\/figure>/g).length === code.match(/<figure>/g).length, "Make sure your <code>figure</code> element has a closing tag.");'
|
||||
testString: assert(code.match(/<\/figure>/g) && code.match(/<\/figure>/g).length === code.match(/<figure>/g).length, 'Make sure your <code>figure</code> element has a closing tag.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,9 +25,9 @@ Camper Cat expects a lot of interest in his thoughtful blog posts, and wants to
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have a <code>for</code> attribute on the <code>label</code> tag that is not empty.
|
||||
testString: 'assert($("label").attr("for"), "Your code should have a <code>for</code> attribute on the <code>label</code> tag that is not empty.");'
|
||||
testString: assert($('label').attr('for'), 'Your code should have a <code>for</code> attribute on the <code>label</code> tag that is not empty.');
|
||||
- text: Your <code>for</code> attribute value should match the <code>id</code> value on the email <code>input</code>.
|
||||
testString: 'assert($("label").attr("for") == "email", "Your <code>for</code> attribute value should match the <code>id</code> value on the email <code>input</code>.");'
|
||||
testString: assert($('label').attr('for') == 'email', 'Your <code>for</code> attribute value should match the <code>id</code> value on the email <code>input</code>.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,9 +22,9 @@ Camper Cat's choice of light gray text on a white background for his recent blog
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should change the text <code>color</code> for the <code>body</code> to the darker gray.
|
||||
testString: 'assert($("body").css("color") == "rgb(99, 99, 99)", "Your code should change the text <code>color</code> for the <code>body</code> to the darker gray.");'
|
||||
testString: assert($('body').css('color') == 'rgb(99, 99, 99)', 'Your code should change the text <code>color</code> for the <code>body</code> to the darker gray.');
|
||||
- text: Your code should not change the <code>background-color</code> for the <code>body</code>.
|
||||
testString: 'assert($("body").css("background-color") == "rgb(255, 255, 255)", "Your code should not change the <code>background-color</code> for the <code>body</code>.");'
|
||||
testString: assert($('body').css('background-color') == 'rgb(255, 255, 255)', 'Your code should not change the <code>background-color</code> for the <code>body</code>.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,9 +24,9 @@ Camper Cat has some big ideas for his ninja weapons page. Help him set up his ma
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have one <code>main</code> tag.
|
||||
testString: 'assert($("main").length == 1, "Your code should have one <code>main</code> tag.");'
|
||||
testString: assert($('main').length == 1, 'Your code should have one <code>main</code> tag.');
|
||||
- text: The <code>main</code> tags should be between the closing <code>header</code> tag and the opening <code>footer</code> tag.
|
||||
testString: 'assert(code.match(/<\/header>\s*?<main>\s*?<\/main>/gi), "The <code>main</code> tags should be between the closing <code>header</code> tag and the opening <code>footer</code> tag.");'
|
||||
testString: assert(code.match(/<\/header>\s*?<main>\s*?<\/main>/gi), 'The <code>main</code> tags should be between the closing <code>header</code> tag and the opening <code>footer</code> tag.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,9 +25,9 @@ Camper Cat has coded a skeleton page for the blog part of his website. He's plan
|
||||
```yml
|
||||
tests:
|
||||
- text: Your <code>img</code> tag should have an <code>alt</code> attribute.
|
||||
testString: 'assert(!($("img").attr("alt") == undefined), "Your <code>img</code> tag should have an <code>alt</code> attribute.");'
|
||||
testString: assert(!($('img').attr('alt') == undefined), 'Your <code>img</code> tag should have an <code>alt</code> attribute.');
|
||||
- text: The <code>alt</code> attribute should be set to an empty string.
|
||||
testString: 'assert($("img").attr("alt") == "", "The <code>alt</code> attribute should be set to an empty string.");'
|
||||
testString: assert($('img').attr('alt') == '', 'The <code>alt</code> attribute should be set to an empty string.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -29,13 +29,13 @@ Camper Cat created a really cool stacked bar chart for his training page, and pu
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should set the <code>position</code> property of the <code>sr-only</code> class to a value of absolute.
|
||||
testString: 'assert($(".sr-only").css("position") == "absolute", "Your code should set the <code>position</code> property of the <code>sr-only</code> class to a value of absolute.");'
|
||||
testString: assert($('.sr-only').css('position') == 'absolute', 'Your code should set the <code>position</code> property of the <code>sr-only</code> class to a value of absolute.');
|
||||
- text: Your code should set the <code>left</code> property of the <code>sr-only</code> class to a value of -10000px.
|
||||
testString: 'assert($(".sr-only").css("left") == "-10000px", "Your code should set the <code>left</code> property of the <code>sr-only</code> class to a value of -10000px.");'
|
||||
testString: assert($('.sr-only').css('left') == '-10000px', 'Your code should set the <code>left</code> property of the <code>sr-only</code> class to a value of -10000px.');
|
||||
- text: Your code should set the <code>width</code> property of the <code>sr-only</code> class to a value of 1 pixel.
|
||||
testString: 'assert(code.match(/width:\s*?1px/gi), "Your code should set the <code>width</code> property of the <code>sr-only</code> class to a value of 1 pixel.");'
|
||||
testString: assert(code.match(/width:\s*?1px/gi), 'Your code should set the <code>width</code> property of the <code>sr-only</code> class to a value of 1 pixel.');
|
||||
- text: Your code should set the <code>height</code> property of the <code>sr-only</code> class to a value of 1 pixel.
|
||||
testString: 'assert(code.match(/height:\s*?1px/gi), "Your code should set the <code>height</code> property of the <code>sr-only</code> class to a value of 1 pixel.");'
|
||||
testString: assert(code.match(/height:\s*?1px/gi), 'Your code should set the <code>height</code> property of the <code>sr-only</code> class to a value of 1 pixel.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,13 +24,13 @@ Camper Cat wants the links around the two blog article titles to have keyboard s
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should add an <code>accesskey</code> attribute to the <code>a</code> tag with the <code>id</code> of "first".
|
||||
testString: 'assert($("#first").attr("accesskey"), "Your code should add an <code>accesskey</code> attribute to the <code>a</code> tag with the <code>id</code> of "first".");'
|
||||
testString: assert($('#first').attr('accesskey'), 'Your code should add an <code>accesskey</code> attribute to the <code>a</code> tag with the <code>id</code> of "first".');
|
||||
- text: Your code should add an <code>accesskey</code> attribute to the <code>a</code> tag with the <code>id</code> of "second".
|
||||
testString: 'assert($("#second").attr("accesskey"), "Your code should add an <code>accesskey</code> attribute to the <code>a</code> tag with the <code>id</code> of "second".");'
|
||||
testString: assert($('#second').attr('accesskey'), 'Your code should add an <code>accesskey</code> attribute to the <code>a</code> tag with the <code>id</code> of "second".');
|
||||
- text: Your code should set the <code>accesskey</code> attribute on the <code>a</code> tag with the <code>id</code> of "first" to "g". Note that case matters.
|
||||
testString: 'assert($("#first").attr("accesskey") == "g", "Your code should set the <code>accesskey</code> attribute on the <code>a</code> tag with the <code>id</code> of "first" to "g". Note that case matters.");'
|
||||
testString: assert($('#first').attr('accesskey') == 'g', 'Your code should set the <code>accesskey</code> attribute on the <code>a</code> tag with the <code>id</code> of "first" to "g". Note that case matters.');
|
||||
- text: Your code should set the <code>accesskey</code> attribute on the <code>a</code> tag with the <code>id</code> of "second" to "c". Note that case matters.
|
||||
testString: 'assert($("#second").attr("accesskey") == "c", "Your code should set the <code>accesskey</code> attribute on the <code>a</code> tag with the <code>id</code> of "second" to "c". Note that case matters.");'
|
||||
testString: assert($('#second').attr('accesskey') == 'c', 'Your code should set the <code>accesskey</code> attribute on the <code>a</code> tag with the <code>id</code> of "second" to "c". Note that case matters.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -21,11 +21,11 @@ Camper Cat's training page is making good progress. Change the <code>div</code>
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have one <code>footer</code> tag.
|
||||
testString: 'assert($("footer").length == 1, "Your code should have one <code>footer</code> tag.");'
|
||||
testString: assert($('footer').length == 1, 'Your code should have one <code>footer</code> tag.');
|
||||
- text: Your code should not have any <code>div</code> tags.
|
||||
testString: 'assert($("div").length == 0, "Your code should not have any <code>div</code> tags.");'
|
||||
testString: assert($('div').length == 0, 'Your code should not have any <code>div</code> tags.');
|
||||
- text: Your code should have an opening and closing <code>footer</code> tag.
|
||||
testString: 'assert(code.match(/<footer>\s*© 2018 Camper Cat\s*<\/footer>/g), "Your code should have an opening and closing <code>footer</code> tag.");'
|
||||
testString: assert(code.match(/<footer>\s*© 2018 Camper Cat\s*<\/footer>/g), 'Your code should have an opening and closing <code>footer</code> tag.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,13 +23,13 @@ Camper Cat is writing some great articles about ninja training, and wants to add
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have one <code>header</code> tag.
|
||||
testString: 'assert($("header").length == 1, "Your code should have one <code>header</code> tag.");'
|
||||
testString: assert($('header').length == 1, 'Your code should have one <code>header</code> tag.');
|
||||
- text: Your <code>header</code> tags should wrap around the <code>h1</code>.
|
||||
testString: 'assert($("header").children("h1").length == 1, "Your <code>header</code> tags should wrap around the <code>h1</code>.");'
|
||||
testString: assert($('header').children('h1').length == 1, 'Your <code>header</code> tags should wrap around the <code>h1</code>.');
|
||||
- text: Your code should not have any <code>div</code> tags.
|
||||
testString: 'assert($("div").length == 0, "Your code should not have any <code>div</code> tags.");'
|
||||
testString: assert($('div').length == 0, 'Your code should not have any <code>div</code> tags.');
|
||||
- text: Make sure your <code>header</code> element has a closing tag.
|
||||
testString: 'assert(code.match(/<\/header>/g) && code.match(/<\/header>/g).length === code.match(/<header>/g).length, "Make sure your <code>header</code> element has a closing tag.");'
|
||||
testString: assert(code.match(/<\/header>/g) && code.match(/<\/header>/g).length === code.match(/<header>/g).length, 'Make sure your <code>header</code> element has a closing tag.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,13 +22,13 @@ Camper Cat included navigation links at the top of his training page, but wrappe
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have one <code>nav</code> tag.
|
||||
testString: 'assert($("nav").length == 1, "Your code should have one <code>nav</code> tag.");'
|
||||
testString: assert($('nav').length == 1, 'Your code should have one <code>nav</code> tag.');
|
||||
- text: Your <code>nav</code> tags should wrap around the <code>ul</code> and its list items.
|
||||
testString: 'assert($("nav").children("ul").length == 1, "Your <code>nav</code> tags should wrap around the <code>ul</code> and its list items.");'
|
||||
testString: assert($('nav').children('ul').length == 1, 'Your <code>nav</code> tags should wrap around the <code>ul</code> and its list items.');
|
||||
- text: Your code should not have any <code>div</code> tags.
|
||||
testString: 'assert($("div").length == 0, "Your code should not have any <code>div</code> tags.");'
|
||||
testString: assert($('div').length == 0, 'Your code should not have any <code>div</code> tags.');
|
||||
- text: Make sure your <code>nav</code> element has a closing tag.
|
||||
testString: 'assert(code.match(/<\/nav>/g) && code.match(/<\/nav>/g).length === code.match(/<nav>/g).length, "Make sure your <code>nav</code> element has a closing tag.");'
|
||||
testString: assert(code.match(/<\/nav>/g) && code.match(/<\/nav>/g).length === code.match(/<nav>/g).length, 'Make sure your <code>nav</code> element has a closing tag.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,14 +22,14 @@ Camper Cat's Mortal Kombat survey results are in! Wrap a <code>time</code> tag a
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: 'Your <code>time</code> tags should wrap around the text "Thursday, September 15<sup>th</sup>".'
|
||||
testString: 'assert($("time").text().match(/Thursday, September 15th/g), "Your <code>time</code> tags should wrap around the text "Thursday, September 15<sup>th</sup>".");'
|
||||
- text: Your <code>time</code> tags should wrap around the text "Thursday, September 15<sup>th</sup>".
|
||||
testString: assert($('time').text().match(/Thursday, September 15th/g), 'Your <code>time</code> tags should wrap around the text "Thursday, September 15<sup>th</sup>".');
|
||||
- text: Your <code>time</code> tag should have a <code>datetime</code> attribute that is not empty.
|
||||
testString: 'assert($("time").attr("datetime"), "Your <code>time</code> tag should have a <code>datetime</code> attribute that is not empty.");'
|
||||
testString: assert($('time').attr('datetime'), 'Your <code>time</code> tag should have a <code>datetime</code> attribute that is not empty.');
|
||||
- text: Your <code>datetime</code> attribute should be set to a value of 2016-09-15.
|
||||
testString: 'assert($("time").attr("datetime") === "2016-09-15", "Your <code>datetime</code> attribute should be set to a value of 2016-09-15.");'
|
||||
testString: assert($('time').attr('datetime') === "2016-09-15", 'Your <code>datetime</code> attribute should be set to a value of 2016-09-15.');
|
||||
- text: Make sure your <code>time</code> element has a closing tag.
|
||||
testString: 'assert(code.match(/<\/time>/g) && code.match(/<\/time>/g).length === 4, "Make sure your <code>time</code> element has a closing tag.");'
|
||||
testString: assert(code.match(/<\/time>/g) && code.match(/<\/time>/g).length === 4, 'Make sure your <code>time</code> element has a closing tag.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,9 +26,9 @@ Camper Cat wants a page on his site dedicated to becoming a ninja. Help him fix
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have six <code>h3</code> tags.
|
||||
testString: 'assert($("h3").length === 6, "Your code should have six <code>h3</code> tags.");'
|
||||
testString: assert($('h3').length === 6, 'Your code should have six <code>h3</code> tags.');
|
||||
- text: Your code should not have any <code>h5</code> tags.
|
||||
testString: 'assert($("h5").length === 0, "Your code should not have any <code>h5</code> tags.");'
|
||||
testString: assert($('h5').length === 0, 'Your code should not have any <code>h5</code> tags.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,9 +24,9 @@ Camper Cat created a new survey to collect information about his users. He knows
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should add a <code>tabindex</code> attribute to the <code>p</code> tag that holds the form instructions.
|
||||
testString: 'assert($("p").attr("tabindex"), "Your code should add a <code>tabindex</code> attribute to the <code>p</code> tag that holds the form instructions.");'
|
||||
testString: assert($('p').attr('tabindex'), 'Your code should add a <code>tabindex</code> attribute to the <code>p</code> tag that holds the form instructions.');
|
||||
- text: Your code should set the <code>tabindex</code> attribute on the <code>p</code> tag to a value of 0.
|
||||
testString: 'assert($("p").attr("tabindex") == "0", "Your code should set the <code>tabindex</code> attribute on the <code>p</code> tag to a value of 0.");'
|
||||
testString: assert($('p').attr('tabindex') == '0', 'Your code should set the <code>tabindex</code> attribute on the <code>p</code> tag to a value of 0.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,13 +26,13 @@ Camper Cat has a search field on his Inspirational Quotes page that he plans to
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should add a <code>tabindex</code> attribute to the search <code>input</code> tag.
|
||||
testString: 'assert($("#search").attr("tabindex"), "Your code should add a <code>tabindex</code> attribute to the search <code>input</code> tag.");'
|
||||
testString: assert($('#search').attr('tabindex'), 'Your code should add a <code>tabindex</code> attribute to the search <code>input</code> tag.');
|
||||
- text: Your code should add a <code>tabindex</code> attribute to the submit <code>input</code> tag.
|
||||
testString: 'assert($("#submit").attr("tabindex"), "Your code should add a <code>tabindex</code> attribute to the submit <code>input</code> tag.");'
|
||||
testString: assert($('#submit').attr('tabindex'), 'Your code should add a <code>tabindex</code> attribute to the submit <code>input</code> tag.');
|
||||
- text: Your code should set the <code>tabindex</code> attribute on the search <code>input</code> tag to a value of 1.
|
||||
testString: 'assert($("#search").attr("tabindex") == "1", "Your code should set the <code>tabindex</code> attribute on the search <code>input</code> tag to a value of 1.");'
|
||||
testString: assert($('#search').attr('tabindex') == '1', 'Your code should set the <code>tabindex</code> attribute on the search <code>input</code> tag to a value of 1.');
|
||||
- text: Your code should set the <code>tabindex</code> attribute on the submit <code>input</code> tag to a value of 2.
|
||||
testString: 'assert($("#submit").attr("tabindex") == "2", "Your code should set the <code>tabindex</code> attribute on the submit <code>input</code> tag to a value of 2.");'
|
||||
testString: assert($('#submit').attr('tabindex') == '2', 'Your code should set the <code>tabindex</code> attribute on the submit <code>input</code> tag to a value of 2.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,9 +25,9 @@ Camper Cat used <code>article</code> tags to wrap the posts on his blog page, bu
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have three <code>article</code> tags.
|
||||
testString: 'assert($("article").length == 3, "Your code should have three <code>article</code> tags.");'
|
||||
testString: assert($('article').length == 3, 'Your code should have three <code>article</code> tags.');
|
||||
- text: Your code should not have any <code>div</code> tags.
|
||||
testString: 'assert($("div").length == 0, "Your code should not have any <code>div</code> tags.");'
|
||||
testString: assert($('div').length == 0, 'Your code should not have any <code>div</code> tags.');
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,15 +25,15 @@ Camper Cat wants information about the ninja level of his users when they sign u
|
||||
```yml
|
||||
tests:
|
||||
- text: Your code should have a <code>fieldset</code> tag around the radio button set.
|
||||
testString: 'assert($("fieldset").length == 1, "Your code should have a <code>fieldset</code> tag around the radio button set.");'
|
||||
testString: assert($('fieldset').length == 1, 'Your code should have a <code>fieldset</code> tag around the radio button set.');
|
||||
- text: Make sure your <code>fieldset</code> element has a closing tag.
|
||||
testString: 'assert(code.match(/<\/fieldset>/g) && code.match(/<\/fieldset>/g).length === code.match(/<fieldset>/g).length, "Make sure your <code>fieldset</code> element has a closing tag.");'
|
||||
testString: assert(code.match(/<\/fieldset>/g) && code.match(/<\/fieldset>/g).length === code.match(/<fieldset>/g).length, 'Make sure your <code>fieldset</code> element has a closing tag.');
|
||||
- text: Your code should have a <code>legend</code> tag around the text asking what level ninja a user is.
|
||||
testString: 'assert($("legend").length == 1, "Your code should have a <code>legend</code> tag around the text asking what level ninja a user is.");'
|
||||
testString: assert($('legend').length == 1, 'Your code should have a <code>legend</code> tag around the text asking what level ninja a user is.');
|
||||
- text: Your code should not have any <code>div</code> tags.
|
||||
testString: 'assert($("div").length == 0, "Your code should not have any <code>div</code> tags.");'
|
||||
testString: assert($('div').length == 0, 'Your code should not have any <code>div</code> tags.');
|
||||
- text: Your code should no longer have a <code>p</code> tag around the text asking what level ninja a user is.
|
||||
testString: 'assert($("p").length == 4, "Your code should no longer have a <code>p</code> tag around the text asking what level ninja a user is.");'
|
||||
testString: assert($('p').length == 4, 'Your code should no longer have a <code>p</code> tag around the text asking what level ninja a user is.');
|
||||
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user