summaryrefslogtreecommitdiffhomepage
path: root/test/components/Account.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/Account.spec.js
parent5852c980980de53e00d76a0bdb4b41bf5c0f5b39 (diff)
downloadmullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.tar.xz
mullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.zip
Add formatted source code
Diffstat (limited to 'test/components/Account.spec.js')
-rw-r--r--test/components/Account.spec.js23
1 files changed, 10 insertions, 13 deletions
diff --git a/test/components/Account.spec.js b/test/components/Account.spec.js
index ccdb1d2117..c9d0891022 100644
--- a/test/components/Account.spec.js
+++ b/test/components/Account.spec.js
@@ -13,9 +13,9 @@ describe('components/Account', () => {
const state: AccountReduxState = {
accountToken: '1234',
accountHistory: [],
- expiry: (new Date('2038-01-01')).toISOString(),
+ expiry: new Date('2038-01-01').toISOString(),
status: 'none',
- error: null
+ error: null,
};
const makeProps = (state: AccountReduxState, mergeProps: $Shape<AccountProps>): AccountProps => {
@@ -23,14 +23,14 @@ describe('components/Account', () => {
account: state,
onClose: () => {},
onLogout: () => {},
- onBuyMore: () => {}
+ onBuyMore: () => {},
};
return Object.assign({}, defaultProps, mergeProps);
};
it('should call close callback', (done) => {
const props = makeProps(state, {
- onClose: () => done()
+ onClose: () => done(),
});
const component = getComponent(render(props), 'account__close');
click(component);
@@ -38,7 +38,7 @@ describe('components/Account', () => {
it('should call logout callback', (done) => {
const props = makeProps(state, {
- onLogout: () => done()
+ onLogout: () => done(),
});
const component = getComponent(render(props), 'account__logout');
click(component);
@@ -46,7 +46,7 @@ describe('components/Account', () => {
it('should call "buy more" callback', (done) => {
const props = makeProps(state, {
- onBuyMore: () => done()
+ onBuyMore: () => done(),
});
const component = getComponent(render(props), 'account__buymore');
click(component);
@@ -56,9 +56,9 @@ describe('components/Account', () => {
const expiredState: AccountReduxState = {
accountToken: '1234',
accountHistory: [],
- expiry: (new Date('2001-01-01')).toISOString(),
+ expiry: new Date('2001-01-01').toISOString(),
status: 'none',
- error: null
+ error: null,
};
const props = makeProps(expiredState, {});
const component = getComponent(render(props), 'account__out_of_time');
@@ -70,17 +70,14 @@ describe('components/Account', () => {
const component = getComponent(render(props), 'account__out_of_time');
expect(component).to.have.length(0);
});
-
});
function render(props) {
- return shallow(
- <Account {...props} />
- );
+ return shallow(<Account {...props} />);
}
function getComponent(container, testName) {
- return container.findWhere( n => n.prop('testName') === testName);
+ return container.findWhere((n) => n.prop('testName') === testName);
}
function click(component) {