-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathcomponent.property.test.js
More file actions
34 lines (30 loc) · 1.01 KB
/
component.property.test.js
File metadata and controls
34 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from 'react';
import TwitterLogin from 'TwitterLogin';
import { expect } from 'chai';
import { mount } from 'enzyme';
describe('Twitter Login Component', () => {
let component;
let propsObj;
describe('With default props', () => {
beforeEach(() => {
propsObj = {
onClick: () => {},
onSuccess: response => {},
onFailure: error => {},
loginUrl: 'http://localhost:3000/login-url',
requestTokenUrl: 'http://localhost:3000/request-token'
};
component = mount(<TwitterLogin {...propsObj} />);
});
it('shows the button', () => {
expect(component).to.exist;
});
it('displays correct button default values', () => {
expect(component.props().text).to.equal('Sign in with Twitter');
expect(component.props().tag).to.equal('button');
expect(component.props().disabled).to.equal(false);
expect(component.props().dialogWidth).to.equal(600);
expect(component.props().dialogHeight).to.equal(400);
});
});
});