summaryrefslogtreecommitdiffhomepage
path: root/test/components/Preferences.spec.js
blob: cad039df321bdb0b4e795e84df37a099086c59bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// @flow

import { expect } from 'chai';
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 });
    const component = shallow(<Preferences { ...props } />);
    const button = component.find({ testName: 'closeButton' });
    expect(button).to.have.length(1);
    button.simulate('press');
  });

});

function makeProps(props) {
  return {
    onClose: () => {},
    onChangeAllowLan: () => {},
    allowLan: false,
    ...props
  };
}