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

@@ -22,7 +22,7 @@ describe('<QrCodeModal />', () => {
wrapper = shallow(
<QrCodeModal
shortUrl={Mock.of<ShortUrl>({ shortUrl })}
isOpen={true}
isOpen
toggle={() => {}}
selectedServer={selectedServer}
/>,
@@ -43,10 +43,10 @@ describe('<QrCodeModal />', () => {
});
it.each([
[ '2.5.0' as SemVer, 0, '/qr-code?size=300&format=png' ],
[ '2.6.0' as SemVer, 0, '/qr-code?size=300&format=png' ],
[ '2.6.0' as SemVer, 10, '/qr-code?size=300&format=png&margin=10' ],
[ '2.8.0' as SemVer, 0, '/qr-code?size=300&format=png&errorCorrection=L' ],
['2.5.0' as SemVer, 0, '/qr-code?size=300&format=png'],
['2.6.0' as SemVer, 0, '/qr-code?size=300&format=png'],
['2.6.0' as SemVer, 10, '/qr-code?size=300&format=png&margin=10'],
['2.8.0' as SemVer, 0, '/qr-code?size=300&format=png&errorCorrection=L'],
])('displays an image with the QR code of the URL', (version, margin, expectedUrl) => {
const wrapper = createWrapper(version);
const formControls = wrapper.find('.form-control-range');
@@ -66,12 +66,12 @@ describe('<QrCodeModal />', () => {
});
it.each([
[ 530, 0, 'lg' ],
[ 200, 0, undefined ],
[ 830, 0, 'xl' ],
[ 430, 80, 'lg' ],
[ 200, 50, undefined ],
[ 720, 100, 'xl' ],
[530, 0, 'lg'],
[200, 0, undefined],
[830, 0, 'xl'],
[430, 80, 'lg'],
[200, 50, undefined],
[720, 100, 'xl'],
])('renders expected size', (size, margin, modalSize) => {
const wrapper = createWrapper();
const formControls = wrapper.find('.form-control-range');
@@ -87,8 +87,8 @@ describe('<QrCodeModal />', () => {
});
it.each([
[ '2.6.0' as SemVer, 1, 'col-md-4' ],
[ '2.8.0' as SemVer, 2, 'col-md-6' ],
['2.6.0' as SemVer, 1, 'col-md-4'],
['2.8.0' as SemVer, 2, 'col-md-6'],
])('shows expected components based on server version', (version, expectedAmountOfDropdowns, expectedRangeClass) => {
const wrapper = createWrapper(version);
const dropdownsLength = wrapper.find(QrFormatDropdown).length + wrapper.find(QrErrorCorrectionDropdown).length;