Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Component Type and Props', function () {
- it('should be a stateless component', ()=>{
- expect(Login.prototype).toNotBeA(React.Component);
- });
- it('should have the correct props defined', ()=>{
- var propTypes = {
- username: PropTypes.string,
- password: PropTypes.string,
- isValid: PropTypes.bool,
- isWaiting: PropTypes.bool,
- error: PropTypes.object,
- onSignIn: PropTypes.func.isRequired,
- onChange: PropTypes.func.isRequired
- };
- expect(Login.propTypes).toEqual(propTypes);
- //necesitamos comparar estricto porque si no cualquier PropType == PropType
- Object.keys(propTypes).forEach(
- (key)=>expect(propTypes[key]).toBe(Login.propTypes[key])
- );
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement