diff options
Diffstat (limited to 'test/components')
| -rw-r--r-- | test/components/Account.spec.js | 3 | ||||
| -rw-r--r-- | test/components/AccountInput.spec.js | 2 | ||||
| -rw-r--r-- | test/components/Connect.spec.js | 3 | ||||
| -rw-r--r-- | test/components/HeaderBar.spec.js | 1 | ||||
| -rw-r--r-- | test/components/Login.spec.js | 10 | ||||
| -rw-r--r-- | test/components/Preferences.spec.js | 3 | ||||
| -rw-r--r-- | test/components/SelectLocation.spec.js | 1 | ||||
| -rw-r--r-- | test/components/Settings.spec.js | 3 | ||||
| -rw-r--r-- | test/components/Support.spec.js | 12 | ||||
| -rw-r--r-- | test/components/Switch.spec.js | 1 |
10 files changed, 13 insertions, 26 deletions
diff --git a/test/components/Account.spec.js b/test/components/Account.spec.js index 2476cc35e0..2c0979bb50 100644 --- a/test/components/Account.spec.js +++ b/test/components/Account.spec.js @@ -1,7 +1,6 @@ // @flow -import { expect } from 'chai'; -import React from 'react'; +import * as React from 'react'; import { shallow } from 'enzyme'; import Account from '../../app/components/Account'; import type { AccountProps } from '../../app/components/Account'; diff --git a/test/components/AccountInput.spec.js b/test/components/AccountInput.spec.js index eface9c8c6..2f6ead1b45 100644 --- a/test/components/AccountInput.spec.js +++ b/test/components/AccountInput.spec.js @@ -1,5 +1,5 @@ // @flow -import { expect } from 'chai'; + import { createKeyEvent } from '../helpers/dom-events'; import * as React from 'react'; import { shallow } from 'enzyme'; diff --git a/test/components/Connect.spec.js b/test/components/Connect.spec.js index 64771248b6..d21a8eb510 100644 --- a/test/components/Connect.spec.js +++ b/test/components/Connect.spec.js @@ -1,7 +1,6 @@ // @flow -import { expect } from 'chai'; -import React from 'react'; +import * as React from 'react'; import { shallow } from 'enzyme'; import Connect from '../../app/components/Connect'; diff --git a/test/components/HeaderBar.spec.js b/test/components/HeaderBar.spec.js index b5fb6bb7b6..6fcbfb54d7 100644 --- a/test/components/HeaderBar.spec.js +++ b/test/components/HeaderBar.spec.js @@ -1,6 +1,5 @@ // @flow -import { expect } from 'chai'; import React from 'react'; import { shallow } from 'enzyme'; import HeaderBar from '../../app/components/HeaderBar'; diff --git a/test/components/Login.spec.js b/test/components/Login.spec.js index 1c75904717..90bb70f4b3 100644 --- a/test/components/Login.spec.js +++ b/test/components/Login.spec.js @@ -1,16 +1,14 @@ // @flow -import { expect } from 'chai'; import * as React from 'react'; import { shallow } from 'enzyme'; -import sinon from 'sinon'; 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(); + let onFirstChange = spy(); const props = { account: Object.assign({}, defaultAccount, { status: 'failed', @@ -22,12 +20,10 @@ describe('components/Login', () => { const accountInput = component.find(AccountInput); accountInput.simulate('change', 'foo'); - expect(onFirstChange.calledOnce).to.be.true; - - onFirstChange.resetHistory(); + expect(onFirstChange).to.have.been.called.once; accountInput.simulate('change', 'bar'); - expect(onFirstChange.calledOnce).to.be.false; + expect(onFirstChange).to.have.been.called.once; }); it('does not show the footer when logging in', () => { diff --git a/test/components/Preferences.spec.js b/test/components/Preferences.spec.js index 3b6976a1ec..280b24ccd7 100644 --- a/test/components/Preferences.spec.js +++ b/test/components/Preferences.spec.js @@ -1,7 +1,6 @@ // @flow -import { expect } from 'chai'; -import React from 'react'; +import * as React from 'react'; import { shallow } from 'enzyme'; import Preferences from '../../app/components/Preferences'; diff --git a/test/components/SelectLocation.spec.js b/test/components/SelectLocation.spec.js index 8310d52b97..c9a1f08864 100644 --- a/test/components/SelectLocation.spec.js +++ b/test/components/SelectLocation.spec.js @@ -1,6 +1,5 @@ // @flow -import { expect } from 'chai'; import * as React from 'react'; import { shallow } from 'enzyme'; import SelectLocation from '../../app/components/SelectLocation'; diff --git a/test/components/Settings.spec.js b/test/components/Settings.spec.js index 61ca47e3e4..f564902c2a 100644 --- a/test/components/Settings.spec.js +++ b/test/components/Settings.spec.js @@ -1,7 +1,6 @@ // @flow -import { expect } from 'chai'; -import React from 'react'; +import * as React from 'react'; import Settings from '../../app/components/Settings'; import { shallow } from 'enzyme'; diff --git a/test/components/Support.spec.js b/test/components/Support.spec.js index 653c376713..ce1efb2b75 100644 --- a/test/components/Support.spec.js +++ b/test/components/Support.spec.js @@ -1,10 +1,8 @@ // @flow -import { expect } from 'chai'; -import React from 'react'; +import * as React from 'react'; import Support from '../../app/components/Support'; import { shallow } from 'enzyme'; -import sinon from 'sinon'; import type { SupportProps } from '../../app/components/Support'; describe('components/Support', () => { @@ -63,7 +61,7 @@ describe('components/Support', () => { }); it('should not collect report twice', (done) => { - const collectCallback = sinon.spy(() => Promise.resolve('non-falsy')); + const collectCallback = spy(() => Promise.resolve('non-falsy')); const props = makeProps({ onCollectLog: collectCallback, }); @@ -77,7 +75,7 @@ describe('components/Support', () => { setTimeout(() => { try { - expect(collectCallback.callCount).to.equal(1); + expect(collectCallback).to.have.been.called.once; done(); } catch (e) { done(e); @@ -86,12 +84,12 @@ describe('components/Support', () => { }); it('should collect report on submission', (done) => { - const collectCallback = sinon.spy(() => Promise.resolve('')); + const collectCallback = spy(() => Promise.resolve('')); const props = makeProps({ onCollectLog: collectCallback, onSend: (_report) => { try { - expect(collectCallback.calledOnce).to.be.true; + expect(collectCallback).to.have.been.called.once; done(); } catch (e) { done(e); diff --git a/test/components/Switch.spec.js b/test/components/Switch.spec.js index e1242d74df..44794d9bba 100644 --- a/test/components/Switch.spec.js +++ b/test/components/Switch.spec.js @@ -1,6 +1,5 @@ // @flow -import { expect } from 'chai'; import * as React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils, { Simulate } from 'react-dom/test-utils'; |
