fix production favicon issue
Build & Push / Pipeline Tests (push) Successful in 1m52s
Test / Type Check (all packages) (push) Successful in 55s
Build & Push / Build & Push Docker Image (push) Successful in 4m14s
Test / API Unit Tests (push) Successful in 1m17s
Test / Homepage Unit Tests (push) Successful in 49s
Test / Carplace Unit Tests (push) Successful in 44s
Test / Admin Unit Tests (push) Successful in 43s
Test / Dashboard Unit Tests (push) Successful in 45s
Test / API Integration Tests (push) Successful in 1m11s

This commit is contained in:
root
2026-07-29 00:01:18 -04:00
parent 3c520f7a53
commit 1b3c476dd4
2 changed files with 28 additions and 0 deletions
@@ -0,0 +1,6 @@
import { NextResponse } from 'next/server';
export function GET(request: Request) {
const url = new URL('/rentaldrivego.png', request.url);
return NextResponse.redirect(url);
}
@@ -0,0 +1,22 @@
import { describe, expect, it, vi } from 'vitest';
const nextServer = vi.hoisted(() => ({
redirect: vi.fn((url: URL) => ({ kind: 'redirect', url: url.toString() })),
}));
vi.mock('next/server', () => ({
NextResponse: {
redirect: nextServer.redirect,
},
}));
describe('homepage favicon route', () => {
it('redirects root favicon requests to the existing brand icon asset', async () => {
const { GET } = await import('../../src/app/favicon.ico/route');
const response = GET(new Request('https://rentaldrivego.ma/favicon.ico'));
expect(response).toEqual({ kind: 'redirect', url: 'https://rentaldrivego.ma/rentaldrivego.png' });
expect(nextServer.redirect).toHaveBeenCalledTimes(1);
});
});