diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-06-14 11:28:22 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-06-14 12:17:12 +0200 |
| commit | f443ed528802133ea9392533c4db56667aa560d5 (patch) | |
| tree | 3f18c1bab1abcb10fabfa830ae0ce29da8f5eed5 /test | |
| parent | e72bab3f6bfa30c3e9efe1b0b76253fd0fadf621 (diff) | |
| download | mullvadvpn-f443ed528802133ea9392533c4db56667aa560d5.tar.xz mullvadvpn-f443ed528802133ea9392533c4db56667aa560d5.zip | |
Configure enzyme once and update sinon to the latest
Diffstat (limited to 'test')
| -rw-r--r-- | test/components/Account.spec.js | 2 | ||||
| -rw-r--r-- | test/components/AccountInput.spec.js | 2 | ||||
| -rw-r--r-- | test/components/HeaderBar.spec.js | 2 | ||||
| -rw-r--r-- | test/components/Login.spec.js | 2 | ||||
| -rw-r--r-- | test/components/Preferences.spec.js | 2 | ||||
| -rw-r--r-- | test/components/Settings.spec.js | 2 | ||||
| -rw-r--r-- | test/components/Support.spec.js | 2 | ||||
| -rw-r--r-- | test/setup/renderer.js (renamed from test/setup/enzyme.js) | 4 |
8 files changed, 4 insertions, 14 deletions
diff --git a/test/components/Account.spec.js b/test/components/Account.spec.js index c4b50a740c..2476cc35e0 100644 --- a/test/components/Account.spec.js +++ b/test/components/Account.spec.js @@ -3,9 +3,7 @@ import { expect } from 'chai'; import React from 'react'; import { shallow } from 'enzyme'; -require('../setup/enzyme'); import Account from '../../app/components/Account'; - import type { AccountProps } from '../../app/components/Account'; describe('components/Account', () => { diff --git a/test/components/AccountInput.spec.js b/test/components/AccountInput.spec.js index 25f2e366b7..eface9c8c6 100644 --- a/test/components/AccountInput.spec.js +++ b/test/components/AccountInput.spec.js @@ -3,9 +3,7 @@ import { expect } from 'chai'; import { createKeyEvent } from '../helpers/dom-events'; import * as React from 'react'; import { shallow } from 'enzyme'; -require('../setup/enzyme'); import AccountInput from '../../app/components/AccountInput'; - import type { AccountInputProps } from '../../app/components/AccountInput'; describe('components/AccountInput', () => { diff --git a/test/components/HeaderBar.spec.js b/test/components/HeaderBar.spec.js index 44731646d2..b5fb6bb7b6 100644 --- a/test/components/HeaderBar.spec.js +++ b/test/components/HeaderBar.spec.js @@ -5,8 +5,6 @@ import React from 'react'; import { shallow } from 'enzyme'; import HeaderBar from '../../app/components/HeaderBar'; -require('../setup/enzyme'); - describe('components/HeaderBar', () => { it('should display headerbar', () => { const component = render({ diff --git a/test/components/Login.spec.js b/test/components/Login.spec.js index 355e566d11..1c75904717 100644 --- a/test/components/Login.spec.js +++ b/test/components/Login.spec.js @@ -24,7 +24,7 @@ describe('components/Login', () => { accountInput.simulate('change', 'foo'); expect(onFirstChange.calledOnce).to.be.true; - onFirstChange.reset(); + onFirstChange.resetHistory(); accountInput.simulate('change', 'bar'); expect(onFirstChange.calledOnce).to.be.false; diff --git a/test/components/Preferences.spec.js b/test/components/Preferences.spec.js index 833a123538..3b6976a1ec 100644 --- a/test/components/Preferences.spec.js +++ b/test/components/Preferences.spec.js @@ -5,8 +5,6 @@ import React from 'react'; import { shallow } from 'enzyme'; import Preferences from '../../app/components/Preferences'; -require('../setup/enzyme'); - describe('components/Preferences', () => { it('Should call close handler', (done) => { const props = makeProps({ onClose: done }); diff --git a/test/components/Settings.spec.js b/test/components/Settings.spec.js index 447b0b50db..61ca47e3e4 100644 --- a/test/components/Settings.spec.js +++ b/test/components/Settings.spec.js @@ -3,9 +3,7 @@ import { expect } from 'chai'; import React from 'react'; import Settings from '../../app/components/Settings'; - import { shallow } from 'enzyme'; -require('../setup/enzyme'); import type { AccountReduxState } from '../../app/redux/account/reducers'; import type { SettingsReduxState } from '../../app/redux/settings/reducers'; diff --git a/test/components/Support.spec.js b/test/components/Support.spec.js index a968db974f..653c376713 100644 --- a/test/components/Support.spec.js +++ b/test/components/Support.spec.js @@ -4,9 +4,7 @@ import { expect } from 'chai'; import React from 'react'; import Support from '../../app/components/Support'; import { shallow } from 'enzyme'; -require('../setup/enzyme'); import sinon from 'sinon'; - import type { SupportProps } from '../../app/components/Support'; describe('components/Support', () => { diff --git a/test/setup/enzyme.js b/test/setup/renderer.js index 135148a7c4..f27568f58d 100644 --- a/test/setup/enzyme.js +++ b/test/setup/renderer.js @@ -1,4 +1,6 @@ const Enzyme = require('enzyme'); const Adapter = require('enzyme-adapter-react-16'); -Enzyme.configure({ adapter: new Adapter() }); +Enzyme.configure({ + adapter: new Adapter(), +}); |
