Test fixes
This commit is contained in:
@@ -35,7 +35,10 @@ describe('shortenUrl', () => {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-API-Key': 'test-key',
|
'X-API-Key': 'test-key',
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ target: 'https://example.com' }),
|
body: JSON.stringify({
|
||||||
|
target: 'https://example.com',
|
||||||
|
domain: 'mifi.me',
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -54,6 +57,7 @@ describe('shortenUrl', () => {
|
|||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
target: 'https://example.com',
|
target: 'https://example.com',
|
||||||
|
domain: 'mifi.me',
|
||||||
customurl: 'myslug',
|
customurl: 'myslug',
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -127,14 +127,13 @@ describe('buildQrStylingOptions', () => {
|
|||||||
).toEqual(g);
|
).toEqual(g);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses imageOptions and shape from recipe', () => {
|
it('uses imageOptions from recipe (shape always square)', () => {
|
||||||
const opts = buildQrStylingOptions({
|
const opts = buildQrStylingOptions({
|
||||||
imageOptions: {
|
imageOptions: {
|
||||||
hideBackgroundDots: false,
|
hideBackgroundDots: false,
|
||||||
imageSize: 0.5,
|
imageSize: 0.5,
|
||||||
margin: 5,
|
margin: 5,
|
||||||
},
|
},
|
||||||
shape: 'circle',
|
|
||||||
});
|
});
|
||||||
expect(
|
expect(
|
||||||
(opts.imageOptions as { hideBackgroundDots: boolean })
|
(opts.imageOptions as { hideBackgroundDots: boolean })
|
||||||
@@ -144,7 +143,8 @@ describe('buildQrStylingOptions', () => {
|
|||||||
0.5,
|
0.5,
|
||||||
);
|
);
|
||||||
expect((opts.imageOptions as { margin: number }).margin).toBe(5);
|
expect((opts.imageOptions as { margin: number }).margin).toBe(5);
|
||||||
expect(opts.shape).toBe('circle');
|
// shape is always 'square' (circle has rendering issues in qr-code-styling)
|
||||||
|
expect(opts.shape).toBe('square');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user