mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
committed by
Maxime Beauchemin
parent
1d06495629
commit
efae14592e
@@ -88,4 +88,28 @@ describe('Filter', () => {
|
||||
const regexWrapper = shallow(<Filter {...props} />);
|
||||
expect(regexWrapper.find('input')).to.have.lengthOf(1);
|
||||
});
|
||||
|
||||
it('renders `input` for text filters', () => {
|
||||
const props = Object.assign({}, defaultProps);
|
||||
['>=', '>', '<=', '<'].forEach((op) => {
|
||||
props.filter = {
|
||||
col: 'col1',
|
||||
op,
|
||||
value: 'val',
|
||||
};
|
||||
wrapper = shallow(<Filter {...props} />);
|
||||
expect(wrapper.find('input')).to.have.lengthOf(1);
|
||||
});
|
||||
});
|
||||
|
||||
it('replaces null filter values with empty string in `input`', () => {
|
||||
const props = Object.assign({}, defaultProps);
|
||||
props.filter = {
|
||||
col: 'col1',
|
||||
op: '>=',
|
||||
value: null,
|
||||
};
|
||||
wrapper = shallow(<Filter {...props} />);
|
||||
expect(wrapper.find('input').props().value).to.equal('');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user