mirror of
https://github.com/apache/superset.git
synced 2026-04-09 03:16:07 +00:00
* [explore] add "View samples" modal to action buttons Also broke down the `View query` and `View results` as different request so that viewing the query does not require fetching the results anymore * fix js tests * lint
30 lines
847 B
JavaScript
30 lines
847 B
JavaScript
import React from 'react';
|
|
import { expect } from 'chai';
|
|
import { mount } from 'enzyme';
|
|
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(3);
|
|
});
|
|
});
|