// @ts-nocheck import { describe, it, expect, jest } from '@jest/globals'; import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; // ─── Mocks ─────────────────────────────────────────────────────────────── jest.mock('framer-motion', () => ({ motion: { div: ({ children, initial, animate, variants, whileInView, viewport, transition, className, ...props }: any) => (
{children}
), li: ({ children, className, ...props }: any) => (
  • {children}
  • ), }, useInView: jest.fn(() => true), AnimatePresence: ({ children }: any) => <>{children}, })); jest.mock('lucide-react', () => { const icons: Record = {}; const names = ['CheckCircle2', 'Lightbulb', 'Target', 'TrendingUp']; for (const name of names) { const Icon = (props: any) => ( ); Icon.displayName = name; icons[name] = Icon; } return icons; }); // ─── Mock Data ──────────────────────────────────────────────────────────── const mockSolution = { id: 'manufacturing', industry: '制造业', title: '智能制造解决方案', subtitle: '助力制造业数字化转型', description: '面向制造业的一站式数字化转型方案,涵盖生产、质量、设备全流程', challenges: [ '生产流程不透明,无法实时掌握车间状态', '设备利用率低,缺乏预防性维护机制', '质量管控依赖人工,缺陷率居高不下', ], solutions: [ '部署MES系统,实现生产过程透明化', '接入IoT设备传感器,构建设备健康管理平台', '引入AI质检系统,提升缺陷检测准确率', ], relatedProducts: ['erp', 'crm'], valueProposition: { headline: '让制造更智能,让管理更高效', points: [ { icon: 'trending-up', title: '效率提升', description: '生产效率提升30%,订单交付周期缩短50%' }, { icon: 'shield', title: '质量保障', description: '产品合格率提升至99%,缺陷率降低80%' }, { icon: 'zap', title: '成本优化', description: '运营成本降低25%,设备维护成本降低40%' }, ], }, suiteCombination: { primaryProducts: ['ERP系统', 'MES系统', 'WMS系统'], complementaryServices: ['数据采集与集成', '设备物联网接入', 'AI质检系统部署'], rationale: 'ERP+MES+IoT实现从订单到交付的全流程数字化,打通信息孤岛,构建智能制造底座', }, }; // ─── Tests ─────────────────────────────────────────────────────────────── describe('SolutionValueSection', () => { it('should render industry name in heading', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('制造业')).toBeInTheDocument(); expect(screen.getByText(/为.*量身定制/)).toBeInTheDocument(); }); it('should render "行业方案" label', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('行业方案')).toBeInTheDocument(); }); it('should render description', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('面向制造业的一站式数字化转型方案,涵盖生产、质量、设备全流程')).toBeInTheDocument(); }); it('should render "行业痛点挑战" section', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('行业痛点挑战')).toBeInTheDocument(); expect(screen.getByText('生产流程不透明,无法实时掌握车间状态')).toBeInTheDocument(); expect(screen.getByText('设备利用率低,缺乏预防性维护机制')).toBeInTheDocument(); }); it('should render "睿新致远解决方案" section', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('睿新致远解决方案')).toBeInTheDocument(); expect(screen.getByText('部署MES系统,实现生产过程透明化')).toBeInTheDocument(); }); it('should render value proposition section', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('价值主张')).toBeInTheDocument(); expect(screen.getByText('让制造更智能,让管理更高效')).toBeInTheDocument(); }); it('should render value proposition points', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('效率提升')).toBeInTheDocument(); expect(screen.getByText('质量保障')).toBeInTheDocument(); expect(screen.getByText('成本优化')).toBeInTheDocument(); }); it('should render "产品组合" section', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('产品组合')).toBeInTheDocument(); expect(screen.getByText('推荐搭配方案')).toBeInTheDocument(); }); it('should render suite combination products', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText('ERP系统')).toBeInTheDocument(); expect(screen.getByText('MES系统')).toBeInTheDocument(); }); it('should render combination rationale', async () => { const { SolutionValueSection } = await import('./solution-value'); render(); expect(screen.getByText(/ERP\+MES\+IoT实现从订单到交付的全流程数字化/)).toBeInTheDocument(); }); });