diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-06-20 16:20:04 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-06-20 16:20:04 +0200 |
| commit | 648c6e06ce07503be4eebbd46bd7b2e843a862fe (patch) | |
| tree | e8867916c95f8855dee60ad06f44e94244aa60f3 /test/components/Support.spec.js | |
| parent | 3e7a83f27a10cf6630ba5ff885b64cc24b02e9e3 (diff) | |
| parent | ffd34043d74cd59206c260b59d318c8e9bba9a39 (diff) | |
| download | mullvadvpn-648c6e06ce07503be4eebbd46bd7b2e843a862fe.tar.xz mullvadvpn-648c6e06ce07503be4eebbd46bd7b2e843a862fe.zip | |
Merge branch 'migrate-to-chai-spies'
Diffstat (limited to 'test/components/Support.spec.js')
| -rw-r--r-- | test/components/Support.spec.js | 12 |
1 files changed, 5 insertions, 7 deletions
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); |
