Added margin option to QR code component

This commit is contained in:
Alejandro Celaya
2021-02-14 10:16:30 +01:00
parent f9da22c5a1
commit c95cb144a8
4 changed files with 66 additions and 19 deletions

View File

@@ -57,6 +57,12 @@ describe('qrCodes', () => {
{ useSizeInPath: true, svgIsSupported: true, marginIsSupported: true },
'shlink.io/qr-code/456?format=png&margin=10',
],
[
'shlink.io',
{ size: 456, format: 'png' as QrCodeFormat, margin: 0 },
{ useSizeInPath: true, svgIsSupported: true, marginIsSupported: true },
'shlink.io/qr-code/456?format=png',
],
])('builds expected URL based in params', (shortUrl, options, capabilities, expectedUrl) => {
expect(buildQrCodeUrl(shortUrl, options, capabilities)).toEqual(expectedUrl);
});