1b3c476dd4
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
23 lines
722 B
TypeScript
23 lines
722 B
TypeScript
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);
|
|
});
|
|
});
|