mirror of
https://github.com/apache/superset.git
synced 2026-04-09 11:25:23 +00:00
* WIP * Working version * Clean code * Fix lint * Fix unit test; show only for sqla * Working on UX * Dropdown working 66% * Working but needs CSS * Fixed table * Fix lint * Fix unit test * Fix languages path * Fixes * Fix Javascript lint
33 lines
979 B
JavaScript
33 lines
979 B
JavaScript
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 './../../../../src/components/ModalTrigger';
|
|
|
|
import DisplayQueryButton from '../../../../src/explore/components/DisplayQueryButton';
|
|
|
|
describe('DisplayQueryButton', () => {
|
|
const defaultProps = {
|
|
animation: false,
|
|
queryResponse: {
|
|
query: 'SELECT * FROM foo',
|
|
language: 'sql',
|
|
},
|
|
chartStatus: 'success',
|
|
queryEndpoint: 'localhost',
|
|
latestQueryFormData: {
|
|
datasource: '1__table',
|
|
},
|
|
};
|
|
|
|
it('is valid', () => {
|
|
expect(React.isValidElement(<DisplayQueryButton {...defaultProps} />)).to.equal(true);
|
|
});
|
|
it('renders a dropdown', () => {
|
|
const wrapper = mount(<DisplayQueryButton {...defaultProps} />);
|
|
expect(wrapper.find(ModalTrigger)).to.have.lengthOf(2);
|
|
expect(wrapper.find(Modal)).to.have.lengthOf(2);
|
|
});
|
|
});
|