fix: resolve ESLint warning and silence test console output
- Replace <img> with Next.js <Image> in not-found.tsx - Add console mock in jest.setup.js to silence logs during tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9ceb8ef0d3
commit
ac8d27ae05
|
|
@ -1,6 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function NotFound() {
|
||||
|
|
@ -12,10 +13,13 @@ export default function NotFound() {
|
|||
{/* Logo and 404 */}
|
||||
<div className="mb-8">
|
||||
<div className="flex justify-center mb-8">
|
||||
<img
|
||||
<Image
|
||||
src="/logos/logo.svg"
|
||||
alt="Thé Tip Top Logo"
|
||||
width={320}
|
||||
height={100}
|
||||
className="w-64 h-auto md:w-80"
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
<div className="text-[120px] md:text-[150px] leading-none font-bold text-[#d4a574] opacity-30 select-none">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,20 @@
|
|||
// Learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
// Silence console output during tests
|
||||
const originalConsole = { ...console };
|
||||
beforeAll(() => {
|
||||
jest.spyOn(console, 'log').mockImplementation(() => {});
|
||||
jest.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
console.log = originalConsole.log;
|
||||
console.warn = originalConsole.warn;
|
||||
console.error = originalConsole.error;
|
||||
});
|
||||
|
||||
// Mock Next.js router
|
||||
jest.mock('next/navigation', () => ({
|
||||
useRouter() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user