mirror of
https://github.com/apache/superset.git
synced 2026-04-16 14:45:21 +00:00
expanding simple tab (#5032)
This commit is contained in:
committed by
Chris Williams
parent
0e1fb62db2
commit
a746fce383
@@ -43,15 +43,17 @@ const options = [
|
||||
|
||||
function setup(overrides) {
|
||||
const onChange = sinon.spy();
|
||||
const onHeightChange = sinon.spy();
|
||||
const props = {
|
||||
adhocFilter: simpleAdhocFilter,
|
||||
onChange,
|
||||
onHeightChange,
|
||||
options,
|
||||
datasource: {},
|
||||
...overrides,
|
||||
};
|
||||
const wrapper = shallow(<AdhocFilterEditPopoverSimpleTabContent {...props} />);
|
||||
return { wrapper, onChange };
|
||||
return { wrapper, onChange, onHeightChange };
|
||||
}
|
||||
|
||||
describe('AdhocFilterEditPopoverSimpleTabContent', () => {
|
||||
@@ -119,4 +121,15 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
|
||||
expect(wrapper.instance().isOperatorRelevant('regex')).to.be.true;
|
||||
expect(wrapper.instance().isOperatorRelevant('like')).to.be.false;
|
||||
});
|
||||
|
||||
it('expands when its multi comparator input field expands', () => {
|
||||
const { wrapper, onHeightChange } = setup();
|
||||
|
||||
wrapper.instance().multiComparatorComponent =
|
||||
{ _selectRef: { select: { control: { clientHeight: 57 } } } };
|
||||
wrapper.instance().handleMultiComparatorInputHeightChange();
|
||||
|
||||
expect(onHeightChange.calledOnce).to.be.true;
|
||||
expect(onHeightChange.lastCall.args[0]).to.equal(27);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user