Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. // fragmento del test
  2.  
  3. describe('Form with data', ()=>{
  4. const props = {
  5. username: 'theuser',
  6. password: 'thepa$$word'
  7. };
  8. const wrapper = shallow(<Login {...props}/>);
  9. it('should delegate the username to .login__user', ()=>{
  10. expect(wrapper.find('.login__user').prop('value')).toBe(props.username);
  11. });
  12. it('should delegate the password to the Input', ()=>{
  13. expect(wrapper.find('.login__password').prop('value')).toBe(props.password);
  14. });
  15. });
  16.  
  17. // un componente que satisface la expectativa
  18.  
  19. const Login = ({isValid, isWaiting, error, onSignIn, onChange, username, password})=> {
  20.  
  21. return <div className="login">
  22. <Row>
  23. <Col s={12} m={6} l={4} className="offset-l4 offset-m3">
  24. <form className="login__form">
  25. <h4 className="login__title center-align">Bienvenido a Warehouse</h4>
  26. <div className="card-panel grey lighten-4">
  27. <Input
  28. className="login__user"
  29. label="usuario"
  30. name="username"
  31. placeholder="usuario en access"
  32. value={username}
  33. s={12}
  34. />
  35. <Input
  36. className="login__password"
  37. type="password"
  38. label="contraseña"
  39. name="password"
  40. placeholder="contraseña en access"
  41. value={password}
  42. s={12}
  43. />
  44. </div>
  45. </form>
  46. </Col>
  47. </Row>
  48. </div>
  49. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement