mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-12 02:23:49 +00:00
Updated to airbnb coding styles
This commit is contained in:
@@ -17,12 +17,12 @@ describe('<MapModal />', () => {
|
||||
{
|
||||
cityName: 'Zaragoza',
|
||||
count: 54,
|
||||
latLong: [ zaragozaLat, zaragozaLong ],
|
||||
latLong: [zaragozaLat, zaragozaLong],
|
||||
},
|
||||
{
|
||||
cityName: 'New York',
|
||||
count: 7,
|
||||
latLong: [ newYorkLat, newYorkLong ],
|
||||
latLong: [newYorkLat, newYorkLong],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('<OpenMapModalBtn />', () => {
|
||||
});
|
||||
|
||||
it('opens dropdown instead of modal when a list of active cities has been provided', () => {
|
||||
const wrapper = createWrapper([ 'bar' ]);
|
||||
const wrapper = createWrapper(['bar']);
|
||||
|
||||
wrapper.find('.open-map-modal-btn__btn').simulate('click');
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('<OpenMapModalBtn />', () => {
|
||||
});
|
||||
|
||||
it('filters out non-active cities from list of locations', () => {
|
||||
const wrapper = createWrapper([ 'bar' ]);
|
||||
const wrapper = createWrapper(['bar']);
|
||||
|
||||
wrapper.find('.open-map-modal-btn__btn').simulate('click');
|
||||
wrapper.find(Dropdown).find(DropdownItem).at(1).simulate('click');
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('<VisitsFilterDropdown />', () => {
|
||||
wrapper = shallow(
|
||||
<VisitsFilterDropdown
|
||||
isOrphanVisits={isOrphanVisits}
|
||||
botsSupported={true}
|
||||
botsSupported
|
||||
selected={selected}
|
||||
onChange={onChange}
|
||||
/>,
|
||||
@@ -29,8 +29,8 @@ describe('<VisitsFilterDropdown />', () => {
|
||||
});
|
||||
|
||||
it.each([
|
||||
[ false, 4, 1 ],
|
||||
[ true, 9, 2 ],
|
||||
[false, 4, 1],
|
||||
[true, 9, 2],
|
||||
])('renders expected amount of items', (isOrphanVisits, expectedItemsAmount, expectedHeadersAmount) => {
|
||||
const wrapper = createWrapper({}, isOrphanVisits);
|
||||
const items = wrapper.find(DropdownItem);
|
||||
@@ -41,10 +41,10 @@ describe('<VisitsFilterDropdown />', () => {
|
||||
});
|
||||
|
||||
it.each([
|
||||
[ 'base_url' as OrphanVisitType, 4, 1 ],
|
||||
[ 'invalid_short_url' as OrphanVisitType, 5, 1 ],
|
||||
[ 'regular_404' as OrphanVisitType, 6, 1 ],
|
||||
[ undefined, -1, 0 ],
|
||||
['base_url' as OrphanVisitType, 4, 1],
|
||||
['invalid_short_url' as OrphanVisitType, 5, 1],
|
||||
['regular_404' as OrphanVisitType, 6, 1],
|
||||
[undefined, -1, 0],
|
||||
])('sets expected item as active', (orphanVisitsType, expectedSelectedIndex, expectedActiveItems) => {
|
||||
const wrapper = createWrapper({ orphanVisitsType });
|
||||
const items = wrapper.find(DropdownItem);
|
||||
@@ -60,11 +60,11 @@ describe('<VisitsFilterDropdown />', () => {
|
||||
});
|
||||
|
||||
it.each([
|
||||
[ 1, { excludeBots: true }],
|
||||
[ 4, { orphanVisitsType: 'base_url' }],
|
||||
[ 5, { orphanVisitsType: 'invalid_short_url' }],
|
||||
[ 6, { orphanVisitsType: 'regular_404' }],
|
||||
[ 8, {}],
|
||||
[1, { excludeBots: true }],
|
||||
[4, { orphanVisitsType: 'base_url' }],
|
||||
[5, { orphanVisitsType: 'invalid_short_url' }],
|
||||
[6, { orphanVisitsType: 'regular_404' }],
|
||||
[8, {}],
|
||||
])('invokes onChange with proper selection when an item is clicked', (index, expectedSelection) => {
|
||||
const wrapper = createWrapper();
|
||||
const itemToClick = wrapper.find(DropdownItem).at(index);
|
||||
|
||||
Reference in New Issue
Block a user