diff --git a/tests/js/app.test.js b/tests/js/app.test.js index 5456a9b..2e9d647 100644 --- a/tests/js/app.test.js +++ b/tests/js/app.test.js @@ -2008,6 +2008,71 @@ describe('app.js DOMContentLoaded', () => { expect(serviceSelect.value).toBe('5') }) + it('prefill with serviceId fetch error covers catch branch', async () => { + globalThis.fetch = vi.fn(() => Promise.reject(new Error('Network error'))) + + const initialLines = JSON.stringify([ + { pos: 0, title: 'Fail line', description: '', priceHt: '10.00', type: 'esymail', serviceId: 99 } + ]) + document.body.innerHTML = ` +
+ +