summaryrefslogtreecommitdiffhomepage
path: root/test/components/Login.spec.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-06-01 16:13:10 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-06-05 12:11:55 +0200
commitca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087 (patch)
treeb1f7754eb50896ab3681e35fa4e08be642b940c9 /test/components/Login.spec.js
parent5852c980980de53e00d76a0bdb4b41bf5c0f5b39 (diff)
downloadmullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.tar.xz
mullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.zip
Add formatted source code
Diffstat (limited to 'test/components/Login.spec.js')
-rw-r--r--test/components/Login.spec.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/components/Login.spec.js b/test/components/Login.spec.js
index f8f4af54de..355e566d11 100644
--- a/test/components/Login.spec.js
+++ b/test/components/Login.spec.js
@@ -9,17 +9,16 @@ import Login from '../../app/components/Login';
import AccountInput from '../../app/components/AccountInput';
describe('components/Login', () => {
-
it('notifies on the first change after failure', () => {
let onFirstChange = sinon.spy();
const props = {
account: Object.assign({}, defaultAccount, {
- status: 'failed'
+ status: 'failed',
}),
onFirstChangeAfterFailure: onFirstChange,
};
- const component = renderWithProps( props );
+ const component = renderWithProps(props);
const accountInput = component.find(AccountInput);
accountInput.simulate('change', 'foo');
@@ -61,7 +60,7 @@ describe('components/Login', () => {
const component = renderNotLoggedIn();
component.setProps({
account: Object.assign({}, defaultAccount, {
- accountToken: '12345'
+ accountToken: '12345',
}),
onLogin: (an) => {
try {
@@ -82,7 +81,7 @@ const defaultAccount = {
accountHistory: [],
expiry: null,
status: 'none',
- error: null
+ error: null,
};
const defaultProps = {
@@ -122,11 +121,11 @@ function renderNotLoggedIn() {
function renderWithProps(customProps) {
const props = Object.assign({}, defaultProps, customProps);
- return shallow( <Login { ...props } /> );
+ return shallow(<Login {...props} />);
}
function getComponent(container, testName) {
- return container.findWhere( n => n.prop('testName') === testName);
+ return container.findWhere((n) => n.prop('testName') === testName);
}
function click(component) {