Update progress messages in PDF generation tests for consistency and clarity
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good

This commit modifies the progress messages in the PDF generation tests to include ellipses and exclamation marks, enhancing the clarity and consistency of the output. The changes ensure that the messages reflect a more engaging user experience during the PDF generation process. Corresponding tests have been updated to verify these modifications.
This commit is contained in:
Tom Butcher 2026-08-22 13:23:48 +01:00
parent 97c44565a8
commit 827f3b7c8c
2 changed files with 9 additions and 9 deletions

View File

@ -174,12 +174,12 @@ describe('PDF Factory', () => {
await generatePDF('<html></html>', { width: 100, height: 50, onProgress });
expect(onProgress).toHaveBeenCalledWith(0.05, 'Loading document');
expect(onProgress).toHaveBeenCalledWith(0.15, 'Paginating document');
expect(onProgress).toHaveBeenCalledWith(0.525, 'Rendering page 1 of 2');
expect(onProgress).toHaveBeenCalledWith(0.85, 'Rendering page 2 of 2');
expect(onProgress).toHaveBeenCalledWith(0.92, 'Combining pages');
expect(onProgress).toHaveBeenCalledWith(1, 'PDF generated');
expect(onProgress).toHaveBeenCalledWith(0.05, 'Loading document...');
expect(onProgress).toHaveBeenCalledWith(0.15, 'Paginating document...');
expect(onProgress).toHaveBeenCalledWith(0.525, 'Rendering page 1 of 2...');
expect(onProgress).toHaveBeenCalledWith(0.85, 'Rendering page 2 of 2...');
expect(onProgress).toHaveBeenCalledWith(0.92, 'Combining pages...');
expect(onProgress).toHaveBeenCalledWith(1, 'PDF generated!');
});
it('sends object events through the event manager when a renderRequestId is provided', async () => {
@ -198,7 +198,7 @@ describe('PDF Factory', () => {
'render',
expect.objectContaining({
type: 'render:render-123',
message: 'Loading document',
message: 'Loading document...',
})
);
expect(eventManager.sendObjectEvent).toHaveBeenCalledWith(
@ -207,7 +207,7 @@ describe('PDF Factory', () => {
expect.objectContaining({
type: 'render:render-123',
progress: 0.9,
message: 'PDF generated',
message: 'PDF generated!',
})
);
});

View File

@ -686,7 +686,7 @@ describe('TemplateManager', () => {
expect.objectContaining({
type: 'render:render-123',
progress: 1,
message: 'Render complete',
message: 'Render complete!',
})
);
});