From 366766d3fc2dae6a20e928b969359f00ae588708 Mon Sep 17 00:00:00 2001 From: Mayank Singh Rawat Date: Fri, 12 Jun 2026 06:43:23 +0530 Subject: [PATCH] test: add footer theme contrast coverage --- app/components/Footer.theme-contrast.test.tsx | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 app/components/Footer.theme-contrast.test.tsx diff --git a/app/components/Footer.theme-contrast.test.tsx b/app/components/Footer.theme-contrast.test.tsx new file mode 100644 index 000000000..729bcad68 --- /dev/null +++ b/app/components/Footer.theme-contrast.test.tsx @@ -0,0 +1,114 @@ +import type { AnchorHTMLAttributes, ReactNode } from 'react'; +import { render, screen } from '@testing-library/react'; +import { describe, expect, it, vi } from 'vitest'; +import { Footer } from './Footer'; + +vi.mock('next/link', () => ({ + default: ({ + href, + children, + className, + ...props + }: { + href: string; + children: ReactNode; + className?: string; + } & AnchorHTMLAttributes) => ( + + {children} + + ), +})); + +vi.mock('@/context/TranslationContext', () => ({ + useTranslation: () => ({ + t: (key: string, values?: Record) => { + const translations: Record = { + 'footer.home': 'Home', + 'footer.generator': 'Generator', + 'footer.compare': 'Compare', + 'footer.customization': 'Customization', + 'footer.contributors': 'Contributors', + 'footer.documentation': 'Documentation', + 'footer.github_repo': 'GitHub Repo', + 'footer.github': 'GitHub', + 'footer.creator_github': 'Creator GitHub', + 'footer.discord': 'Discord', + 'footer.twitter': 'Twitter', + 'footer.linkedin': 'LinkedIn', + 'footer.tagline': 'Track your open-source journey.', + 'footer.navigation': 'Navigation', + 'footer.resources': 'Resources', + 'footer.connect': 'Connect', + 'footer.made_with': 'Made with love', + 'footer.copyright': `© ${values?.year} CommitPulse`, + }; + + return translations[key] ?? key; + }, + }), +})); + +describe('Footer theme contrast visual cohesion', () => { + it('renders footer with light theme contrast classes', () => { + render(