mirror of https://github.com/apache/superset.git
test(frontend): use absolute path for src imports (#9761)
* test(frontend): use absolute path for src imports * Upgrade prettier, fix eslint
This commit is contained in:
parent
6237cea952
commit
13c5b133a9
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
"trailingComma": "all",
|
||||
"arrowParens": "avoid"
|
||||
}
|
||||
|
|
|
@ -24,9 +24,7 @@ export default () =>
|
|||
cy.server();
|
||||
cy.login();
|
||||
cy.visit(WORLD_HEALTH_DASHBOARD);
|
||||
cy.get('.dashboard-header')
|
||||
.contains('Edit dashboard')
|
||||
.click();
|
||||
cy.get('.dashboard-header').contains('Edit dashboard').click();
|
||||
});
|
||||
|
||||
it('remove, and add chart flow', () => {
|
||||
|
@ -36,17 +34,13 @@ export default () =>
|
|||
cy.get('.fa.fa-trash')
|
||||
.last()
|
||||
.then($el => {
|
||||
cy.wrap($el)
|
||||
.invoke('show')
|
||||
.click();
|
||||
cy.wrap($el).invoke('show').click();
|
||||
// box plot should be gone
|
||||
cy.get('.grid-container .box_plot').should('not.exist');
|
||||
});
|
||||
|
||||
// open charts list
|
||||
cy.get('.component-layer')
|
||||
.contains('Your charts & filters')
|
||||
.click();
|
||||
cy.get('.component-layer').contains('Your charts & filters').click();
|
||||
|
||||
// find box plot is available from list
|
||||
cy.get('.slices-layer')
|
||||
|
@ -74,9 +68,7 @@ export default () =>
|
|||
cy.get('.dashboard-header .button-container').contains('Save changes');
|
||||
|
||||
// undo 2 steps
|
||||
cy.get('.dashboard-header .undo-action')
|
||||
.click()
|
||||
.click();
|
||||
cy.get('.dashboard-header .undo-action').click().click();
|
||||
|
||||
// no changes, can switch to view mode
|
||||
cy.get('.dashboard-header .button-container')
|
||||
|
|
|
@ -39,9 +39,7 @@ export default () =>
|
|||
|
||||
it('should allow favor/unfavor', () => {
|
||||
if (!isFavoriteDashboard) {
|
||||
cy.get('.favstar')
|
||||
.find('i')
|
||||
.should('have.class', 'fa-star-o');
|
||||
cy.get('.favstar').find('i').should('have.class', 'fa-star-o');
|
||||
cy.get('.favstar').trigger('click');
|
||||
cy.get('.favstar')
|
||||
.find('i')
|
||||
|
|
|
@ -66,9 +66,7 @@ export default () =>
|
|||
cy.get('.dashboard-header')
|
||||
.contains('Edit dashboard')
|
||||
.trigger('click', { force: true });
|
||||
cy.get('.fa.fa-trash')
|
||||
.last()
|
||||
.trigger('click', { force: true });
|
||||
cy.get('.fa.fa-trash').last().trigger('click', { force: true });
|
||||
cy.get('.grid-container .box_plot').should('not.exist');
|
||||
|
||||
cy.route('POST', '/superset/save_dash/**/').as('saveRequest');
|
||||
|
|
|
@ -146,9 +146,7 @@ export default () =>
|
|||
});
|
||||
|
||||
// click row level tab, send 1 more query
|
||||
cy.get('.tab-content ul.nav.nav-tabs li')
|
||||
.last()
|
||||
.click();
|
||||
cy.get('.tab-content ul.nav.nav-tabs li').last().click();
|
||||
cy.wait('@linechartRequest').then(xhr => {
|
||||
const requestFormData = xhr.request.body;
|
||||
const requestParams = JSON.parse(requestFormData.get('form_data'));
|
||||
|
@ -184,9 +182,7 @@ export default () =>
|
|||
.find('ul.nav.nav-tabs li')
|
||||
.first()
|
||||
.click();
|
||||
cy.get('.tab-content ul.nav.nav-tabs li')
|
||||
.first()
|
||||
.click();
|
||||
cy.get('.tab-content ul.nav.nav-tabs li').first().click();
|
||||
cy.get('span.Select-clear').click();
|
||||
|
||||
// trigger 1 new query
|
||||
|
|
|
@ -59,9 +59,7 @@ describe('AdhocMetrics', () => {
|
|||
cy.get('.select-clear').click();
|
||||
cy.get('.Select-control').click({ force: true });
|
||||
cy.get('input').type('sum_girls', { force: true });
|
||||
cy.get('.VirtualizedSelectFocusedOption')
|
||||
.trigger('mousedown')
|
||||
.click();
|
||||
cy.get('.VirtualizedSelectFocusedOption').trigger('mousedown').click();
|
||||
});
|
||||
|
||||
cy.get('#metrics-edit-popover').within(() => {
|
||||
|
@ -69,9 +67,7 @@ describe('AdhocMetrics', () => {
|
|||
cy.get('span').click();
|
||||
cy.get('input').type(metricName);
|
||||
});
|
||||
cy.get('button')
|
||||
.contains('Save')
|
||||
.click();
|
||||
cy.get('button').contains('Save').click();
|
||||
});
|
||||
|
||||
cy.get('button.query').click();
|
||||
|
@ -101,9 +97,7 @@ describe('AdhocMetrics', () => {
|
|||
cy.get('#adhoc-metric-edit-tabs-tab-SQL').click();
|
||||
cy.get('.ace_content').click();
|
||||
cy.get('.ace_text-input').type('/COUNT(DISTINCT name)', { force: true });
|
||||
cy.get('button')
|
||||
.contains('Save')
|
||||
.click();
|
||||
cy.get('button').contains('Save').click();
|
||||
});
|
||||
|
||||
cy.get('button.query').click();
|
||||
|
@ -122,9 +116,7 @@ describe('AdhocMetrics', () => {
|
|||
cy.get('.select-clear').click();
|
||||
cy.get('.Select-control').click({ force: true });
|
||||
cy.get('input').type('sum_girls', { force: true });
|
||||
cy.get('.VirtualizedSelectFocusedOption')
|
||||
.trigger('mousedown')
|
||||
.click();
|
||||
cy.get('.VirtualizedSelectFocusedOption').trigger('mousedown').click();
|
||||
});
|
||||
|
||||
cy.get('#metrics-edit-popover').within(() => {
|
||||
|
@ -136,9 +128,7 @@ describe('AdhocMetrics', () => {
|
|||
});
|
||||
cy.get('#adhoc-metric-edit-tabs-tab-SIMPLE').click();
|
||||
cy.get('.select-value-label').contains('num');
|
||||
cy.get('button')
|
||||
.contains('Save')
|
||||
.click();
|
||||
cy.get('button').contains('Save').click();
|
||||
});
|
||||
|
||||
cy.get('button.query').click();
|
||||
|
@ -164,22 +154,16 @@ describe('AdhocFilters', () => {
|
|||
cy.get('[data-test=adhoc_filters]').within(() => {
|
||||
cy.get('.Select-control').click({ force: true });
|
||||
cy.get('input').type('name', { force: true });
|
||||
cy.get('.VirtualizedSelectFocusedOption')
|
||||
.trigger('mousedown')
|
||||
.click();
|
||||
cy.get('.VirtualizedSelectFocusedOption').trigger('mousedown').click();
|
||||
});
|
||||
cy.get('.adhoc-filter-option').click({ force: true });
|
||||
cy.get('#filter-edit-popover').within(() => {
|
||||
cy.get('[data-test=adhoc-filter-simple-value]').within(() => {
|
||||
cy.get('div.select-input').click({ force: true });
|
||||
cy.get('input.select-input').type('Amy', { force: true });
|
||||
cy.get('.VirtualizedSelectFocusedOption')
|
||||
.trigger('mousedown')
|
||||
.click();
|
||||
cy.get('.VirtualizedSelectFocusedOption').trigger('mousedown').click();
|
||||
});
|
||||
cy.get('button')
|
||||
.contains('Save')
|
||||
.click();
|
||||
cy.get('button').contains('Save').click();
|
||||
});
|
||||
|
||||
cy.get('button.query').click();
|
||||
|
@ -196,9 +180,7 @@ describe('AdhocFilters', () => {
|
|||
cy.get('[data-test=adhoc_filters]').within(() => {
|
||||
cy.get('.Select-control').click({ force: true });
|
||||
cy.get('input').type('name', { force: true });
|
||||
cy.get('.VirtualizedSelectFocusedOption')
|
||||
.trigger('mousedown')
|
||||
.click();
|
||||
cy.get('.VirtualizedSelectFocusedOption').trigger('mousedown').click();
|
||||
});
|
||||
|
||||
cy.get('.adhoc-filter-option').click({ force: true });
|
||||
|
@ -206,9 +188,7 @@ describe('AdhocFilters', () => {
|
|||
cy.get('#adhoc-filter-edit-tabs-tab-SQL').click();
|
||||
cy.get('.ace_content').click();
|
||||
cy.get('.ace_text-input').type("'Amy' OR name = 'Bob'", { force: true });
|
||||
cy.get('button')
|
||||
.contains('Save')
|
||||
.click();
|
||||
cy.get('button').contains('Save').click();
|
||||
});
|
||||
|
||||
cy.get('button.query').click();
|
||||
|
@ -241,9 +221,7 @@ describe('Advanced analytics', () => {
|
|||
cy.get('[data-test=time_compare]').within(() => {
|
||||
cy.get('.Select-control').click({ force: true });
|
||||
cy.get('input').type('364 days', { force: true });
|
||||
cy.get('.VirtualizedSelectOption')
|
||||
.trigger('mousedown')
|
||||
.click();
|
||||
cy.get('.VirtualizedSelectOption').trigger('mousedown').click();
|
||||
});
|
||||
|
||||
cy.get('button.query').click();
|
||||
|
@ -289,9 +267,7 @@ describe('Annotations', () => {
|
|||
.within(() => {
|
||||
cy.get('input').type('y=1400000');
|
||||
});
|
||||
cy.get('button')
|
||||
.contains('OK')
|
||||
.click();
|
||||
cy.get('button').contains('OK').click();
|
||||
});
|
||||
|
||||
cy.get('button.query').click();
|
||||
|
|
|
@ -35,17 +35,12 @@ describe('Test explore links', () => {
|
|||
cy.verifySliceSuccess({ waitAlias: '@postJson' });
|
||||
|
||||
cy.get('button#query').click();
|
||||
cy.get('span')
|
||||
.contains('View query')
|
||||
.parent()
|
||||
.click();
|
||||
cy.get('span').contains('View query').parent().click();
|
||||
cy.wait('@postJson').then(() => {
|
||||
cy.get('code');
|
||||
});
|
||||
cy.get('.modal-header').within(() => {
|
||||
cy.get('button.close')
|
||||
.first()
|
||||
.click({ force: true });
|
||||
cy.get('button.close').first().click({ force: true });
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -40,9 +40,7 @@ export default () => {
|
|||
`{selectall}{backspace}SELECT ds, gender, name, num FROM main.birth_names LIMIT ${rowLimit}`,
|
||||
{ force: true },
|
||||
);
|
||||
cy.get('#js-sql-toolbar button')
|
||||
.eq(0)
|
||||
.click();
|
||||
cy.get('#js-sql-toolbar button').eq(0).click();
|
||||
|
||||
cy.wait('@sqlLabQuery');
|
||||
|
||||
|
|
|
@ -29,9 +29,7 @@ export default () => {
|
|||
const initialTabCount = tabList.length;
|
||||
|
||||
// add tab
|
||||
cy.get('#a11y-query-editor-tabs > ul > li')
|
||||
.last()
|
||||
.click();
|
||||
cy.get('#a11y-query-editor-tabs > ul > li').last().click();
|
||||
|
||||
cy.get('#a11y-query-editor-tabs > ul > li').should(
|
||||
'have.length',
|
||||
|
@ -50,9 +48,7 @@ export default () => {
|
|||
).click();
|
||||
|
||||
// first item is close
|
||||
cy.get('#a11y-query-editor-tabs > ul > li:first ul li a')
|
||||
.eq(0)
|
||||
.click();
|
||||
cy.get('#a11y-query-editor-tabs > ul > li:first ul li a').eq(0).click();
|
||||
|
||||
cy.get('#a11y-query-editor-tabs > ul > li').should(
|
||||
'have.length',
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,10 +9,10 @@
|
|||
"author": "Apcahe",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"shortid": "^2.2.15"
|
||||
"shortid": "^2.2.15",
|
||||
"@cypress/code-coverage": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cypress/code-coverage": "^3.1.0",
|
||||
"cypress": "4.3.0",
|
||||
"eslint-plugin-cypress": "^2.10.3"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"src/*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13606,9 +13606,9 @@
|
|||
}
|
||||
},
|
||||
"eslint-config-prettier": {
|
||||
"version": "6.10.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz",
|
||||
"integrity": "sha512-AtndijGte1rPILInUdHjvKEGbIV06NuvPrqlIEaEaWtbtvJh464mDeyGMdZEQMsGvC0ZVkiex1fSNcC4HAbRGg==",
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz",
|
||||
"integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"get-stdin": "^6.0.0"
|
||||
|
@ -13805,9 +13805,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"eslint-plugin-prettier": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz",
|
||||
"integrity": "sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.3.tgz",
|
||||
"integrity": "sha512-+HG5jmu/dN3ZV3T6eCD7a4BlAySdN7mLIbJYo0z1cFQuI+r2DiTJEFeF68ots93PsnrMxbzIZ2S/ieX+mkrBeQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"prettier-linter-helpers": "^1.0.0"
|
||||
|
@ -23997,9 +23997,9 @@
|
|||
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
|
||||
},
|
||||
"prettier": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
||||
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
|
||||
"integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
|
||||
"dev": true
|
||||
},
|
||||
"prettier-linter-helpers": {
|
||||
|
|
|
@ -213,14 +213,14 @@
|
|||
"enzyme-adapter-react-16": "^1.14.0",
|
||||
"eslint": "^6.2.2",
|
||||
"eslint-config-airbnb": "^15.0.1",
|
||||
"eslint-config-prettier": "^6.10.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-import-resolver-webpack": "^0.10.1",
|
||||
"eslint-plugin-cypress": "^2.0.1",
|
||||
"eslint-plugin-import": "^2.2.0",
|
||||
"eslint-plugin-jest": "^21.24.1",
|
||||
"eslint-plugin-jsx-a11y": "^5.1.1",
|
||||
"eslint-plugin-no-only-tests": "^2.0.1",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"eslint-plugin-prettier": "^3.1.3",
|
||||
"eslint-plugin-react": "^7.16.0",
|
||||
"exports-loader": "^0.7.0",
|
||||
"fetch-mock": "^7.0.0-alpha.6",
|
||||
|
@ -235,7 +235,7 @@
|
|||
"mini-css-extract-plugin": "^0.4.0",
|
||||
"optimize-css-assets-webpack-plugin": "^5.0.1",
|
||||
"po2json": "^0.4.5",
|
||||
"prettier": "^1.19.1",
|
||||
"prettier": "^2.0.5",
|
||||
"react-test-renderer": "^16.9.0",
|
||||
"redux-mock-store": "^1.2.3",
|
||||
"sinon": "^4.5.0",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import CollectionTable from '../../../src/CRUD/CollectionTable';
|
||||
import CollectionTable from 'src/CRUD/CollectionTable';
|
||||
import mockDatasource from '../../fixtures/mockDatasource';
|
||||
|
||||
const props = {
|
||||
|
|
|
@ -21,8 +21,8 @@ import { shallow } from 'enzyme';
|
|||
import { Button } from 'react-bootstrap';
|
||||
import Select from 'react-virtualized-select';
|
||||
|
||||
import AddSliceContainer from '../../../src/addSlice/AddSliceContainer';
|
||||
import VizTypeControl from '../../../src/explore/components/controls/VizTypeControl';
|
||||
import AddSliceContainer from 'src/addSlice/AddSliceContainer';
|
||||
import VizTypeControl from 'src/explore/components/controls/VizTypeControl';
|
||||
|
||||
const defaultProps = {
|
||||
datasources: [
|
||||
|
@ -53,10 +53,7 @@ describe('AddSliceContainer', () => {
|
|||
|
||||
it('renders a disabled button if no datasource is selected', () => {
|
||||
expect(
|
||||
wrapper
|
||||
.find(Button)
|
||||
.dive()
|
||||
.find('.btn[disabled=true]'),
|
||||
wrapper.find(Button).dive().find('.btn[disabled=true]'),
|
||||
).toHaveLength(1);
|
||||
});
|
||||
|
||||
|
@ -68,10 +65,7 @@ describe('AddSliceContainer', () => {
|
|||
datasourceType: datasourceValue.split('__')[1],
|
||||
});
|
||||
expect(
|
||||
wrapper
|
||||
.find(Button)
|
||||
.dive()
|
||||
.find('.btn[disabled=false]'),
|
||||
wrapper.find(Button).dive().find('.btn[disabled=false]'),
|
||||
).toHaveLength(1);
|
||||
});
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
||||
import { SuperChart } from '@superset-ui/chart';
|
||||
|
||||
import ChartRenderer from '../../../src/chart/ChartRenderer';
|
||||
import ChartRenderer from 'src/chart/ChartRenderer';
|
||||
|
||||
describe('ChartRenderer', () => {
|
||||
it('should render SuperChart', () => {
|
||||
|
|
|
@ -20,9 +20,9 @@ import fetchMock from 'fetch-mock';
|
|||
import sinon from 'sinon';
|
||||
|
||||
import * as chartlib from '@superset-ui/chart';
|
||||
import { LOG_EVENT } from '../../../src/logger/actions';
|
||||
import * as exploreUtils from '../../../src/explore/exploreUtils';
|
||||
import * as actions from '../../../src/chart/chartAction';
|
||||
import { LOG_EVENT } from 'src/logger/actions';
|
||||
import * as exploreUtils from 'src/explore/exploreUtils';
|
||||
import * as actions from 'src/chart/chartAction';
|
||||
|
||||
describe('chart actions', () => {
|
||||
const V1_URL = '/http//localhost/api/v1/chart/data';
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import chartReducer, { chart } from '../../../src/chart/chartReducer';
|
||||
import * as actions from '../../../src/chart/chartAction';
|
||||
import chartReducer, { chart } from 'src/chart/chartReducer';
|
||||
import * as actions from 'src/chart/chartAction';
|
||||
|
||||
describe('chart reducers', () => {
|
||||
const chartKey = 1;
|
||||
|
|
|
@ -21,9 +21,9 @@ import { shallow } from 'enzyme';
|
|||
import { Table, Thead, Td, Th, Tr } from 'reactable-arc';
|
||||
import { getChartControlPanelRegistry } from '@superset-ui/chart';
|
||||
|
||||
import AlteredSliceTag from '../../../src/components/AlteredSliceTag';
|
||||
import ModalTrigger from '../../../src/components/ModalTrigger';
|
||||
import TooltipWrapper from '../../../src/components/TooltipWrapper';
|
||||
import AlteredSliceTag from 'src/components/AlteredSliceTag';
|
||||
import ModalTrigger from 'src/components/ModalTrigger';
|
||||
import TooltipWrapper from 'src/components/TooltipWrapper';
|
||||
|
||||
const defaultProps = {
|
||||
origFormData: {
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import AnchorLink from '../../../src/components/AnchorLink';
|
||||
import URLShortLinkButton from '../../../src/components/URLShortLinkButton';
|
||||
import AnchorLink from 'src/components/AnchorLink';
|
||||
import URLShortLinkButton from 'src/components/URLShortLinkButton';
|
||||
|
||||
describe('AnchorLink', () => {
|
||||
const props = {
|
||||
|
|
|
@ -21,7 +21,7 @@ import Select from 'react-select';
|
|||
import { shallow } from 'enzyme';
|
||||
import fetchMock from 'fetch-mock';
|
||||
|
||||
import AsyncSelect from '../../../src/components/AsyncSelect';
|
||||
import AsyncSelect from 'src/components/AsyncSelect';
|
||||
|
||||
describe('AsyncSelect', () => {
|
||||
afterAll(fetchMock.reset);
|
||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
||||
import { Label } from 'react-bootstrap';
|
||||
|
||||
import CachedLabel from '../../../src/components/CachedLabel';
|
||||
import CachedLabel from 'src/components/CachedLabel';
|
||||
|
||||
describe('CachedLabel', () => {
|
||||
const defaultProps = {
|
||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
|||
import sinon from 'sinon';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import Checkbox from '../../../src/components/Checkbox';
|
||||
import Checkbox from 'src/components/Checkbox';
|
||||
|
||||
describe('Checkbox', () => {
|
||||
const defaultProps = {
|
||||
|
@ -49,10 +49,7 @@ describe('Checkbox', () => {
|
|||
});
|
||||
it('unchecks when clicked', () => {
|
||||
expect(wrapper.find('i.fa-check.text-transparent')).toHaveLength(0);
|
||||
wrapper
|
||||
.find('i')
|
||||
.first()
|
||||
.simulate('click');
|
||||
wrapper.find('i').first().simulate('click');
|
||||
expect(defaultProps.onChange.calledOnce).toBe(true);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import ColumnOption from '../../../src/components/ColumnOption';
|
||||
import ColumnTypeLabel from '../../../src/components/ColumnTypeLabel';
|
||||
import InfoTooltipWithTrigger from '../../../src/components/InfoTooltipWithTrigger';
|
||||
import ColumnOption from 'src/components/ColumnOption';
|
||||
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
|
||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
||||
|
||||
describe('ColumnOption', () => {
|
||||
const defaultProps = {
|
||||
|
@ -60,12 +60,7 @@ describe('ColumnOption', () => {
|
|||
it('shows a label with column_name when no verbose_name', () => {
|
||||
props.column.verbose_name = null;
|
||||
wrapper = shallow(factory(props));
|
||||
expect(
|
||||
wrapper
|
||||
.find('.option-label')
|
||||
.first()
|
||||
.text(),
|
||||
).toBe('foo');
|
||||
expect(wrapper.find('.option-label').first().text()).toBe('foo');
|
||||
});
|
||||
it('shows a column type label when showType is true', () => {
|
||||
wrapper = shallow(
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import ColumnTypeLabel from '../../../src/components/ColumnTypeLabel';
|
||||
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
|
||||
|
||||
describe('ColumnOption', () => {
|
||||
const defaultProps = {
|
||||
|
|
|
@ -38,10 +38,7 @@ describe('ConfirmStatusChange', () => {
|
|||
);
|
||||
|
||||
it('opens a confirm modal', () => {
|
||||
wrapper
|
||||
.find('#btn1')
|
||||
.props()
|
||||
.onClick('foo');
|
||||
wrapper.find('#btn1').props().onClick('foo');
|
||||
|
||||
wrapper.update();
|
||||
|
||||
|
@ -49,11 +46,7 @@ describe('ConfirmStatusChange', () => {
|
|||
});
|
||||
|
||||
it('calls the function on confirm', () => {
|
||||
wrapper
|
||||
.find(Button)
|
||||
.last()
|
||||
.props()
|
||||
.onClick();
|
||||
wrapper.find(Button).last().props().onClick();
|
||||
|
||||
expect(mockedProps.onConfirm).toHaveBeenCalledWith('foo');
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
|
||||
import CopyToClipboard from '../../../src/components/CopyToClipboard';
|
||||
import CopyToClipboard from 'src/components/CopyToClipboard';
|
||||
|
||||
describe('CopyToClipboard', () => {
|
||||
const defaultProps = {
|
||||
|
|
|
@ -20,10 +20,12 @@ import React from 'react';
|
|||
import getErrorMessageComponentRegistry from 'src/components/ErrorMessage/getErrorMessageComponentRegistry';
|
||||
import { ErrorMessageComponentProps } from 'src/components/ErrorMessage/types';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const ERROR_MESSAGE_COMPONENT = (_: ErrorMessageComponentProps) => (
|
||||
<div>Test error</div>
|
||||
);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const OVERRIDE_ERROR_MESSAGE_COMPONENT = (_: ErrorMessageComponentProps) => (
|
||||
<div>Custom error</div>
|
||||
);
|
||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
|||
import { mount } from 'enzyme';
|
||||
import FilterableTable, {
|
||||
MAX_COLUMNS_FOR_TABLE,
|
||||
} from '../../../../src/components/FilterableTable/FilterableTable';
|
||||
} from 'src/components/FilterableTable/FilterableTable';
|
||||
|
||||
describe('FilterableTable', () => {
|
||||
const mockedProps = {
|
||||
|
|
|
@ -20,9 +20,9 @@ import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
||||
|
||||
import { Col, Row } from 'react-bootstrap';
|
||||
import TextControl from '../../../src/explore/components/controls/TextControl';
|
||||
import InfoTooltipWithTrigger from '../../../src/components/InfoTooltipWithTrigger';
|
||||
import FormRow from '../../../src/components/FormRow';
|
||||
import TextControl from 'src/explore/components/controls/TextControl';
|
||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
||||
import FormRow from 'src/components/FormRow';
|
||||
|
||||
const defaultProps = {
|
||||
label: 'Hello',
|
||||
|
|
|
@ -111,10 +111,7 @@ describe('ListView', () => {
|
|||
});
|
||||
|
||||
it('calls fetchData on sort', () => {
|
||||
wrapper
|
||||
.find('[data-test="sort-header"]')
|
||||
.at(1)
|
||||
.simulate('click');
|
||||
wrapper.find('[data-test="sort-header"]').at(1).simulate('click');
|
||||
|
||||
expect(mockedProps.fetchData).toHaveBeenCalled();
|
||||
expect(mockedProps.fetchData.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
|
@ -160,10 +157,7 @@ describe('ListView', () => {
|
|||
wrapper.update();
|
||||
|
||||
act(() => {
|
||||
wrapper
|
||||
.find('[data-test="apply-filters"]')
|
||||
.last()
|
||||
.prop('onClick')();
|
||||
wrapper.find('[data-test="apply-filters"]').last().prop('onClick')();
|
||||
});
|
||||
wrapper.update();
|
||||
|
||||
|
@ -241,10 +235,7 @@ Array [
|
|||
.onClick();
|
||||
});
|
||||
wrapper.update();
|
||||
const bulkActionsProps = wrapper
|
||||
.find(MenuItem)
|
||||
.last()
|
||||
.props();
|
||||
const bulkActionsProps = wrapper.find(MenuItem).last().props();
|
||||
|
||||
bulkActionsProps.onSelect(bulkActionsProps.eventKey);
|
||||
expect(mockedProps.bulkActions[0].onSelect.mock.calls[0])
|
||||
|
@ -275,10 +266,7 @@ Array [
|
|||
.onClick();
|
||||
});
|
||||
wrapper.update();
|
||||
const bulkActionsProps = wrapper
|
||||
.find(MenuItem)
|
||||
.last()
|
||||
.props();
|
||||
const bulkActionsProps = wrapper.find(MenuItem).last().props();
|
||||
|
||||
bulkActionsProps.onSelect(bulkActionsProps.eventKey);
|
||||
expect(mockedProps.bulkActions[0].onSelect.mock.calls[0])
|
||||
|
@ -383,11 +371,7 @@ describe('ListView with new UI filters', () => {
|
|||
wrapper.update();
|
||||
|
||||
act(() => {
|
||||
wrapper
|
||||
.find('[data-test="search-input"]')
|
||||
.last()
|
||||
.props()
|
||||
.onBlur();
|
||||
wrapper.find('[data-test="search-input"]').last().props().onBlur();
|
||||
});
|
||||
|
||||
expect(newFiltersProps.fetchData.mock.calls[0]).toMatchInlineSnapshot(`
|
||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
|||
import { shallow, mount } from 'enzyme';
|
||||
import { Nav } from 'react-bootstrap';
|
||||
|
||||
import Menu from '../../../src/components/Menu/Menu';
|
||||
import Menu from 'src/components/Menu/Menu';
|
||||
|
||||
const defaultProps = {
|
||||
data: {
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import MetricOption from '../../../src/components/MetricOption';
|
||||
import ColumnTypeLabel from '../../../src/components/ColumnTypeLabel';
|
||||
import InfoTooltipWithTrigger from '../../../src/components/InfoTooltipWithTrigger';
|
||||
import MetricOption from 'src/components/MetricOption';
|
||||
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
|
||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
||||
|
||||
describe('MetricOption', () => {
|
||||
const defaultProps = {
|
||||
|
@ -61,12 +61,7 @@ describe('MetricOption', () => {
|
|||
it('shows a label with metric_name when no verbose_name', () => {
|
||||
props.metric.verbose_name = null;
|
||||
wrapper = shallow(factory(props));
|
||||
expect(
|
||||
wrapper
|
||||
.find('.option-label')
|
||||
.first()
|
||||
.text(),
|
||||
).toBe('foo');
|
||||
expect(wrapper.find('.option-label').first().text()).toBe('foo');
|
||||
});
|
||||
it('shows only 1 InfoTooltipWithTrigger when no descr and no warning', () => {
|
||||
props.metric.warning_text = null;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
|
||||
import ModalTrigger from '../../../src/components/ModalTrigger';
|
||||
import ModalTrigger from 'src/components/ModalTrigger';
|
||||
|
||||
describe('ModalTrigger', () => {
|
||||
const defaultProps = {
|
||||
|
|
|
@ -23,7 +23,7 @@ import { shallow } from 'enzyme';
|
|||
import VirtualizedSelect from 'react-virtualized-select';
|
||||
import Select, { Creatable } from 'react-select';
|
||||
|
||||
import OnPasteSelect from '../../../src/components/OnPasteSelect';
|
||||
import OnPasteSelect from 'src/components/OnPasteSelect';
|
||||
|
||||
const defaultProps = {
|
||||
onChange: sinon.spy(),
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import InfoTooltipWithTrigger from '../../../src/components/InfoTooltipWithTrigger';
|
||||
import OptionDescription from '../../../src/components/OptionDescription';
|
||||
import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
|
||||
import OptionDescription from 'src/components/OptionDescription';
|
||||
|
||||
const defaultProps = {
|
||||
option: {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import PopoverSection from '../../../src/components/PopoverSection';
|
||||
import PopoverSection from 'src/components/PopoverSection';
|
||||
|
||||
describe('PopoverSection', () => {
|
||||
const defaultProps = {
|
||||
|
|
|
@ -72,20 +72,14 @@ describe('SearchInput', () => {
|
|||
it('submits on search icon click', () => {
|
||||
typeSearchInput('bar');
|
||||
|
||||
wrapper
|
||||
.find('[data-test="search-submit"]')
|
||||
.props()
|
||||
.onClick();
|
||||
wrapper.find('[data-test="search-submit"]').props().onClick();
|
||||
|
||||
expect(defaultProps.onSubmit).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('clears on clear icon click', () => {
|
||||
const wrapper2 = factory({ value: 'fizz' });
|
||||
wrapper2
|
||||
.find('[data-test="search-clear"]')
|
||||
.props()
|
||||
.onClick();
|
||||
wrapper2.find('[data-test="search-clear"]').props().onClick();
|
||||
|
||||
expect(defaultProps.onClear).toHaveBeenCalled();
|
||||
});
|
||||
|
|
|
@ -23,8 +23,8 @@ import sinon from 'sinon';
|
|||
import fetchMock from 'fetch-mock';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
import TableSelector from 'src/components/TableSelector';
|
||||
import { initialState, tables } from '../sqllab/fixtures';
|
||||
import TableSelector from '../../../src/components/TableSelector';
|
||||
|
||||
describe('TableSelector', () => {
|
||||
let mockedProps;
|
||||
|
|
|
@ -21,7 +21,7 @@ import configureStore from 'redux-mock-store';
|
|||
import { shallow } from 'enzyme';
|
||||
|
||||
import { OverlayTrigger } from 'react-bootstrap';
|
||||
import URLShortLinkButton from '../../../src/components/URLShortLinkButton';
|
||||
import URLShortLinkButton from 'src/components/URLShortLinkButton';
|
||||
|
||||
describe('URLShortLinkButton', () => {
|
||||
const defaultProps = {
|
||||
|
|
|
@ -20,8 +20,8 @@ import React from 'react';
|
|||
import configureStore from 'redux-mock-store';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import URLShortLinkModal from '../../../src/components/URLShortLinkModal';
|
||||
import ModalTrigger from '../../../src/components/ModalTrigger';
|
||||
import URLShortLinkModal from 'src/components/URLShortLinkModal';
|
||||
import ModalTrigger from 'src/components/ModalTrigger';
|
||||
|
||||
describe('URLShortLinkModal', () => {
|
||||
const defaultProps = {
|
||||
|
|
|
@ -22,7 +22,7 @@ import sinon from 'sinon';
|
|||
import PropTypes from 'prop-types';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import VirtualizedRendererWrap from '../../../src/components/VirtualizedRendererWrap';
|
||||
import VirtualizedRendererWrap from 'src/components/VirtualizedRendererWrap';
|
||||
|
||||
const defaultProps = {
|
||||
focusedOption: { label: 'focusedOn', value: 'focusedOn' },
|
||||
|
|
|
@ -36,14 +36,11 @@ import {
|
|||
updateDashboardTitle,
|
||||
undoLayoutAction,
|
||||
redoLayoutAction,
|
||||
} from '../../../../src/dashboard/actions/dashboardLayout';
|
||||
} from 'src/dashboard/actions/dashboardLayout';
|
||||
|
||||
import { setUnsavedChanges } from '../../../../src/dashboard/actions/dashboardState';
|
||||
import * as dashboardFilters from '../../../../src/dashboard/actions/dashboardFilters';
|
||||
import {
|
||||
addWarningToast,
|
||||
ADD_TOAST,
|
||||
} from '../../../../src/messageToasts/actions';
|
||||
import { setUnsavedChanges } from 'src/dashboard/actions/dashboardState';
|
||||
import * as dashboardFilters from 'src/dashboard/actions/dashboardFilters';
|
||||
import { addWarningToast, ADD_TOAST } from 'src/messageToasts/actions';
|
||||
|
||||
import {
|
||||
DASHBOARD_GRID_TYPE,
|
||||
|
@ -51,7 +48,7 @@ import {
|
|||
CHART_TYPE,
|
||||
TABS_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
import {
|
||||
DASHBOARD_HEADER_ID,
|
||||
|
@ -59,7 +56,7 @@ import {
|
|||
DASHBOARD_ROOT_ID,
|
||||
NEW_COMPONENTS_SOURCE_ID,
|
||||
NEW_ROW_ID,
|
||||
} from '../../../../src/dashboard/util/constants';
|
||||
} from 'src/dashboard/util/constants';
|
||||
|
||||
describe('dashboardLayout actions', () => {
|
||||
const mockState = {
|
||||
|
|
|
@ -22,16 +22,16 @@ import { SupersetClient } from '@superset-ui/connection';
|
|||
import {
|
||||
removeSliceFromDashboard,
|
||||
saveDashboardRequest,
|
||||
} from '../../../../src/dashboard/actions/dashboardState';
|
||||
import { REMOVE_FILTER } from '../../../../src/dashboard/actions/dashboardFilters';
|
||||
import { UPDATE_COMPONENTS_PARENTS_LIST } from '../../../../src/dashboard/actions/dashboardLayout';
|
||||
} from 'src/dashboard/actions/dashboardState';
|
||||
import { REMOVE_FILTER } from 'src/dashboard/actions/dashboardFilters';
|
||||
import { UPDATE_COMPONENTS_PARENTS_LIST } from 'src/dashboard/actions/dashboardLayout';
|
||||
import { DASHBOARD_GRID_ID } from 'src/dashboard/util/constants';
|
||||
import {
|
||||
filterId,
|
||||
sliceEntitiesForDashboard as sliceEntities,
|
||||
} from '../fixtures/mockSliceEntities';
|
||||
import { emptyFilters } from '../fixtures/mockDashboardFilters';
|
||||
import mockDashboardData from '../fixtures/mockDashboardData';
|
||||
import { DASHBOARD_GRID_ID } from '../../../../src/dashboard/util/constants';
|
||||
|
||||
describe('dashboardState actions', () => {
|
||||
const mockState = {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import CodeModal from '../../../../src/dashboard/components/CodeModal';
|
||||
import CodeModal from 'src/dashboard/components/CodeModal';
|
||||
|
||||
describe('CodeModal', () => {
|
||||
const mockedProps = {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import CssEditor from '../../../../src/dashboard/components/CssEditor';
|
||||
import CssEditor from 'src/dashboard/components/CssEditor';
|
||||
|
||||
describe('CssEditor', () => {
|
||||
const mockedProps = {
|
||||
|
|
|
@ -25,13 +25,13 @@ import { ParentSize } from '@vx/responsive';
|
|||
import { Sticky, StickyContainer } from 'react-sticky';
|
||||
import { TabContainer, TabContent, TabPane } from 'react-bootstrap';
|
||||
|
||||
import BuilderComponentPane from '../../../../src/dashboard/components/BuilderComponentPane';
|
||||
import DashboardBuilder from '../../../../src/dashboard/components/DashboardBuilder';
|
||||
import DashboardComponent from '../../../../src/dashboard/containers/DashboardComponent';
|
||||
import DashboardHeader from '../../../../src/dashboard/containers/DashboardHeader';
|
||||
import DashboardGrid from '../../../../src/dashboard/containers/DashboardGrid';
|
||||
import * as dashboardStateActions from '../../../../src/dashboard/actions/dashboardState';
|
||||
import { BUILDER_PANE_TYPE } from '../../../../src/dashboard/util/constants';
|
||||
import BuilderComponentPane from 'src/dashboard/components/BuilderComponentPane';
|
||||
import DashboardBuilder from 'src/dashboard/components/DashboardBuilder';
|
||||
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
|
||||
import DashboardHeader from 'src/dashboard/containers/DashboardHeader';
|
||||
import DashboardGrid from 'src/dashboard/containers/DashboardGrid';
|
||||
import * as dashboardStateActions from 'src/dashboard/actions/dashboardState';
|
||||
import { BUILDER_PANE_TYPE } from 'src/dashboard/util/constants';
|
||||
|
||||
import WithDragDropContext from '../helpers/WithDragDropContext';
|
||||
import {
|
||||
|
@ -128,11 +128,7 @@ describe('DashboardBuilder', () => {
|
|||
|
||||
it('should set animation=true, mountOnEnter=true, and unmounOnExit=false on TabContainer for perf', () => {
|
||||
const wrapper = setup({ dashboardLayout: layoutWithTabs });
|
||||
const tabProps = wrapper
|
||||
.find(ParentSize)
|
||||
.dive()
|
||||
.find(TabContainer)
|
||||
.props();
|
||||
const tabProps = wrapper.find(ParentSize).dive().find(TabContainer).props();
|
||||
expect(tabProps.animation).toBe(true);
|
||||
expect(tabProps.mountOnEnter).toBe(true);
|
||||
expect(tabProps.unmountOnExit).toBe(false);
|
||||
|
|
|
@ -20,13 +20,13 @@ import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import DashboardComponent from '../../../../src/dashboard/containers/DashboardComponent';
|
||||
import DashboardGrid from '../../../../src/dashboard/components/DashboardGrid';
|
||||
import DragDroppable from '../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import newComponentFactory from '../../../../src/dashboard/util/newComponentFactory';
|
||||
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
|
||||
import DashboardGrid from 'src/dashboard/components/DashboardGrid';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import newComponentFactory from 'src/dashboard/util/newComponentFactory';
|
||||
|
||||
import { DASHBOARD_GRID_TYPE } from '../../../../src/dashboard/util/componentTypes';
|
||||
import { GRID_COLUMN_COUNT } from '../../../../src/dashboard/util/constants';
|
||||
import { DASHBOARD_GRID_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
import { GRID_COLUMN_COUNT } from 'src/dashboard/util/constants';
|
||||
|
||||
describe('DashboardGrid', () => {
|
||||
const props = {
|
||||
|
|
|
@ -20,8 +20,10 @@ import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import Dashboard from '../../../../src/dashboard/components/Dashboard';
|
||||
import DashboardBuilder from '../../../../src/dashboard/containers/DashboardBuilder';
|
||||
import Dashboard from 'src/dashboard/components/Dashboard';
|
||||
import DashboardBuilder from 'src/dashboard/containers/DashboardBuilder';
|
||||
import { CHART_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
import newComponentFactory from 'src/dashboard/util/newComponentFactory';
|
||||
|
||||
// mock data
|
||||
import chartQueries from '../fixtures/mockChartQueries';
|
||||
|
@ -31,9 +33,6 @@ import { dashboardLayout } from '../fixtures/mockDashboardLayout';
|
|||
import dashboardState from '../fixtures/mockDashboardState';
|
||||
import { sliceEntitiesForChart as sliceEntities } from '../fixtures/mockSliceEntities';
|
||||
|
||||
import { CHART_TYPE } from '../../../../src/dashboard/util/componentTypes';
|
||||
import newComponentFactory from '../../../../src/dashboard/util/newComponentFactory';
|
||||
|
||||
describe('Dashboard', () => {
|
||||
const props = {
|
||||
actions: {
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import FilterIndicatorGroup from 'src/dashboard/components/FilterIndicatorGroup';
|
||||
import FilterBadgeIcon from 'src/components/FilterBadgeIcon';
|
||||
|
||||
import { dashboardFilters } from '../fixtures/mockDashboardFilters';
|
||||
import { filterId, column } from '../fixtures/mockSliceEntities';
|
||||
import FilterIndicatorGroup from '../../../../src/dashboard/components/FilterIndicatorGroup';
|
||||
import FilterBadgeIcon from '../../../../src/components/FilterBadgeIcon';
|
||||
|
||||
describe('FilterIndicatorGroup', () => {
|
||||
const mockedProps = {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import FilterIndicatorTooltip from '../../../../src/dashboard/components/FilterIndicatorTooltip';
|
||||
import FilterIndicatorTooltip from 'src/dashboard/components/FilterIndicatorTooltip';
|
||||
|
||||
describe('FilterIndicatorTooltip', () => {
|
||||
const label = 'region';
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import FilterIndicator from 'src/dashboard/components/FilterIndicator';
|
||||
import FilterBadgeIcon from 'src/components/FilterBadgeIcon';
|
||||
|
||||
import { dashboardFilters } from '../fixtures/mockDashboardFilters';
|
||||
import { filterId, column } from '../fixtures/mockSliceEntities';
|
||||
import FilterIndicator from '../../../../src/dashboard/components/FilterIndicator';
|
||||
import FilterBadgeIcon from '../../../../src/components/FilterBadgeIcon';
|
||||
|
||||
describe('FilterIndicator', () => {
|
||||
const mockedProps = {
|
||||
|
|
|
@ -19,15 +19,15 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import FilterIndicatorsContainer from 'src/dashboard/components/FilterIndicatorsContainer';
|
||||
import FilterIndicator from 'src/dashboard/components/FilterIndicator';
|
||||
import * as colorMap from 'src/dashboard/util/dashboardFiltersColorMap';
|
||||
import { buildActiveFilters } from 'src/dashboard/util/activeDashboardFilters';
|
||||
import { getDashboardFilterKey } from 'src/dashboard/util/getDashboardFilterKey';
|
||||
import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants';
|
||||
import { dashboardFilters } from '../fixtures/mockDashboardFilters';
|
||||
import { sliceId as chartId } from '../fixtures/mockChartQueries';
|
||||
import { filterId, column } from '../fixtures/mockSliceEntities';
|
||||
import FilterIndicatorsContainer from '../../../../src/dashboard/components/FilterIndicatorsContainer';
|
||||
import FilterIndicator from '../../../../src/dashboard/components/FilterIndicator';
|
||||
import * as colorMap from '../../../../src/dashboard/util/dashboardFiltersColorMap';
|
||||
import { buildActiveFilters } from '../../../../src/dashboard/util/activeDashboardFilters';
|
||||
import { getDashboardFilterKey } from '../../../../src/dashboard/util/getDashboardFilterKey';
|
||||
import { DASHBOARD_ROOT_ID } from '../../../../src/dashboard/util/constants';
|
||||
import { dashboardWithFilter } from '../fixtures/mockDashboardLayout';
|
||||
|
||||
describe('FilterIndicatorsContainer', () => {
|
||||
|
@ -99,10 +99,8 @@ describe('FilterIndicatorsContainer', () => {
|
|||
const wrapper = setup({ dashboardFilters: overwriteDashboardFilters });
|
||||
expect(wrapper.find(FilterIndicator)).toHaveLength(1);
|
||||
|
||||
const indicatorProps = wrapper
|
||||
.find(FilterIndicator)
|
||||
.first()
|
||||
.props().indicator;
|
||||
const indicatorProps = wrapper.find(FilterIndicator).first().props()
|
||||
.indicator;
|
||||
expect(indicatorProps.label).toEqual('testField');
|
||||
expect(indicatorProps.values).toEqual([0]);
|
||||
});
|
||||
|
|
|
@ -20,8 +20,8 @@ import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
||||
import { Overlay, Tooltip } from 'react-bootstrap';
|
||||
|
||||
import FilterTooltipWrapper from '../../../../src/dashboard/components/FilterTooltipWrapper';
|
||||
import FilterIndicatorTooltip from '../../../../src/dashboard/components/FilterIndicatorTooltip';
|
||||
import FilterTooltipWrapper from 'src/dashboard/components/FilterTooltipWrapper';
|
||||
import FilterIndicatorTooltip from 'src/dashboard/components/FilterIndicatorTooltip';
|
||||
|
||||
describe('FilterTooltipWrapper', () => {
|
||||
const mockedProps = {
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { DropdownButton, MenuItem } from 'react-bootstrap';
|
||||
import RefreshIntervalModal from '../../../../src/dashboard/components/RefreshIntervalModal';
|
||||
import URLShortLinkModal from '../../../../src/components/URLShortLinkModal';
|
||||
import HeaderActionsDropdown from '../../../../src/dashboard/components/HeaderActionsDropdown';
|
||||
import SaveModal from '../../../../src/dashboard/components/SaveModal';
|
||||
import CssEditor from '../../../../src/dashboard/components/CssEditor';
|
||||
import RefreshIntervalModal from 'src/dashboard/components/RefreshIntervalModal';
|
||||
import URLShortLinkModal from 'src/components/URLShortLinkModal';
|
||||
import HeaderActionsDropdown from 'src/dashboard/components/HeaderActionsDropdown';
|
||||
import SaveModal from 'src/dashboard/components/SaveModal';
|
||||
import CssEditor from 'src/dashboard/components/CssEditor';
|
||||
|
||||
describe('HeaderActionsDropdown', () => {
|
||||
const props = {
|
||||
|
|
|
@ -18,14 +18,14 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import Header from '../../../../src/dashboard/components/Header';
|
||||
import EditableTitle from '../../../../src/components/EditableTitle';
|
||||
import FaveStar from '../../../../src/components/FaveStar';
|
||||
import PublishedStatus from '../../../../src/dashboard/components/PublishedStatus';
|
||||
import HeaderActionsDropdown from '../../../../src/dashboard/components/HeaderActionsDropdown';
|
||||
import Button from '../../../../src/components/Button';
|
||||
import UndoRedoKeylisteners from '../../../../src/dashboard/components/UndoRedoKeylisteners';
|
||||
import { BUILDER_PANE_TYPE } from '../../../../src/dashboard/util/constants';
|
||||
import Header from 'src/dashboard/components/Header';
|
||||
import EditableTitle from 'src/components/EditableTitle';
|
||||
import FaveStar from 'src/components/FaveStar';
|
||||
import PublishedStatus from 'src/dashboard/components/PublishedStatus';
|
||||
import HeaderActionsDropdown from 'src/dashboard/components/HeaderActionsDropdown';
|
||||
import Button from 'src/components/Button';
|
||||
import UndoRedoKeylisteners from 'src/dashboard/components/UndoRedoKeylisteners';
|
||||
import { BUILDER_PANE_TYPE } from 'src/dashboard/util/constants';
|
||||
|
||||
describe('Header', () => {
|
||||
const props = {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import MissingChart from '../../../../src/dashboard/components/MissingChart';
|
||||
import MissingChart from 'src/dashboard/components/MissingChart';
|
||||
|
||||
describe('MissingChart', () => {
|
||||
function setup(overrideProps) {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import RefreshIntervalModal from '../../../../src/dashboard/components/RefreshIntervalModal';
|
||||
import RefreshIntervalModal from 'src/dashboard/components/RefreshIntervalModal';
|
||||
|
||||
describe('RefreshIntervalModal', () => {
|
||||
const mockedProps = {
|
||||
|
|
|
@ -22,7 +22,7 @@ import sinon from 'sinon';
|
|||
|
||||
import { List } from 'react-virtualized';
|
||||
|
||||
import SliceAdder from '../../../../src/dashboard/components/SliceAdder';
|
||||
import SliceAdder from 'src/dashboard/components/SliceAdder';
|
||||
import { sliceEntitiesForDashboard as mockSliceEntities } from '../fixtures/mockSliceEntities';
|
||||
|
||||
describe('SliceAdder', () => {
|
||||
|
|
|
@ -20,12 +20,9 @@ import React from 'react';
|
|||
import { shallow, mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import newComponentFactory from '../../../../../src/dashboard/util/newComponentFactory';
|
||||
import {
|
||||
CHART_TYPE,
|
||||
ROW_TYPE,
|
||||
} from '../../../../../src/dashboard/util/componentTypes';
|
||||
import { UnwrappedDragDroppable as DragDroppable } from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import newComponentFactory from 'src/dashboard/util/newComponentFactory';
|
||||
import { CHART_TYPE, ROW_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
import { UnwrappedDragDroppable as DragDroppable } from 'src/dashboard/components/dnd/DragDroppable';
|
||||
|
||||
describe('DragDroppable', () => {
|
||||
const props = {
|
||||
|
|
|
@ -21,12 +21,12 @@ import React from 'react';
|
|||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import Chart from '../../../../../src/dashboard/containers/Chart';
|
||||
import ChartHolder from '../../../../../src/dashboard/components/gridComponents/ChartHolder';
|
||||
import DeleteComponentButton from '../../../../../src/dashboard/components/DeleteComponentButton';
|
||||
import DragDroppable from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import HoverMenu from '../../../../../src/dashboard/components/menu/HoverMenu';
|
||||
import ResizableContainer from '../../../../../src/dashboard/components/resizable/ResizableContainer';
|
||||
import Chart from 'src/dashboard/containers/Chart';
|
||||
import ChartHolder from 'src/dashboard/components/gridComponents/ChartHolder';
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
import ResizableContainer from 'src/dashboard/components/resizable/ResizableContainer';
|
||||
|
||||
import { mockStore } from '../../fixtures/mockStore';
|
||||
import { sliceId } from '../../fixtures/mockSliceEntities';
|
||||
|
|
|
@ -20,9 +20,9 @@ import React from 'react';
|
|||
import { shallow } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import Chart from '../../../../../src/dashboard/components/gridComponents/Chart';
|
||||
import SliceHeader from '../../../../../src/dashboard/components/SliceHeader';
|
||||
import ChartContainer from '../../../../../src/chart/ChartContainer';
|
||||
import Chart from 'src/dashboard/components/gridComponents/Chart';
|
||||
import SliceHeader from 'src/dashboard/components/SliceHeader';
|
||||
import ChartContainer from 'src/chart/ChartContainer';
|
||||
|
||||
import mockDatasource from '../../../../fixtures/mockDatasource';
|
||||
import { sliceEntitiesForChart as sliceEntities } from '../../fixtures/mockSliceEntities';
|
||||
|
|
|
@ -21,15 +21,15 @@ import React from 'react';
|
|||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import BackgroundStyleDropdown from '../../../../../src/dashboard/components/menu/BackgroundStyleDropdown';
|
||||
import Column from '../../../../../src/dashboard/components/gridComponents/Column';
|
||||
import DashboardComponent from '../../../../../src/dashboard/containers/DashboardComponent';
|
||||
import DeleteComponentButton from '../../../../../src/dashboard/components/DeleteComponentButton';
|
||||
import DragDroppable from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import HoverMenu from '../../../../../src/dashboard/components/menu/HoverMenu';
|
||||
import IconButton from '../../../../../src/dashboard/components/IconButton';
|
||||
import ResizableContainer from '../../../../../src/dashboard/components/resizable/ResizableContainer';
|
||||
import WithPopoverMenu from '../../../../../src/dashboard/components/menu/WithPopoverMenu';
|
||||
import BackgroundStyleDropdown from 'src/dashboard/components/menu/BackgroundStyleDropdown';
|
||||
import Column from 'src/dashboard/components/gridComponents/Column';
|
||||
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
import IconButton from 'src/dashboard/components/IconButton';
|
||||
import ResizableContainer from 'src/dashboard/components/resizable/ResizableContainer';
|
||||
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
|
||||
import { mockStore } from '../../fixtures/mockStore';
|
||||
import { dashboardLayout as mockLayout } from '../../fixtures/mockDashboardLayout';
|
||||
|
|
|
@ -20,15 +20,15 @@ import React from 'react';
|
|||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import DeleteComponentButton from '../../../../../src/dashboard/components/DeleteComponentButton';
|
||||
import HoverMenu from '../../../../../src/dashboard/components/menu/HoverMenu';
|
||||
import DragDroppable from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import Divider from '../../../../../src/dashboard/components/gridComponents/Divider';
|
||||
import newComponentFactory from '../../../../../src/dashboard/util/newComponentFactory';
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import Divider from 'src/dashboard/components/gridComponents/Divider';
|
||||
import newComponentFactory from 'src/dashboard/util/newComponentFactory';
|
||||
import {
|
||||
DIVIDER_TYPE,
|
||||
DASHBOARD_GRID_TYPE,
|
||||
} from '../../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
import WithDragDropContext from '../../helpers/WithDragDropContext';
|
||||
|
||||
|
|
|
@ -21,17 +21,17 @@ import { Provider } from 'react-redux';
|
|||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import DeleteComponentButton from '../../../../../src/dashboard/components/DeleteComponentButton';
|
||||
import EditableTitle from '../../../../../src/components/EditableTitle';
|
||||
import HoverMenu from '../../../../../src/dashboard/components/menu/HoverMenu';
|
||||
import WithPopoverMenu from '../../../../../src/dashboard/components/menu/WithPopoverMenu';
|
||||
import DragDroppable from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import Header from '../../../../../src/dashboard/components/gridComponents/Header';
|
||||
import newComponentFactory from '../../../../../src/dashboard/util/newComponentFactory';
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import EditableTitle from 'src/components/EditableTitle';
|
||||
import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import Header from 'src/dashboard/components/gridComponents/Header';
|
||||
import newComponentFactory from 'src/dashboard/util/newComponentFactory';
|
||||
import {
|
||||
HEADER_TYPE,
|
||||
DASHBOARD_GRID_TYPE,
|
||||
} from '../../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
import WithDragDropContext from '../../helpers/WithDragDropContext';
|
||||
import { mockStoreWithTabs } from '../../fixtures/mockStore';
|
||||
|
|
|
@ -23,12 +23,12 @@ import sinon from 'sinon';
|
|||
import AceEditor from 'react-ace';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
|
||||
import Markdown from '../../../../../src/dashboard/components/gridComponents/Markdown';
|
||||
import MarkdownModeDropdown from '../../../../../src/dashboard/components/menu/MarkdownModeDropdown';
|
||||
import DeleteComponentButton from '../../../../../src/dashboard/components/DeleteComponentButton';
|
||||
import DragDroppable from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import WithPopoverMenu from '../../../../../src/dashboard/components/menu/WithPopoverMenu';
|
||||
import ResizableContainer from '../../../../../src/dashboard/components/resizable/ResizableContainer';
|
||||
import Markdown from 'src/dashboard/components/gridComponents/Markdown';
|
||||
import MarkdownModeDropdown from 'src/dashboard/components/menu/MarkdownModeDropdown';
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
import ResizableContainer from 'src/dashboard/components/resizable/ResizableContainer';
|
||||
|
||||
import { mockStore } from '../../fixtures/mockStore';
|
||||
import { dashboardLayout as mockLayout } from '../../fixtures/mockDashboardLayout';
|
||||
|
|
|
@ -21,17 +21,17 @@ import React from 'react';
|
|||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import BackgroundStyleDropdown from '../../../../../src/dashboard/components/menu/BackgroundStyleDropdown';
|
||||
import DashboardComponent from '../../../../../src/dashboard/containers/DashboardComponent';
|
||||
import DeleteComponentButton from '../../../../../src/dashboard/components/DeleteComponentButton';
|
||||
import DragDroppable from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import HoverMenu from '../../../../../src/dashboard/components/menu/HoverMenu';
|
||||
import IconButton from '../../../../../src/dashboard/components/IconButton';
|
||||
import Row from '../../../../../src/dashboard/components/gridComponents/Row';
|
||||
import WithPopoverMenu from '../../../../../src/dashboard/components/menu/WithPopoverMenu';
|
||||
import BackgroundStyleDropdown from 'src/dashboard/components/menu/BackgroundStyleDropdown';
|
||||
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
import IconButton from 'src/dashboard/components/IconButton';
|
||||
import Row from 'src/dashboard/components/gridComponents/Row';
|
||||
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
import { DASHBOARD_GRID_ID } from 'src/dashboard/util/constants';
|
||||
|
||||
import { mockStore } from '../../fixtures/mockStore';
|
||||
import { DASHBOARD_GRID_ID } from '../../../../../src/dashboard/util/constants';
|
||||
import { dashboardLayout as mockLayout } from '../../fixtures/mockDashboardLayout';
|
||||
import WithDragDropContext from '../../helpers/WithDragDropContext';
|
||||
|
||||
|
|
|
@ -21,15 +21,15 @@ import React from 'react';
|
|||
import { mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import DashboardComponent from '../../../../../src/dashboard/containers/DashboardComponent';
|
||||
import DeleteComponentModal from '../../../../../src/dashboard/components/DeleteComponentModal';
|
||||
import DragDroppable from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import EditableTitle from '../../../../../src/components/EditableTitle';
|
||||
import WithPopoverMenu from '../../../../../src/dashboard/components/menu/WithPopoverMenu';
|
||||
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
|
||||
import DeleteComponentModal from 'src/dashboard/components/DeleteComponentModal';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import EditableTitle from 'src/components/EditableTitle';
|
||||
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
import Tab, {
|
||||
RENDER_TAB,
|
||||
RENDER_TAB_CONTENT,
|
||||
} from '../../../../../src/dashboard/components/gridComponents/Tab';
|
||||
} from 'src/dashboard/components/gridComponents/Tab';
|
||||
import WithDragDropContext from '../../helpers/WithDragDropContext';
|
||||
import { dashboardLayoutWithTabs } from '../../fixtures/mockDashboardLayout';
|
||||
import { mockStoreWithTabs } from '../../fixtures/mockStore';
|
||||
|
|
|
@ -22,15 +22,15 @@ import { mount, shallow } from 'enzyme';
|
|||
import sinon from 'sinon';
|
||||
import { Tabs as BootstrapTabs, Tab as BootstrapTab } from 'react-bootstrap';
|
||||
|
||||
import DashboardComponent from '../../../../../src/dashboard/containers/DashboardComponent';
|
||||
import DeleteComponentButton from '../../../../../src/dashboard/components/DeleteComponentButton';
|
||||
import HoverMenu from '../../../../../src/dashboard/components/menu/HoverMenu';
|
||||
import DragDroppable from '../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import Tabs from '../../../../../src/dashboard/components/gridComponents/Tabs';
|
||||
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
|
||||
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
|
||||
import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import Tabs from 'src/dashboard/components/gridComponents/Tabs';
|
||||
import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants';
|
||||
import WithDragDropContext from '../../helpers/WithDragDropContext';
|
||||
import { dashboardLayoutWithTabs } from '../../fixtures/mockDashboardLayout';
|
||||
import { mockStoreWithTabs } from '../../fixtures/mockStore';
|
||||
import { DASHBOARD_ROOT_ID } from '../../../../../src/dashboard/util/constants';
|
||||
|
||||
describe('Tabs', () => {
|
||||
const props = {
|
||||
|
|
|
@ -19,15 +19,14 @@
|
|||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import DragDroppable from '../../../../../../src/dashboard/components/dnd/DragDroppable';
|
||||
import DraggableNewComponent from '../../../../../../src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import WithDragDropContext from '../../../helpers/WithDragDropContext';
|
||||
|
||||
import { NEW_COMPONENTS_SOURCE_ID } from '../../../../../../src/dashboard/util/constants';
|
||||
import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
|
||||
import DraggableNewComponent from 'src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import { NEW_COMPONENTS_SOURCE_ID } from 'src/dashboard/util/constants';
|
||||
import {
|
||||
NEW_COMPONENT_SOURCE_TYPE,
|
||||
CHART_TYPE,
|
||||
} from '../../../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
import WithDragDropContext from '../../../helpers/WithDragDropContext';
|
||||
|
||||
describe('DraggableNewComponent', () => {
|
||||
const props = {
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import DraggableNewComponent from '../../../../../../src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewColumn from '../../../../../../src/dashboard/components/gridComponents/new/NewColumn';
|
||||
import DraggableNewComponent from 'src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewColumn from 'src/dashboard/components/gridComponents/new/NewColumn';
|
||||
|
||||
import { NEW_COLUMN_ID } from '../../../../../../src/dashboard/util/constants';
|
||||
import { COLUMN_TYPE } from '../../../../../../src/dashboard/util/componentTypes';
|
||||
import { NEW_COLUMN_ID } from 'src/dashboard/util/constants';
|
||||
import { COLUMN_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('NewColumn', () => {
|
||||
function setup() {
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import DraggableNewComponent from '../../../../../../src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewDivider from '../../../../../../src/dashboard/components/gridComponents/new/NewDivider';
|
||||
import DraggableNewComponent from 'src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewDivider from 'src/dashboard/components/gridComponents/new/NewDivider';
|
||||
|
||||
import { NEW_DIVIDER_ID } from '../../../../../../src/dashboard/util/constants';
|
||||
import { DIVIDER_TYPE } from '../../../../../../src/dashboard/util/componentTypes';
|
||||
import { NEW_DIVIDER_ID } from 'src/dashboard/util/constants';
|
||||
import { DIVIDER_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('NewDivider', () => {
|
||||
function setup() {
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import DraggableNewComponent from '../../../../../../src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewHeader from '../../../../../../src/dashboard/components/gridComponents/new/NewHeader';
|
||||
import DraggableNewComponent from 'src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewHeader from 'src/dashboard/components/gridComponents/new/NewHeader';
|
||||
|
||||
import { NEW_HEADER_ID } from '../../../../../../src/dashboard/util/constants';
|
||||
import { HEADER_TYPE } from '../../../../../../src/dashboard/util/componentTypes';
|
||||
import { NEW_HEADER_ID } from 'src/dashboard/util/constants';
|
||||
import { HEADER_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('NewHeader', () => {
|
||||
function setup() {
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import DraggableNewComponent from '../../../../../../src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewRow from '../../../../../../src/dashboard/components/gridComponents/new/NewRow';
|
||||
import DraggableNewComponent from 'src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewRow from 'src/dashboard/components/gridComponents/new/NewRow';
|
||||
|
||||
import { NEW_ROW_ID } from '../../../../../../src/dashboard/util/constants';
|
||||
import { ROW_TYPE } from '../../../../../../src/dashboard/util/componentTypes';
|
||||
import { NEW_ROW_ID } from 'src/dashboard/util/constants';
|
||||
import { ROW_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('NewRow', () => {
|
||||
function setup() {
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import DraggableNewComponent from '../../../../../../src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewTabs from '../../../../../../src/dashboard/components/gridComponents/new/NewTabs';
|
||||
import DraggableNewComponent from 'src/dashboard/components/gridComponents/new/DraggableNewComponent';
|
||||
import NewTabs from 'src/dashboard/components/gridComponents/new/NewTabs';
|
||||
|
||||
import { NEW_TABS_ID } from '../../../../../../src/dashboard/util/constants';
|
||||
import { TABS_TYPE } from '../../../../../../src/dashboard/util/componentTypes';
|
||||
import { NEW_TABS_ID } from 'src/dashboard/util/constants';
|
||||
import { TABS_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('NewTabs', () => {
|
||||
function setup() {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import HoverMenu from '../../../../../src/dashboard/components/menu/HoverMenu';
|
||||
import HoverMenu from 'src/dashboard/components/menu/HoverMenu';
|
||||
|
||||
describe('HoverMenu', () => {
|
||||
it('should render a div.hover-menu', () => {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import WithPopoverMenu from '../../../../../src/dashboard/components/menu/WithPopoverMenu';
|
||||
import WithPopoverMenu from 'src/dashboard/components/menu/WithPopoverMenu';
|
||||
|
||||
describe('WithPopoverMenu', () => {
|
||||
const props = {
|
||||
|
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
|||
import Resizable from 're-resizable';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import ResizableContainer from '../../../../../src/dashboard/components/resizable/ResizableContainer';
|
||||
import ResizableContainer from 'src/dashboard/components/resizable/ResizableContainer';
|
||||
|
||||
describe('ResizableContainer', () => {
|
||||
const props = { editMode: false, id: 'id' };
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import ResizableHandle from '../../../../../src/dashboard/components/resizable/ResizableHandle';
|
||||
import ResizableHandle from 'src/dashboard/components/resizable/ResizableHandle';
|
||||
|
||||
describe('ResizableHandle', () => {
|
||||
it('should render a right resize handle', () => {
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { DASHBOARD_FILTER_SCOPE_GLOBAL } from 'src/dashboard/reducers/dashboardFilters';
|
||||
import { filterId } from './mockSliceEntities';
|
||||
import { DASHBOARD_FILTER_SCOPE_GLOBAL } from '../../../../src/dashboard/reducers/dashboardFilters';
|
||||
|
||||
export const emptyFilters = {};
|
||||
|
||||
|
|
|
@ -26,15 +26,15 @@ import {
|
|||
ROW_TYPE,
|
||||
COLUMN_TYPE,
|
||||
MARKDOWN_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
import {
|
||||
DASHBOARD_ROOT_ID,
|
||||
DASHBOARD_HEADER_ID,
|
||||
DASHBOARD_GRID_ID,
|
||||
} from '../../../../src/dashboard/util/constants';
|
||||
} from 'src/dashboard/util/constants';
|
||||
|
||||
import newComponentFactory from '../../../../src/dashboard/util/newComponentFactory';
|
||||
import newComponentFactory from 'src/dashboard/util/newComponentFactory';
|
||||
|
||||
import { sliceId as chartId } from './mockChartQueries';
|
||||
import { filterId } from './mockDashboardFilters';
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { BUILDER_PANE_TYPE } from 'src/dashboard/util/constants';
|
||||
import { sliceId } from './mockChartQueries';
|
||||
import { BUILDER_PANE_TYPE } from '../../../../src/dashboard/util/constants';
|
||||
|
||||
export default {
|
||||
sliceIds: [sliceId],
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import { createStore, applyMiddleware, compose } from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
import rootReducer from '../../../../src/dashboard/reducers/index';
|
||||
import rootReducer from 'src/dashboard/reducers/index';
|
||||
|
||||
import mockState from './mockState';
|
||||
import { dashboardLayoutWithTabs } from './mockDashboardLayout';
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import getDragDropManager from '../../../../src/dashboard/util/getDragDropManager';
|
||||
import getDragDropManager from 'src/dashboard/util/getDragDropManager';
|
||||
|
||||
// A helper component that provides a DragDropContext for components that require it
|
||||
class WithDragDropContext extends React.Component {
|
||||
|
|
|
@ -22,10 +22,11 @@ import {
|
|||
REMOVE_FILTER,
|
||||
CHANGE_FILTER,
|
||||
UPDATE_DASHBOARD_FILTERS_SCOPE,
|
||||
} from '../../../../src/dashboard/actions/dashboardFilters';
|
||||
} from 'src/dashboard/actions/dashboardFilters';
|
||||
import dashboardFiltersReducer, {
|
||||
DASHBOARD_FILTER_SCOPE_GLOBAL,
|
||||
} from '../../../../src/dashboard/reducers/dashboardFilters';
|
||||
} from 'src/dashboard/reducers/dashboardFilters';
|
||||
import * as activeDashboardFilters from 'src/dashboard/util/activeDashboardFilters';
|
||||
import {
|
||||
emptyFilters,
|
||||
dashboardFilters,
|
||||
|
@ -36,7 +37,6 @@ import {
|
|||
column,
|
||||
} from '../fixtures/mockSliceEntities';
|
||||
import { filterComponent } from '../fixtures/mockDashboardLayout';
|
||||
import * as activeDashboardFilters from '../../../../src/dashboard/util/activeDashboardFilters';
|
||||
|
||||
describe('dashboardFilters reducer', () => {
|
||||
const form_data = sliceEntitiesForDashboard.slices[filterId].form_data;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import layoutReducer from '../../../../src/dashboard/reducers/dashboardLayout';
|
||||
import layoutReducer from 'src/dashboard/reducers/dashboardLayout';
|
||||
|
||||
import {
|
||||
UPDATE_COMPONENTS,
|
||||
|
@ -25,7 +25,7 @@ import {
|
|||
MOVE_COMPONENT,
|
||||
CREATE_TOP_LEVEL_TABS,
|
||||
DELETE_TOP_LEVEL_TABS,
|
||||
} from '../../../../src/dashboard/actions/dashboardLayout';
|
||||
} from 'src/dashboard/actions/dashboardLayout';
|
||||
|
||||
import {
|
||||
CHART_TYPE,
|
||||
|
@ -34,7 +34,7 @@ import {
|
|||
ROW_TYPE,
|
||||
TAB_TYPE,
|
||||
TABS_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
import {
|
||||
DASHBOARD_ROOT_ID,
|
||||
|
@ -42,7 +42,7 @@ import {
|
|||
NEW_COMPONENTS_SOURCE_ID,
|
||||
NEW_TABS_ID,
|
||||
NEW_ROW_ID,
|
||||
} from '../../../../src/dashboard/util/constants';
|
||||
} from 'src/dashboard/util/constants';
|
||||
|
||||
describe('dashboardLayout reducer', () => {
|
||||
it('should return initial state for unrecognized actions', () => {
|
||||
|
|
|
@ -27,10 +27,10 @@ import {
|
|||
SET_UNSAVED_CHANGES,
|
||||
TOGGLE_EXPAND_SLICE,
|
||||
TOGGLE_FAVE_STAR,
|
||||
} from '../../../../src/dashboard/actions/dashboardState';
|
||||
} from 'src/dashboard/actions/dashboardState';
|
||||
|
||||
import dashboardStateReducer from '../../../../src/dashboard/reducers/dashboardState';
|
||||
import { BUILDER_PANE_TYPE } from '../../../../src/dashboard/util/constants';
|
||||
import dashboardStateReducer from 'src/dashboard/reducers/dashboardState';
|
||||
import { BUILDER_PANE_TYPE } from 'src/dashboard/util/constants';
|
||||
|
||||
describe('dashboardState reducer', () => {
|
||||
it('should return initial state', () => {
|
||||
|
|
|
@ -20,9 +20,9 @@ import {
|
|||
FETCH_ALL_SLICES_FAILED,
|
||||
FETCH_ALL_SLICES_STARTED,
|
||||
SET_ALL_SLICES,
|
||||
} from '../../../../src/dashboard/actions/sliceEntities';
|
||||
} from 'src/dashboard/actions/sliceEntities';
|
||||
|
||||
import sliceEntitiesReducer from '../../../../src/dashboard/reducers/sliceEntities';
|
||||
import sliceEntitiesReducer from 'src/dashboard/reducers/sliceEntities';
|
||||
|
||||
describe('sliceEntities reducer', () => {
|
||||
it('should return initial state', () => {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import componentIsResizable from '../../../../src/dashboard/util/componentIsResizable';
|
||||
import componentIsResizable from 'src/dashboard/util/componentIsResizable';
|
||||
import {
|
||||
CHART_TYPE,
|
||||
COLUMN_TYPE,
|
||||
|
@ -28,7 +28,7 @@ import {
|
|||
ROW_TYPE,
|
||||
TABS_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
const notResizable = [
|
||||
DASHBOARD_GRID_TYPE,
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import reorderItem from '../../../../src/dashboard/util/dnd-reorder';
|
||||
import reorderItem from 'src/dashboard/util/dnd-reorder';
|
||||
|
||||
describe('dnd-reorderItem', () => {
|
||||
it('should remove the item from its source entity and add it to its destination entity', () => {
|
||||
|
|
|
@ -16,15 +16,15 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import dropOverflowsParent from '../../../../src/dashboard/util/dropOverflowsParent';
|
||||
import { NEW_COMPONENTS_SOURCE_ID } from '../../../../src/dashboard/util/constants';
|
||||
import dropOverflowsParent from 'src/dashboard/util/dropOverflowsParent';
|
||||
import { NEW_COMPONENTS_SOURCE_ID } from 'src/dashboard/util/constants';
|
||||
import {
|
||||
CHART_TYPE,
|
||||
COLUMN_TYPE,
|
||||
ROW_TYPE,
|
||||
HEADER_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('dropOverflowsParent', () => {
|
||||
it('returns true if a parent does NOT have adequate width for child', () => {
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import findFirstParentContainerId from '../../../../src/dashboard/util/findFirstParentContainer';
|
||||
import findFirstParentContainerId from 'src/dashboard/util/findFirstParentContainer';
|
||||
import {
|
||||
DASHBOARD_GRID_ID,
|
||||
DASHBOARD_ROOT_ID,
|
||||
} from '../../../../src/dashboard/util/constants';
|
||||
} from 'src/dashboard/util/constants';
|
||||
|
||||
describe('findFirstParentContainer', () => {
|
||||
const mockGridLayout = {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import findParentId from '../../../../src/dashboard/util/findParentId';
|
||||
import findParentId from 'src/dashboard/util/findParentId';
|
||||
|
||||
describe('findParentId', () => {
|
||||
const layout = {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import findTabIndexByComponentId from '../../../../src/dashboard/util/findTabIndexByComponentId';
|
||||
import findTabIndexByComponentId from 'src/dashboard/util/findTabIndexByComponentId';
|
||||
|
||||
describe('findTabIndexByComponentId', () => {
|
||||
const topLevelTabsComponent = {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getChartAndLabelComponentIdFromPath from '../../../../src/dashboard/util/getChartAndLabelComponentIdFromPath';
|
||||
import getChartAndLabelComponentIdFromPath from 'src/dashboard/util/getChartAndLabelComponentIdFromPath';
|
||||
|
||||
describe('getChartAndLabelComponentIdFromPath', () => {
|
||||
it('should return label and component id', () => {
|
||||
|
|
|
@ -16,11 +16,8 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getChartIdsFromLayout from '../../../../src/dashboard/util/getChartIdsFromLayout';
|
||||
import {
|
||||
ROW_TYPE,
|
||||
CHART_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
import getChartIdsFromLayout from 'src/dashboard/util/getChartIdsFromLayout';
|
||||
import { ROW_TYPE, CHART_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('getChartIdsFromLayout', () => {
|
||||
const mockLayout = {
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getDashboardUrl from '../../../../src/dashboard/util/getDashboardUrl';
|
||||
import { DASHBOARD_FILTER_SCOPE_GLOBAL } from '../../../../src/dashboard/reducers/dashboardFilters';
|
||||
import getDashboardUrl from 'src/dashboard/util/getDashboardUrl';
|
||||
import { DASHBOARD_FILTER_SCOPE_GLOBAL } from 'src/dashboard/reducers/dashboardFilters';
|
||||
|
||||
describe('getChartIdsFromLayout', () => {
|
||||
it('should encode filters', () => {
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getDetailedComponentWidth from '../../../../src/dashboard/util/getDetailedComponentWidth';
|
||||
import * as types from '../../../../src/dashboard/util/componentTypes';
|
||||
import getDetailedComponentWidth from 'src/dashboard/util/getDetailedComponentWidth';
|
||||
import * as types from 'src/dashboard/util/componentTypes';
|
||||
import {
|
||||
GRID_COLUMN_COUNT,
|
||||
GRID_MIN_COLUMN_COUNT,
|
||||
} from '../../../../src/dashboard/util/constants';
|
||||
} from 'src/dashboard/util/constants';
|
||||
|
||||
describe('getDetailedComponentWidth', () => {
|
||||
it('should return an object with width, minimumWidth, and occupiedWidth', () => {
|
||||
|
|
|
@ -21,7 +21,7 @@ import getDropPosition, {
|
|||
DROP_RIGHT,
|
||||
DROP_BOTTOM,
|
||||
DROP_LEFT,
|
||||
} from '../../../../src/dashboard/util/getDropPosition';
|
||||
} from 'src/dashboard/util/getDropPosition';
|
||||
|
||||
import {
|
||||
CHART_TYPE,
|
||||
|
@ -30,7 +30,7 @@ import {
|
|||
HEADER_TYPE,
|
||||
ROW_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('getDropPosition', () => {
|
||||
// helper to easily configure test
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue