Files
superset2/superset/assets/spec/javascripts/explore/components/RunQueryActionButton_spec.jsx
Alanna Scott 90e4d6469d [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
2017-05-31 10:52:02 -07:00

35 lines
931 B
JavaScript

import React from 'react';
import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme';
import RunQueryActionButton
from '../../../../javascripts/SqlLab/components/RunQueryActionButton';
import Button from '../../../../javascripts/components/Button';
describe('RunQueryActionButton', () => {
let wrapper;
const defaultProps = {
allowAsync: false,
dbId: 1,
queryState: 'pending',
runQuery: () => {}, // eslint-disable-line
selectedText: null,
stopQuery: () => {}, // eslint-disable-line
};
beforeEach(() => {
wrapper = shallow(<RunQueryActionButton {...defaultProps} />);
});
it('is a valid react element', () => {
expect(
React.isValidElement(<RunQueryActionButton {...defaultProps} />),
).to.equal(true);
});
it('renders a single Button', () => {
expect(wrapper.find(Button)).to.have.lengthOf(1);
});
});