fix(challenge): check for li and specify elements accepting text (#35193)

* fix(challenge): check for li and specify elements accepting text

* fix(challenge): revert text

* fix(challenge): remove word added by mistake

* fix(challenge): update test, cleanup assertion text
pull/35813/head^2
lasjorg 2019-04-10 17:22:37 +02:00 committed by The Coding Aviator
parent 9b9a96234f
commit 394ae3d1ce
1 changed files with 7 additions and 7 deletions

View File

@ -31,15 +31,15 @@ An <code>h1</code>, a <code>p</code>, and an unordered list that contains three
```yml
tests:
- text: The constant <code>JSX</code> should return a <code>div</code> element.
testString: assert(JSX.type === 'div', 'The constant <code>JSX</code> should return a <code>div</code> element.');
- text: The <code>div</code> should contain a <code>p</code> tag as the second element.
testString: assert(JSX.props.children[1].type === 'p', 'The <code>div</code> should contain a <code>p</code> tag as the second element.');
- text: The <code>div</code> should contain a <code>ul</code> tag as the third element.
testString: assert(JSX.props.children[2].type === 'ul', 'The <code>div</code> should contain a <code>ul</code> tag as the third element.');
testString: assert(JSX.type === 'div');
- text: The <code>div</code> should contain an <code>h1</code> tag as the first element.
testString: assert(JSX.props.children[0].type === 'h1', 'The <code>div</code> should contain an <code>h1</code> tag as the first element.');
testString: assert(JSX.props.children[0].type === 'h1');
- text: The <code>div</code> should contain a <code>p</code> tag as the second element.
testString: assert(JSX.props.children[1].type === 'p');
- text: The <code>div</code> should contain a <code>ul</code> tag as the third element.
testString: assert(JSX.props.children[2].type === 'ul');
- text: The <code>ul</code> should contain three <code>li</code> elements.
testString: assert(JSX.props.children[2].props.children.length === 3, 'The <code>ul</code> should contain three <code>li</code> elements.');
testString: assert(JSX.props.children.filter(ele => ele.type === 'ul')[0].props.children.filter(ele => ele.type === 'li').length === 3);
```