fix : Unclear test output use-array.map-to-dynamically-render-… (#38191)
This commit is contained in:
@ -28,6 +28,8 @@ tests:
|
|||||||
testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find('MyToDoList').length === 1; })());
|
testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find('MyToDoList').length === 1; })());
|
||||||
- text: The first child of <code>MyToDoList</code> should be a <code>textarea</code> element.
|
- text: The first child of <code>MyToDoList</code> should be a <code>textarea</code> element.
|
||||||
testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find('MyToDoList').children().childAt(0).type() === 'textarea'; })());
|
testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find('MyToDoList').children().childAt(0).type() === 'textarea'; })());
|
||||||
|
- text: The second child of <code>MyToDoList</code> should be a <code>br</code> element.
|
||||||
|
testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find('MyToDoList').children().childAt(1).type() === 'br'; })());
|
||||||
- text: The third child of <code>MyToDoList</code> should be a <code>button</code> element.
|
- text: The third child of <code>MyToDoList</code> should be a <code>button</code> element.
|
||||||
testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find('MyToDoList').children().childAt(2).type() === 'button'; })());
|
testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(MyToDoList)); return mockedComponent.find('MyToDoList').children().childAt(2).type() === 'button'; })());
|
||||||
- text: The state of <code>MyToDoList</code> should be initialized with <code>toDoList</code> as an empty array.
|
- text: The state of <code>MyToDoList</code> should be initialized with <code>toDoList</code> as an empty array.
|
||||||
@ -80,7 +82,8 @@ class MyToDoList extends React.Component {
|
|||||||
onChange={this.handleChange}
|
onChange={this.handleChange}
|
||||||
value={this.state.userInput}
|
value={this.state.userInput}
|
||||||
style={textAreaStyles}
|
style={textAreaStyles}
|
||||||
placeholder="Separate Items With Commas" /><br />
|
placeholder="Separate Items With Commas" />
|
||||||
|
<br />
|
||||||
<button onClick={this.handleSubmit}>Create List</button>
|
<button onClick={this.handleSubmit}>Create List</button>
|
||||||
<h1>My "To Do" List:</h1>
|
<h1>My "To Do" List:</h1>
|
||||||
<ul>
|
<ul>
|
||||||
@ -94,7 +97,6 @@ class MyToDoList extends React.Component {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
### After Test
|
### After Test
|
||||||
<div id='jsx-teardown'>
|
<div id='jsx-teardown'>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user