expanding simple tab (#5032)

This commit is contained in:
Gabe Lyons
2018-05-21 16:22:40 -07:00
committed by Chris Williams
parent 0e1fb62db2
commit a746fce383
4 changed files with 54 additions and 1 deletions

View File

@@ -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);
});
});