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
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
/* eslint-disable no-unused-expressions */
|
|
import React from 'react';
|
|
import { expect } from 'chai';
|
|
import { shallow } from 'enzyme';
|
|
import { OverlayTrigger } from 'react-bootstrap';
|
|
|
|
import FixedOrMetricControl from
|
|
'../../../../src/explore/components/controls/FixedOrMetricControl';
|
|
import SelectControl from
|
|
'../../../../src/explore/components/controls/SelectControl';
|
|
import TextControl from
|
|
'../../../../src/explore/components/controls/TextControl';
|
|
import ControlHeader from '../../../../src/explore/components/ControlHeader';
|
|
|
|
const defaultProps = {
|
|
value: { },
|
|
};
|
|
|
|
describe('FixedOrMetricControl', () => {
|
|
let wrapper;
|
|
let inst;
|
|
beforeEach(() => {
|
|
wrapper = shallow(<FixedOrMetricControl {...defaultProps} />);
|
|
inst = wrapper.instance();
|
|
});
|
|
|
|
it('renders a OverlayTrigger', () => {
|
|
const controlHeader = wrapper.find(ControlHeader);
|
|
expect(controlHeader).to.have.lengthOf(1);
|
|
expect(wrapper.find(OverlayTrigger)).to.have.length(1);
|
|
});
|
|
|
|
it('renders a TextControl and a SelectControl', () => {
|
|
const popOver = shallow(inst.renderPopover());
|
|
expect(popOver.find(TextControl)).to.have.lengthOf(1);
|
|
expect(popOver.find(SelectControl)).to.have.lengthOf(1);
|
|
});
|
|
});
|