feat(dashboard): View query of the chart in dashboard (#14667)

* Extract view query component out

* Typo correction

* Fix and rename tests

* Remove logs, and test code

* Rename file - fix tests

* Fix a typo

* Linting errors, add Apache License Header
This commit is contained in:
Ajay M
2021-05-18 16:17:11 -04:00
committed by GitHub
parent a7a011cce5
commit 84e8dc71f6
9 changed files with 178 additions and 126 deletions

View File

@@ -20,9 +20,9 @@ import React from 'react';
import { mount, shallow } from 'enzyme';
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
import { Dropdown, Menu } from 'src/common/components';
import { DisplayQueryButton } from 'src/explore/components/DisplayQueryButton';
import ExploreAdditionalActionsMenu from 'src/explore/components/ExploreAdditionalActionsMenu';
describe('DisplayQueryButton', () => {
describe('ExploreAdditionalActionsMenu', () => {
const defaultProps = {
animation: false,
queryResponse: {
@@ -38,12 +38,12 @@ describe('DisplayQueryButton', () => {
};
it('is valid', () => {
expect(React.isValidElement(<DisplayQueryButton {...defaultProps} />)).toBe(
true,
);
expect(
React.isValidElement(<ExploreAdditionalActionsMenu {...defaultProps} />),
).toBe(true);
});
it('renders a dropdown with 3 itens', () => {
const wrapper = mount(<DisplayQueryButton {...defaultProps} />, {
it('renders a dropdown with 3 items', () => {
const wrapper = mount(<ExploreAdditionalActionsMenu {...defaultProps} />, {
wrappingComponent: ThemeProvider,
wrappingComponentProps: {
theme: supersetTheme,