diff --git a/src/__tests__/components/Footer.test.tsx b/src/__tests__/components/Footer.test.tsx new file mode 100644 index 0000000..18ab745 --- /dev/null +++ b/src/__tests__/components/Footer.test.tsx @@ -0,0 +1,144 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react'; +import '@testing-library/jest-dom'; +import Footer from '../../components/Footer'; + +// Mock des dépendances +jest.mock('@/lib/project.config', () => ({ + PROJECT_CONFIG: { + repository: { + url: 'https://github.com/example/repo' + } + } +})); + +jest.mock('@/lib/services', () => ({ + settingsService: { + getStringValue: jest.fn().mockResolvedValue('Développé avec ❤️ pour faciliter la démocratie participative - [Logiciel libre et open source](GITURL) et transparent pour tous') + } +})); + +describe('Footer', () => { + beforeEach(() => { + // Mock des variables d'environnement + process.env.NEXT_PUBLIC_SUPABASE_URL = 'https://test.supabase.co'; + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY = 'test-key'; + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('should render footer with basic content', async () => { + render(