🔧 Fix TypeScript test errors
- Fixed response.init.status → response.status
- Fixed response.init.headers → response.headers.get()
- All TypeScript type checks now pass ✅
This commit is contained in:
@@ -37,7 +37,7 @@ describe('GET /api/fetchImage', () => {
|
|||||||
const response = await GET(mockRequest);
|
const response = await GET(mockRequest);
|
||||||
|
|
||||||
expect(response.body).toEqual({ error: 'Missing URL parameter' });
|
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 () => {
|
it('should fetch an image if URL is provided', async () => {
|
||||||
@@ -48,6 +48,6 @@ describe('GET /api/fetchImage', () => {
|
|||||||
const response = await GET(mockRequest);
|
const response = await GET(mockRequest);
|
||||||
|
|
||||||
expect(response.body).toBeDefined();
|
expect(response.body).toBeDefined();
|
||||||
expect(response.init.headers['Content-Type']).toBe('image/jpeg');
|
expect(response.headers.get('Content-Type')).toBe('image/jpeg');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -39,6 +39,6 @@ describe('GET /api/sitemap', () => {
|
|||||||
expect(response.body).toContain('<loc>https://dki.one/privacy-policy</loc>');
|
expect(response.body).toContain('<loc>https://dki.one/privacy-policy</loc>');
|
||||||
expect(response.body).toContain('<loc>https://dki.one/projects/just-doing-some-testing</loc>');
|
expect(response.body).toContain('<loc>https://dki.one/projects/just-doing-some-testing</loc>');
|
||||||
expect(response.body).toContain('<loc>https://dki.one/projects/blockchain-based-voting-system</loc>');
|
expect(response.body).toContain('<loc>https://dki.one/projects/blockchain-based-voting-system</loc>');
|
||||||
expect(response.init.headers['Content-Type']).toBe('application/xml');
|
expect(response.headers.get('Content-Type')).toBe('application/xml');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -39,6 +39,6 @@ describe('Sitemap Component', () => {
|
|||||||
expect(response.body).toContain('<loc>https://dki.one/privacy-policy</loc>');
|
expect(response.body).toContain('<loc>https://dki.one/privacy-policy</loc>');
|
||||||
expect(response.body).toContain('<loc>https://dki.one/projects/just-doing-some-testing</loc>');
|
expect(response.body).toContain('<loc>https://dki.one/projects/just-doing-some-testing</loc>');
|
||||||
expect(response.body).toContain('<loc>https://dki.one/projects/blockchain-based-voting-system</loc>');
|
expect(response.body).toContain('<loc>https://dki.one/projects/blockchain-based-voting-system</loc>');
|
||||||
expect(response.init.headers['Content-Type']).toBe('application/xml');
|
expect(response.headers.get('Content-Type')).toBe('application/xml');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user