mirror of
https://github.com/apache/superset.git
synced 2026-04-09 11:25:23 +00:00
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues * [lint] fix undefined var in TimeTable.jsx
42 lines
907 B
JavaScript
42 lines
907 B
JavaScript
import { expect } from 'chai';
|
|
|
|
import componentIsResizable from '../../../../src/dashboard/util/componentIsResizable';
|
|
import {
|
|
CHART_TYPE,
|
|
COLUMN_TYPE,
|
|
DASHBOARD_GRID_TYPE,
|
|
DASHBOARD_ROOT_TYPE,
|
|
DIVIDER_TYPE,
|
|
HEADER_TYPE,
|
|
MARKDOWN_TYPE,
|
|
ROW_TYPE,
|
|
TABS_TYPE,
|
|
TAB_TYPE,
|
|
} from '../../../../src/dashboard/util/componentTypes';
|
|
|
|
const notResizable = [
|
|
DASHBOARD_GRID_TYPE,
|
|
DASHBOARD_ROOT_TYPE,
|
|
DIVIDER_TYPE,
|
|
HEADER_TYPE,
|
|
ROW_TYPE,
|
|
TABS_TYPE,
|
|
TAB_TYPE,
|
|
];
|
|
|
|
const resizable = [COLUMN_TYPE, CHART_TYPE, MARKDOWN_TYPE];
|
|
|
|
describe('componentIsResizable', () => {
|
|
resizable.forEach(type => {
|
|
it(`should return true for ${type}`, () => {
|
|
expect(componentIsResizable({ type })).to.equal(true);
|
|
});
|
|
});
|
|
|
|
notResizable.forEach(type => {
|
|
it(`should return false for ${type}`, () => {
|
|
expect(componentIsResizable({ type })).to.equal(false);
|
|
});
|
|
});
|
|
});
|