Updated to airbnb coding styles

This commit is contained in:
Alejandro Celaya
2022-03-26 12:17:42 +01:00
parent 4e9b19afd1
commit a2df486280
239 changed files with 2210 additions and 3549 deletions

View File

@@ -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],
},
];

View File

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

View File

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