Thank you for creating this kind of TDD tutorial!!
I couldn’t pass e2e-tests after added undelete a todo.
The result of e2e-test showed this error.
> Tats-MacBA-6:my-react-todolist AsamiTasuya$ npm run e2e-tests
>
> > my-react-todolist@0.1.0 e2e-tests /Users/AsamiTasuya/my-react-todolist
> > wdio wdio.conf.js
>
>
> ․․․undefined
> F
>
> 3 passing (6.00s)
> 1 failing
>
> 1) TodoList App Should allow me to undelete a Todo:
> expected undefined to equal ‘success’
> running chrome
> AssertionError: expected undefined to equal ‘success’
> at Context.it (/Users/AsamiTasuya/my-react-todolist/e2etests/test.js:44:29)
> at new Promise (<anonymous>)
> at new F (/Users/AsamiTasuya/my-react-todolist/node_modules/core-js/library/modules/_export.js:36:28)
This is the part of e2e-test code I couldn’t pass.
```
// e2etests/test.js
it(‘Should allow me to undelete a Todo’, () => {
const todoText = ‘Get better at testing’;
browser.url(‘http://localhost:3000/');
browser.element(‘.todo-input’).setValue(todoText);
browser.click(‘.todo-submit’);
browser.click(‘.todo-delete’);
browser.click(‘.todo-undelete’);
const actual = browser.element(‘.todo-text’);
expect(actual.state).to.equal(‘success’);
});
```
After revised the code in e2etests/test.js, I passed all 4 e2e-tests!
```
// e2etests/test.js
it(‘Should allow me to undelete a Todo’, () => {
const todoText = ‘Get better at testing’;
browser.url(‘http://localhost:3000/');
browser.element(‘.todo-input’).setValue(todoText);
browser.click(‘.todo-submit’);
browser.click(‘.todo-delete’);
browser.click(‘.todo-undelete’);
const actual = browser.element(‘.todo-text’).getText();
expect(actual).to.equal(todoText);
});
```
Thanks,