[js-testing] more tests for SelectControl (#2877)

* rename spec folder

* remove special handling for viz_type control since it now uses VizTypeControl

* add test for getOptions

* linting

* add test for cwp

* linting
This commit is contained in:
Alanna Scott
2017-05-31 10:52:02 -07:00
committed by GitHub
parent 1e7773eb16
commit 90e4d6469d
21 changed files with 80 additions and 52 deletions

View File

@@ -0,0 +1,18 @@
import React from 'react';
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { shallow } from 'enzyme';
import ControlSetRow from '../../../../javascripts/explore/components/ControlRow';
describe('ControlSetRow', () => {
it('renders a single row with one element', () => {
const wrapper = shallow(<ControlSetRow controls={[<a />]} />);
expect(wrapper.find('.row')).to.have.lengthOf(1);
expect(wrapper.find('.row').find('a')).to.have.lengthOf(1);
});
it('renders a single row with two elements', () => {
const wrapper = shallow(<ControlSetRow controls={[<a />, <a />]} />);
expect(wrapper.find('.row')).to.have.lengthOf(1);
expect(wrapper.find('.row').find('a')).to.have.lengthOf(2);
});
});