import { readFileSync, existsSync } from 'fs'; import { join } from 'path'; describe('No Mock Data Tests', () => { it('should not have data.json in public folder', () => { const dataJsonPath = join(process.cwd(), 'public', 'data.json'); expect(existsSync(dataJsonPath)).toBe(false); }); it('should not have fallback to data.json in page.tsx', () => { const pagePath = join(process.cwd(), 'app', 'page.tsx'); const pageContent = readFileSync(pagePath, 'utf-8'); expect(pageContent).not.toContain('data.json'); expect(pageContent).not.toContain("'/data.json'"); expect(pageContent).toContain('API URL not configured'); }); it('should use NEXT_PUBLIC_API_URL in all components', () => { const pagePath = join(process.cwd(), 'app', 'page.tsx'); const adminPath = join(process.cwd(), 'app', 'admin', 'dashboard', 'page.tsx'); const pageContent = readFileSync(pagePath, 'utf-8'); const adminContent = readFileSync(adminPath, 'utf-8'); expect(pageContent).toContain('process.env.NEXT_PUBLIC_API_URL'); expect(adminContent).toContain('process.env.NEXT_PUBLIC_API_URL'); }); });