mirror of
https://github.com/apache/superset.git
synced 2026-04-07 18:35:15 +00:00
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:
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import componentIsResizable from '../../../../src/dashboard/util/componentIsResizable';
|
||||
import componentIsResizable from 'src/dashboard/util/componentIsResizable';
|
||||
import {
|
||||
CHART_TYPE,
|
||||
COLUMN_TYPE,
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
ROW_TYPE,
|
||||
TABS_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
const notResizable = [
|
||||
DASHBOARD_GRID_TYPE,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import reorderItem from '../../../../src/dashboard/util/dnd-reorder';
|
||||
import reorderItem from 'src/dashboard/util/dnd-reorder';
|
||||
|
||||
describe('dnd-reorderItem', () => {
|
||||
it('should remove the item from its source entity and add it to its destination entity', () => {
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import dropOverflowsParent from '../../../../src/dashboard/util/dropOverflowsParent';
|
||||
import { NEW_COMPONENTS_SOURCE_ID } from '../../../../src/dashboard/util/constants';
|
||||
import dropOverflowsParent from 'src/dashboard/util/dropOverflowsParent';
|
||||
import { NEW_COMPONENTS_SOURCE_ID } from 'src/dashboard/util/constants';
|
||||
import {
|
||||
CHART_TYPE,
|
||||
COLUMN_TYPE,
|
||||
ROW_TYPE,
|
||||
HEADER_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('dropOverflowsParent', () => {
|
||||
it('returns true if a parent does NOT have adequate width for child', () => {
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import findFirstParentContainerId from '../../../../src/dashboard/util/findFirstParentContainer';
|
||||
import findFirstParentContainerId from 'src/dashboard/util/findFirstParentContainer';
|
||||
import {
|
||||
DASHBOARD_GRID_ID,
|
||||
DASHBOARD_ROOT_ID,
|
||||
} from '../../../../src/dashboard/util/constants';
|
||||
} from 'src/dashboard/util/constants';
|
||||
|
||||
describe('findFirstParentContainer', () => {
|
||||
const mockGridLayout = {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import findParentId from '../../../../src/dashboard/util/findParentId';
|
||||
import findParentId from 'src/dashboard/util/findParentId';
|
||||
|
||||
describe('findParentId', () => {
|
||||
const layout = {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import findTabIndexByComponentId from '../../../../src/dashboard/util/findTabIndexByComponentId';
|
||||
import findTabIndexByComponentId from 'src/dashboard/util/findTabIndexByComponentId';
|
||||
|
||||
describe('findTabIndexByComponentId', () => {
|
||||
const topLevelTabsComponent = {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getChartAndLabelComponentIdFromPath from '../../../../src/dashboard/util/getChartAndLabelComponentIdFromPath';
|
||||
import getChartAndLabelComponentIdFromPath from 'src/dashboard/util/getChartAndLabelComponentIdFromPath';
|
||||
|
||||
describe('getChartAndLabelComponentIdFromPath', () => {
|
||||
it('should return label and component id', () => {
|
||||
|
||||
@@ -16,11 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getChartIdsFromLayout from '../../../../src/dashboard/util/getChartIdsFromLayout';
|
||||
import {
|
||||
ROW_TYPE,
|
||||
CHART_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
import getChartIdsFromLayout from 'src/dashboard/util/getChartIdsFromLayout';
|
||||
import { ROW_TYPE, CHART_TYPE } from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('getChartIdsFromLayout', () => {
|
||||
const mockLayout = {
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getDashboardUrl from '../../../../src/dashboard/util/getDashboardUrl';
|
||||
import { DASHBOARD_FILTER_SCOPE_GLOBAL } from '../../../../src/dashboard/reducers/dashboardFilters';
|
||||
import getDashboardUrl from 'src/dashboard/util/getDashboardUrl';
|
||||
import { DASHBOARD_FILTER_SCOPE_GLOBAL } from 'src/dashboard/reducers/dashboardFilters';
|
||||
|
||||
describe('getChartIdsFromLayout', () => {
|
||||
it('should encode filters', () => {
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getDetailedComponentWidth from '../../../../src/dashboard/util/getDetailedComponentWidth';
|
||||
import * as types from '../../../../src/dashboard/util/componentTypes';
|
||||
import getDetailedComponentWidth from 'src/dashboard/util/getDetailedComponentWidth';
|
||||
import * as types from 'src/dashboard/util/componentTypes';
|
||||
import {
|
||||
GRID_COLUMN_COUNT,
|
||||
GRID_MIN_COLUMN_COUNT,
|
||||
} from '../../../../src/dashboard/util/constants';
|
||||
} from 'src/dashboard/util/constants';
|
||||
|
||||
describe('getDetailedComponentWidth', () => {
|
||||
it('should return an object with width, minimumWidth, and occupiedWidth', () => {
|
||||
|
||||
@@ -21,7 +21,7 @@ import getDropPosition, {
|
||||
DROP_RIGHT,
|
||||
DROP_BOTTOM,
|
||||
DROP_LEFT,
|
||||
} from '../../../../src/dashboard/util/getDropPosition';
|
||||
} from 'src/dashboard/util/getDropPosition';
|
||||
|
||||
import {
|
||||
CHART_TYPE,
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
HEADER_TYPE,
|
||||
ROW_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('getDropPosition', () => {
|
||||
// helper to easily configure test
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getFilterConfigsFromFormdata from '../../../../src/dashboard/util/getFilterConfigsFromFormdata';
|
||||
import getFilterConfigsFromFormdata from 'src/dashboard/util/getFilterConfigsFromFormdata';
|
||||
|
||||
describe('getFilterConfigsFromFormdata', () => {
|
||||
const testFormdata = {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getFilterScopeFromNodesTree from '../../../../src/dashboard/util/getFilterScopeFromNodesTree';
|
||||
import getFilterScopeFromNodesTree from 'src/dashboard/util/getFilterScopeFromNodesTree';
|
||||
|
||||
describe('getFilterScopeFromNodesTree', () => {
|
||||
it('should return empty scope', () => {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getFormDataWithExtraFilters from '../../../../src/dashboard/util/charts/getFormDataWithExtraFilters';
|
||||
import getFormDataWithExtraFilters from 'src/dashboard/util/charts/getFormDataWithExtraFilters';
|
||||
|
||||
describe('getFormDataWithExtraFilters', () => {
|
||||
const chartId = 'chartId';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import getLeafComponentIdFromPath from '../../../../src/dashboard/util/getLeafComponentIdFromPath';
|
||||
import getLeafComponentIdFromPath from 'src/dashboard/util/getLeafComponentIdFromPath';
|
||||
import { filterId } from '../fixtures/mockSliceEntities';
|
||||
import { dashboardFilters } from '../fixtures/mockDashboardFilters';
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import isDashboardEmpty from '../../../../src/dashboard/util/isDashboardEmpty';
|
||||
import getEmptyLayout from '../../../../src/dashboard/util/getEmptyLayout';
|
||||
import isDashboardEmpty from 'src/dashboard/util/isDashboardEmpty';
|
||||
import getEmptyLayout from 'src/dashboard/util/getEmptyLayout';
|
||||
|
||||
describe('isDashboardEmpty', () => {
|
||||
const emptyLayout: object = getEmptyLayout();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import isValidChild from '../../../../src/dashboard/util/isValidChild';
|
||||
import isValidChild from 'src/dashboard/util/isValidChild';
|
||||
|
||||
import {
|
||||
CHART_TYPE as CHART,
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
ROW_TYPE as ROW,
|
||||
TABS_TYPE as TABS,
|
||||
TAB_TYPE as TAB,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
const getIndentation = depth =>
|
||||
Array(depth * 3)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import newComponentFactory from '../../../../src/dashboard/util/newComponentFactory';
|
||||
import newComponentFactory from 'src/dashboard/util/newComponentFactory';
|
||||
|
||||
import {
|
||||
CHART_TYPE,
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
ROW_TYPE,
|
||||
TABS_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
const types = [
|
||||
CHART_TYPE,
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import newEntitiesFromDrop from '../../../../src/dashboard/util/newEntitiesFromDrop';
|
||||
import newEntitiesFromDrop from 'src/dashboard/util/newEntitiesFromDrop';
|
||||
import {
|
||||
CHART_TYPE,
|
||||
DASHBOARD_GRID_TYPE,
|
||||
ROW_TYPE,
|
||||
TABS_TYPE,
|
||||
TAB_TYPE,
|
||||
} from '../../../../src/dashboard/util/componentTypes';
|
||||
} from 'src/dashboard/util/componentTypes';
|
||||
|
||||
describe('newEntitiesFromDrop', () => {
|
||||
it('should return a new Entity of appropriate type, and add it to the drop target children', () => {
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import updateComponentParentsList from '../../../../src/dashboard/util/updateComponentParentsList';
|
||||
import { DASHBOARD_ROOT_ID } from '../../../../src/dashboard/util/constants';
|
||||
import updateComponentParentsList from 'src/dashboard/util/updateComponentParentsList';
|
||||
import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants';
|
||||
import {
|
||||
dashboardLayout,
|
||||
dashboardLayoutWithTabs,
|
||||
|
||||
Reference in New Issue
Block a user