diff --git a/src/pages/AboutSettings.test.tsx b/src/pages/AboutSettings.test.tsx deleted file mode 100644 index 239d7161..00000000 --- a/src/pages/AboutSettings.test.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { describe, it, expect, vi, beforeEach } from 'vitest'; -import { render, screen, waitFor } from '@testing-library/react'; -import { TestApp } from '@/test/TestApp'; -import { AboutSettings } from './AboutSettings'; - -// Mock fetch -global.fetch = vi.fn(); - -describe('AboutSettings', () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it('renders about settings page with project information', () => { - render( - - - - ); - - expect(screen.getByText('About Shakespeare')).toBeInTheDocument(); - expect(screen.getByText(/Information about Shakespeare/)).toBeInTheDocument(); - expect(screen.getByText('Source Code')).toBeInTheDocument(); - expect(screen.getByText('View on GitLab')).toBeInTheDocument(); - }); - - it('fetches and displays license text', async () => { - const mockLicense = 'MIT License\n\nCopyright (c) 2024 Shakespeare'; - const mockFetch = global.fetch as ReturnType; - mockFetch.mockResolvedValueOnce({ - ok: true, - text: () => Promise.resolve(mockLicense), - } as Response); - - render( - - - - ); - - // Initially shows loading - expect(screen.getByText('Loading license...')).toBeInTheDocument(); - - // Wait for license to load - await waitFor(() => { - expect(screen.getByText(/MIT License/)).toBeInTheDocument(); - expect(screen.getByText(/Copyright \(c\) 2024 Shakespeare/)).toBeInTheDocument(); - }); - - // Verify fetch was called with correct URL - expect(global.fetch).toHaveBeenCalledWith('/LICENSE.txt'); - }); - - it('shows error when license fetch fails', async () => { - const mockFetch = global.fetch as ReturnType; - mockFetch.mockRejectedValueOnce(new Error('Network error')); - - render( - - - - ); - - // Wait for error to appear - await waitFor(() => { - expect(screen.getByText(/Failed to load license/)).toBeInTheDocument(); - }); - }); -}); \ No newline at end of file