mirror of
https://github.com/apache/superset.git
synced 2026-04-10 11:55:24 +00:00
* bumping the js libs * New linting rules * More linting * More * Done linting * npm >=4.5.0 * Bumping node * Tweaking the build * Fixing the damn build * Fixing the apps
33 lines
927 B
JavaScript
33 lines
927 B
JavaScript
/* eslint-disable no-unused-expressions */
|
|
import React from 'react';
|
|
import { FormControl } from 'react-bootstrap';
|
|
import sinon from 'sinon';
|
|
import { expect } from 'chai';
|
|
import { describe, it, beforeEach } from 'mocha';
|
|
import { shallow } from 'enzyme';
|
|
import TextAreaControl from '../../../../javascripts/explorev2/components/controls/TextAreaControl';
|
|
|
|
const defaultProps = {
|
|
name: 'x_axis_label',
|
|
label: 'X Axis Label',
|
|
onChange: sinon.spy(),
|
|
};
|
|
|
|
describe('SelectControl', () => {
|
|
let wrapper;
|
|
|
|
beforeEach(() => {
|
|
wrapper = shallow(<TextAreaControl {...defaultProps} />);
|
|
});
|
|
|
|
it('renders a FormControl', () => {
|
|
expect(wrapper.find(FormControl)).to.have.lengthOf(1);
|
|
});
|
|
|
|
it('calls onChange when toggled', () => {
|
|
const select = wrapper.find(FormControl);
|
|
select.simulate('change', { target: { value: 'x' } });
|
|
expect(defaultProps.onChange.calledWith('x')).to.be.true;
|
|
});
|
|
});
|