mirror of
https://github.com/apache/superset.git
synced 2026-04-09 03:16:07 +00:00
[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:
@@ -0,0 +1,30 @@
|
||||
import React from 'react';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it } from 'mocha';
|
||||
import { mount } from 'enzyme';
|
||||
import { Modal } from 'react-bootstrap';
|
||||
import ModalTrigger from './../../../../javascripts/components/ModalTrigger';
|
||||
|
||||
import DisplayQueryButton from '../../../../javascripts/explore/components/DisplayQueryButton';
|
||||
|
||||
describe('DisplayQueryButton', () => {
|
||||
const defaultProps = {
|
||||
animation: false,
|
||||
queryResponse: {
|
||||
query: 'SELECT * FROM foo',
|
||||
language: 'sql',
|
||||
},
|
||||
chartStatus: 'success',
|
||||
queryEndpoint: 'localhost',
|
||||
};
|
||||
|
||||
it('is valid', () => {
|
||||
expect(React.isValidElement(<DisplayQueryButton {...defaultProps} />)).to.equal(true);
|
||||
});
|
||||
it('renders a button and a modal', () => {
|
||||
const wrapper = mount(<DisplayQueryButton {...defaultProps} />);
|
||||
expect(wrapper.find(ModalTrigger)).to.have.lengthOf(1);
|
||||
wrapper.find('.modal-trigger').simulate('click');
|
||||
expect(wrapper.find(Modal)).to.have.lengthOf(1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user