mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-20 21:46:20 +00:00
Ensured filter for bots does not show for Shlink older than 2.7.0
This commit is contained in:
@@ -8,7 +8,12 @@ describe('<VisitsFilterDropdown />', () => {
|
||||
const onChange = jest.fn();
|
||||
const createWrapper = (selected: VisitsFilter = {}, isOrphanVisits = true) => {
|
||||
wrapper = shallow(
|
||||
<VisitsFilterDropdown isOrphanVisits={isOrphanVisits} selected={selected} onChange={onChange} />,
|
||||
<VisitsFilterDropdown
|
||||
isOrphanVisits={isOrphanVisits}
|
||||
botsSupported={true}
|
||||
selected={selected}
|
||||
onChange={onChange}
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
@@ -68,4 +73,17 @@ describe('<VisitsFilterDropdown />', () => {
|
||||
|
||||
expect(onChange).toHaveBeenCalledWith(expectedSelection);
|
||||
});
|
||||
|
||||
it('does not render the component when neither orphan visits or bots filtering will be displayed', () => {
|
||||
const wrapper = shallow(
|
||||
<VisitsFilterDropdown
|
||||
isOrphanVisits={false}
|
||||
botsSupported={false}
|
||||
selected={{}}
|
||||
onChange={onChange}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(wrapper.text()).toEqual('');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user