Update PDF generation height calculation and corresponding test value
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit modifies the height calculation in the PDF generation function to increase the height by 2 pixels when the height option is set to 'auto'. Additionally, the related test has been updated to reflect this change, ensuring that the expected height value is now 122px instead of 121px. These adjustments improve the accuracy of the PDF rendering process.
This commit is contained in:
parent
0b94774443
commit
322a086040
@ -94,7 +94,7 @@ describe('PDF Factory', () => {
|
||||
expect(page.pdf).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
width: '80mm',
|
||||
height: '121px',
|
||||
height: '122px',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@ -129,7 +129,7 @@ export async function generatePDF(html, options = {}) {
|
||||
printBackground: true,
|
||||
preferCSSPageSize: true,
|
||||
width: options.width ? `${options.width}mm` : undefined,
|
||||
height: height ? (options.height == 'auto' ? `${height + 1}px` : `${height}mm`) : undefined,
|
||||
height: height ? (options.height == 'auto' ? `${height + 2}px` : `${height}mm`) : undefined,
|
||||
margin: {
|
||||
top: '0mm',
|
||||
right: '0mm',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user