Files
superset2/superset/assets/spec/javascripts/explorev2/components/TextArea_spec.js
Maxime Beauchemin 15b67b2c6c [WiP] rename project from Caravel to Superset (#1576)
* Change in files

* Renamin files and folders

* cleaning up a single piece of lint

* Removing boat picture from docs

* add superset word mark

* Update rename note in docs

* Fixing images

* Pinning datatables

* Fixing issues with mapbox-gl

* Forgot to rename one file

* Linting

* v0.13.0

* adding pyyaml to dev-reqs
2016-11-09 23:08:22 -08:00

33 lines
926 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 TextAreaField from '../../../../javascripts/explorev2/components/TextAreaField';
const defaultProps = {
name: 'x_axis_label',
label: 'X Axis Label',
onChange: sinon.spy(),
};
describe('SelectField', () => {
let wrapper;
beforeEach(() => {
wrapper = shallow(<TextAreaField {...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_axis_label', 'x')).to.be.true;
});
});