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