summaryrefslogtreecommitdiffhomepage
path: root/test/components/Support.spec.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-06-14 14:28:22 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-06-20 15:36:17 +0200
commit69da56287e82a3dcf1b32dc35e30f312822c657d (patch)
tree31b7f6d805ef9fdc928765ccca146dfc113eb34c /test/components/Support.spec.js
parent3e7a83f27a10cf6630ba5ff885b64cc24b02e9e3 (diff)
downloadmullvadvpn-69da56287e82a3dcf1b32dc35e30f312822c657d.tar.xz
mullvadvpn-69da56287e82a3dcf1b32dc35e30f312822c657d.zip
Migrate from sinon to chai-spies
Diffstat (limited to 'test/components/Support.spec.js')
-rw-r--r--test/components/Support.spec.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/components/Support.spec.js b/test/components/Support.spec.js
index 653c376713..c06ac0b1d8 100644
--- a/test/components/Support.spec.js
+++ b/test/components/Support.spec.js
@@ -1,10 +1,9 @@
// @flow
-import { expect } from 'chai';
+import { expect, spy } from 'chai';
import 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 +62,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 +76,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 +85,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);