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 textpull/35813/head^2
parent
9b9a96234f
commit
394ae3d1ce
|
@ -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);
|
||||
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue