Skip to content

Commit

Permalink
Remove commented tests in hw 10 and remove backticks in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Franverri committed Apr 14, 2021
1 parent 6cdbdfb commit b000bd5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 55 deletions.
2 changes: 1 addition & 1 deletion 10-React-Forms/homework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ Para eso vamos a agregar dos cosas:
...
<div>
<label>Username:</label>
<input className={`${errors.username && 'danger'}`}
<input className={errors.username && 'danger'}
type="text" name="username" onChange={handleInputChange} value={input.username} />
{errors.username && (
<p className="danger">{errors.username}</p>
Expand Down
54 changes: 0 additions & 54 deletions 10-React-Forms/homework/src/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,57 +48,3 @@ describe('<Form />', () => {
});
});
});

// describe('<Form />', () => {
// let wrapper;
// const setState = jest.fn();
// const useStateSpy = jest.spyOn(React, 'useState')
// useStateSpy.mockImplementation((init) => [init, setState]);
//
// beforeEach(() => {
// wrapper = shallow(<Form />);
// });
//
// afterEach(() => {
// jest.clearAllMocks();
// });
//
// describe('Estados: ', () => {
// it('El form deberia cambiar de estado cuando escriban en el input de username', () => {
// wrapper.find('input[name="username"]').simulate('change', {target: {name: 'username', value: 'My new value'}});
// console.log(wrapper.find('input[name="username"]'));
// expect(setState).toHaveBeenCalledWith({"username": "My new value", "password": ""});
// });
// it('El form deberia cambiar de estado cuando escriban en el input de password', () => {
// wrapper.find('input[name="username"]').simulate('change', {target: {name: 'password', value: 'My new value'}});
// expect(setState).toHaveBeenCalledWith({"username": "", "password": "My new value"});
// });
// });
//
// describe('Validacion: ', () => {
// it('validate debe devolver un objeto con un error si el usarname no es un email valido:', () => {
// expect(validate({
// username: 'dassadas',
// password: 'hola1'
// })).toEqual({username: 'Username is invalid'});
// });
// it('validate debe devolver un objeto con un error si el usarname esta vacio:', () => {
// expect(validate({
// username: '',
// password: 'hola1',
// })).toEqual({username: 'Username is required'});
// });
// it('validate debe devolver un objeto con un error si el password no tiene un numero:', () => {
// expect(validate({
// username: '[email protected]',
// password: 'dassadas'
// })).toEqual({password: 'Password is invalid'});
// });
// it('validate debe devolver un objeto con un error si el password esta vacio:', () => {
// expect(validate({
// username: '[email protected]',
// password: ''
// })).toEqual({password: 'Password is required'});
// });
// });
// });

0 comments on commit b000bd5

Please sign in to comment.