From bc4431cd62acc0ad6bd149b6ef849bd062d336f1 Mon Sep 17 00:00:00 2001 From: Dennis Konkol Date: Fri, 5 Sep 2025 23:13:01 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix=20TypeScript=20test=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed response.init.status → response.status - Fixed response.init.headers → response.headers.get() - All TypeScript type checks now pass ✅ --- app/__tests__/api/fetchImage.test.tsx | 4 ++-- app/__tests__/api/sitemap.test.tsx | 2 +- app/__tests__/sitemap.xml/page.test.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/__tests__/api/fetchImage.test.tsx b/app/__tests__/api/fetchImage.test.tsx index 52620da..4af92a0 100644 --- a/app/__tests__/api/fetchImage.test.tsx +++ b/app/__tests__/api/fetchImage.test.tsx @@ -37,7 +37,7 @@ describe('GET /api/fetchImage', () => { const response = await GET(mockRequest); expect(response.body).toEqual({ error: 'Missing URL parameter' }); - expect(response.init.status).toBe(400); + expect(response.status).toBe(400); }); it('should fetch an image if URL is provided', async () => { @@ -48,6 +48,6 @@ describe('GET /api/fetchImage', () => { const response = await GET(mockRequest); expect(response.body).toBeDefined(); - expect(response.init.headers['Content-Type']).toBe('image/jpeg'); + expect(response.headers.get('Content-Type')).toBe('image/jpeg'); }); }); \ No newline at end of file diff --git a/app/__tests__/api/sitemap.test.tsx b/app/__tests__/api/sitemap.test.tsx index f97a5ed..28346d3 100644 --- a/app/__tests__/api/sitemap.test.tsx +++ b/app/__tests__/api/sitemap.test.tsx @@ -39,6 +39,6 @@ describe('GET /api/sitemap', () => { expect(response.body).toContain('https://dki.one/privacy-policy'); expect(response.body).toContain('https://dki.one/projects/just-doing-some-testing'); expect(response.body).toContain('https://dki.one/projects/blockchain-based-voting-system'); - expect(response.init.headers['Content-Type']).toBe('application/xml'); + expect(response.headers.get('Content-Type')).toBe('application/xml'); }); }); \ No newline at end of file diff --git a/app/__tests__/sitemap.xml/page.test.tsx b/app/__tests__/sitemap.xml/page.test.tsx index 7795a35..3d11e4b 100644 --- a/app/__tests__/sitemap.xml/page.test.tsx +++ b/app/__tests__/sitemap.xml/page.test.tsx @@ -39,6 +39,6 @@ describe('Sitemap Component', () => { expect(response.body).toContain('https://dki.one/privacy-policy'); expect(response.body).toContain('https://dki.one/projects/just-doing-some-testing'); expect(response.body).toContain('https://dki.one/projects/blockchain-based-voting-system'); - expect(response.init.headers['Content-Type']).toBe('application/xml'); + expect(response.headers.get('Content-Type')).toBe('application/xml'); }); }); \ No newline at end of file