summaryrefslogtreecommitdiffhomepage
path: root/test/components/Support.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/Support.spec.js
parent5852c980980de53e00d76a0bdb4b41bf5c0f5b39 (diff)
downloadmullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.tar.xz
mullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.zip
Add formatted source code
Diffstat (limited to 'test/components/Support.spec.js')
-rw-r--r--test/components/Support.spec.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/test/components/Support.spec.js b/test/components/Support.spec.js
index a1a953fa2c..a968db974f 100644
--- a/test/components/Support.spec.js
+++ b/test/components/Support.spec.js
@@ -10,7 +10,6 @@ import sinon from 'sinon';
import type { SupportProps } from '../../app/components/Support';
describe('components/Support', () => {
-
const makeProps = (mergeProps: $Shape<SupportProps> = {}): SupportProps => {
const defaultProps: SupportProps = {
account: {
@@ -23,14 +22,14 @@ describe('components/Support', () => {
onClose: () => {},
onViewLog: (_path) => {},
onCollectLog: () => Promise.resolve('/tmp/mullvad_problem_report.log'),
- onSend: (_report) => {}
+ onSend: (_report) => {},
};
return Object.assign({}, defaultProps, mergeProps);
};
it('should call close callback', (done) => {
const props = makeProps({
- onClose: () => done()
+ onClose: () => done(),
});
const component = getComponent(render(props), 'support__close');
click(component);
@@ -38,7 +37,7 @@ describe('components/Support', () => {
it('should call view logs callback', (done) => {
const props = makeProps({
- onViewLog: (_path) => done()
+ onViewLog: (_path) => done(),
});
const component = getComponent(render(props), 'support__view_logs');
click(component);
@@ -46,7 +45,7 @@ describe('components/Support', () => {
it('should call send callback when description filled in', (done) => {
const props = makeProps({
- onSend: (_report) => done()
+ onSend: (_report) => done(),
});
const component = render(props);
@@ -68,7 +67,7 @@ describe('components/Support', () => {
it('should not collect report twice', (done) => {
const collectCallback = sinon.spy(() => Promise.resolve('non-falsy'));
const props = makeProps({
- onCollectLog: collectCallback
+ onCollectLog: collectCallback,
});
const viewLogButton = getComponent(render(props), 'support__view_logs');
@@ -99,7 +98,7 @@ describe('components/Support', () => {
} catch (e) {
done(e);
}
- }
+ },
});
const component = render(props);
@@ -108,17 +107,14 @@ describe('components/Support', () => {
const sendButton = getComponent(component, 'support__send_logs');
click(sendButton);
});
-
});
function render(props) {
- return shallow(
- <Support {...props} />
- );
+ return shallow(<Support {...props} />);
}
function getComponent(container, testName) {
- return container.findWhere( n => n.prop('testName') === testName);
+ return container.findWhere((n) => n.prop('testName') === testName);
}
function click(component) {