diff --git a/e2e/nav-keyboard.spec.ts b/e2e/nav-keyboard.spec.ts index 48fb1da..10462db 100644 --- a/e2e/nav-keyboard.spec.ts +++ b/e2e/nav-keyboard.spec.ts @@ -9,12 +9,20 @@ import { expectHydrated } from './hydrated'; const NAV_SELECTOR = 'nav[aria-label="主导航"]'; +// 2026-10-16:原用例把触发器标签硬编码成「产品」。决策 2 把产品退出一级导航后 +// 那个按钮不存在 ⇒ 4 条键盘用例集体判红。改用「行业」(行业轴的下拉面板是 /solutions/*, +// 与导航项自身 href 同前缀,最能顺带验证「查看全部」与面板内容同源)。 +// ⚠ 标签与面板 href 前缀必须成对改:只改标签不改 href 断言, +// 「Tab 焦点进入面板链接」那条会退化成断言一个面板里不存在的选择器。 +const DROPDOWN_LABEL = '行业'; +const PANEL_HREF_PREFIX = '/solutions/'; + function productTrigger(page: Page) { - return page.getByRole('navigation', { name: '主导航' }).getByRole('button', { name: '产品', exact: true }); + return page.getByRole('navigation', { name: '主导航' }).getByRole('button', { name: DROPDOWN_LABEL, exact: true }); } function viewAllLink(page: Page) { - return page.getByRole('link', { name: '查看全部产品' }); + return page.getByRole('link', { name: `查看全部${DROPDOWN_LABEL}` }); } async function openWithKeyboard(page: Page) { @@ -57,6 +65,7 @@ test.describe('主导航下拉的键盘可操作性', { tag: '@a11y' }, () => { // 焦点顺序实测(chromium + firefox,:3120 生产产物与 dev 目标读数一致): // 第 1 站「跳转到主要内容」跳转链接,第 2 站 logo「返回首页」,第 3 站才是本触发器。 + // (双轴改名后一级导航只剩 4 项,前三站的顺序不变,故 Tab 次数仍为 3) await page.keyboard.press('Tab'); await page.keyboard.press('Tab'); await page.keyboard.press('Tab'); @@ -71,7 +80,7 @@ test.describe('主导航下拉的键盘可操作性', { tag: '@a11y' }, () => { test.skip(browserName === 'webkit', 'WebKit 本机不响应真实 Tab 键(N-27,见上方注释)'); await openWithKeyboard(page); await page.keyboard.press('Tab'); - await expect(page.locator(`${NAV_SELECTOR} a[href^="/products/"]:focus`)).toHaveCount(1); + await expect(page.locator(`${NAV_SELECTOR} a[href^="${PANEL_HREF_PREFIX}"]:focus`)).toHaveCount(1); }); test('Escape 关闭面板并把焦点还给触发器', async ({ page }) => { @@ -98,9 +107,15 @@ test.describe('主导航下拉的键盘可操作性', { tag: '@a11y' }, () => { // 修法是把导航项自身 href 传进去(props.viewAllHref)。 // 下面这条是它的**浏览器层负对照**:单测已锁住组件契约,但「header 有没有真的把 href 传下来」 // 只有在真实渲染里才看得见 —— 少传一个 prop,单测全绿而线上静默退化。 +// 2026-10-16 双轴改名后的预期表。 +// ⚠ 这张表是**故意硬编码**的:它同时是「导航标签」「下拉存在」与「查看全部落点」三件事的 +// 交叉对账。测试里另有一条 `expect(count).toBe(Object.keys(...).length)`, +// 所以新增一个带下拉的导航项而忘了登记 ⇒ 分母守卫判红,不会"少测一个"静默放行。 +// 「产品」不再是下拉项(决策 2:产品退出一级导航),它的矩阵活在能力轴里。 const VIEW_ALL_EXPECTED: Record = { - 产品: '/products', - 解决方案: '/solutions', + 行业: '/solutions', + 能力: '/services', + 洞察: '/insights', }; test.describe('主导航「查看全部」的目的地', { tag: '@a11y' }, () => { diff --git a/e2e/user-journey.spec.ts b/e2e/user-journey.spec.ts index b7634b2..6fb4e29 100644 --- a/e2e/user-journey.spec.ts +++ b/e2e/user-journey.spec.ts @@ -36,9 +36,12 @@ async function closeCookieBanner(page: Page) { /** * 从桌面主导航的产品下拉菜单中导航到指定链接 */ -async function navigateFromProductDropdown(page: Page, linkText: string) { +// 2026-10-16 改名并泛化:一级导航不再有「产品」(决策 2),/products 的入口降级为 +// 能力轴第二层的「产品矩阵总览」。原来的 helper 硬编码 button:has-text("产品"), +// 改名后它会稳定判红 —— 这是**好事**:它证明这条旅程真的在走导航,而不是在假装。 +async function navigateFromDropdown(page: Page, dropdownLabel: string, linkText: string) { const desktopNav = page.locator('[data-testid="desktop-navigation"]').first(); - const productDropdown = desktopNav.locator('button:has-text("产品")').first(); + const productDropdown = desktopNav.locator(`button:has-text("${dropdownLabel}")`).first(); await expect(productDropdown).toBeVisible({ timeout: 5000 }); await productDropdown.hover(); await page.waitForTimeout(300); @@ -71,7 +74,7 @@ test.describe('UJ-01: 潜在客户从首页到联系表单的完整旅程', () = await expect(heroDescription).toBeVisible(); // === Step 2: 通过导航下拉菜单进入产品页面 === - await navigateFromProductDropdown(page, '查看全部产品'); + await navigateFromDropdown(page, '能力', '产品矩阵总览'); // === Step 3: 验证产品页面加载成功 === await page.waitForURL(/\/products/, { timeout: 10000 }); diff --git a/scripts/utils/check-heading-hierarchy.ts b/scripts/utils/check-heading-hierarchy.ts index 5ba630a..1c3efd7 100644 --- a/scripts/utils/check-heading-hierarchy.ts +++ b/scripts/utils/check-heading-hierarchy.ts @@ -25,6 +25,8 @@ const PAGES = [ { path: "/services", name: "服务列表" }, { path: "/services/software", name: "服务详情-软件开发" }, { path: "/news", name: "新闻列表" }, + // 双轴新增的洞察枢纽 —— 不登记就会出现「新页面没人扫,门禁仍然绿」的静默覆盖收缩 + { path: "/insights", name: "洞察枢纽" }, { path: "/contact", name: "联系我们" }, ]; diff --git a/src/app/(marketing)/insights/insights-content.test.tsx b/src/app/(marketing)/insights/insights-content.test.tsx new file mode 100644 index 0000000..56bb6e6 --- /dev/null +++ b/src/app/(marketing)/insights/insights-content.test.tsx @@ -0,0 +1,59 @@ +/** + * 洞察枢纽的两条诚实性约束(都能失败,不是给实现打气): + * 1. 筛选器只列**真的有内容**的分类 —— 本仓此前把 案例(0 行) 挂在一级导航上, + * 这条就是防它在新页面上重演。 + * 2. 0 条目必须落在"看得见的空态",而不是渲染一个空网格装作有内容。 + */ +import { describe, it, expect, jest } from '@jest/globals'; +import { render, screen, fireEvent } from '@testing-library/react'; +import '@testing-library/jest-dom'; +import InsightsContent, { type InsightEntry } from './insights-content'; + +jest.mock('@/components/ui/static-link', () => ({ + StaticLink: ({ children, href, ...rest }: { children: React.ReactNode; href: string; [k: string]: unknown }) => ( + {children} + ), +})); +jest.mock('@/components/ui/scroll-reveal', () => ({ + ScrollReveal: ({ children }: { children: React.ReactNode }) =>
{children}
, + StaggerReveal: ({ children }: { children: React.ReactNode }) =>
{children}
, +})); +jest.mock('@/components/ui/cta-button', () => ({ + CTAButton: ({ children, href }: { children: React.ReactNode; href: string }) => ( + {children} + ), +})); + +const METH: InsightEntry = { id: 'm1', kind: 'methodology', title: '四步诊断法', excerpt: '从业务目标出发', date: '', href: '/methodology' }; +const WRITING: InsightEntry = { id: 'w1', kind: 'writing', title: '私有化部署', excerpt: '数据主权', date: '2026-08', href: '/news/1' }; + +describe('洞察筛选器的分母纪律', () => { + it('案例 0 行时,「客户成果」这个 tab 不允许出现', () => { + render(); + expect(screen.queryByRole('tab', { name: '客户成果' })).not.toBeInTheDocument(); + expect(screen.getByRole('tab', { name: '方法论' })).toBeInTheDocument(); + expect(screen.getByRole('tab', { name: '技术与观点' })).toBeInTheDocument(); + }); + + it('case-study 一旦出数,「客户成果」tab 自动出现(插槽真的能插,不是空话)', () => { + const real: InsightEntry = { + id: 'c1', kind: 'case', title: '某制造企业库存周转', excerpt: '', date: '2026-09', + href: '/cases/x', industry: '制造业', + }; + render(); + expect(screen.getByRole('tab', { name: '客户成果' })).toBeInTheDocument(); + }); + + it('完全无内容 ⇒ 走空态而不是空网格', () => { + render(); + expect(screen.getByTestId('insights-empty')).toBeInTheDocument(); + expect(screen.queryAllByTestId(/^insight-card-/)).toHaveLength(0); + }); + + it('点「方法论」后只留方法论条目(过滤真的生效,不是只改了按钮态)', () => { + render(); + fireEvent.click(screen.getByRole('tab', { name: '方法论' })); + expect(screen.getAllByTestId('insight-card-methodology')).toHaveLength(1); + expect(screen.queryAllByTestId('insight-card-writing')).toHaveLength(0); + }); +}); diff --git a/src/app/(marketing)/insights/insights-content.tsx b/src/app/(marketing)/insights/insights-content.tsx new file mode 100644 index 0000000..4cf99e9 --- /dev/null +++ b/src/app/(marketing)/insights/insights-content.tsx @@ -0,0 +1,177 @@ +'use client'; + +import { useMemo, useState } from 'react'; +import { StaticLink } from '@/components/ui/static-link'; +import { ScrollReveal } from '@/components/ui/scroll-reveal'; +import { CTAButton } from '@/components/ui/cta-button'; +import { COMPANY_INFO } from '@/lib/constants'; +import { cn } from '@/lib/utils'; +import { ArrowRight } from 'lucide-react'; + +export type InsightKind = 'methodology' | 'case' | 'writing'; + +export interface InsightEntry { + id: string; + kind: InsightKind; + title: string; + excerpt: string; + /** ISO 或 'YYYY-MM';方法论这类"页面型"条目没有日期,留空 */ + date: string; + href: string; + industry?: string; +} + +const KIND_LABEL: Record = { + methodology: '方法论', + case: '客户成果', + writing: '技术与观点', +}; + +/** + * 洞察枢纽 —— 对标 Bain「Our Latest Insights」/ Porsche「In Focus: News & Trends」。 + * + * 语法取自实测:零圆角(bain-card 现 --radius-lg = 2px)、近单色、 + * 卡片 hover 只改边框与底色(不抬升、不加阴影),成果类数字本轮不出现—— + * 因为 case-study 模型是 0 行,任何数字都得编。 + * + * 诚实性约束(可失败,见 insights-content.test.tsx): + * 1. 筛选器只列**真的有内容**的 kind。案例 0 行 ⇒ 不给「客户成果」这个 tab, + * 否则就是挂一个点开为空的频道(本仓此前 /cases 正是这样挂在一级导航上的)。 + * 2. 0 条目时的空态必须是"看得见的空态",不拿模板文案冒充内容。 + */ +export default function InsightsContent({ entries }: { entries: InsightEntry[] }) { + const presentKinds = useMemo( + () => (['methodology', 'case', 'writing'] as InsightKind[]).filter((k) => entries.some((e) => e.kind === k)), + [entries], + ); + const [active, setActive] = useState<'all' | InsightKind>('all'); + + const visible = active === 'all' ? entries : entries.filter((e) => e.kind === active); + + return ( +
+ {/* L1 —— 结论式主张,不是口号 */} +
+
+ +

洞察

+

+ 我们怎么判断、怎么交付、怎么验收 +

+

+ {COMPANY_INFO.displayName}的公开写作与方法论。凡涉及效果的数字,都会标明它是 + 目标口径、 + 团队历史还是 + 已验证结果。 +

+
+
+
+ + {/* 列表 */} +
+
+
+

全部内容

+ {/* 筛选器只列有内容的 kind:这是「不给空频道挂入口」那条约束的实现处 */} +
+ setActive('all')} /> + {presentKinds.map((k) => ( + setActive(k)} + /> + ))} +
+
+ + {visible.length === 0 ? ( + /* 空态必须是"看得见的空态" —— 不拿模板文案冒充内容 */ +
+

+ 这一类目前还没有已发布的内容。 +
+ 客户成果要等真实项目获得对外授权后才会出现在这里。 +

+
+ ) : ( +
    + {visible.map((entry) => ( +
  • + +
    + {KIND_LABEL[entry.kind]} + {entry.industry && ( + · {entry.industry} + )} + {entry.date && ( + {entry.date} + )} +
    +

    {entry.title}

    + {entry.excerpt && ( +

    {entry.excerpt}

    + )} + + 阅读 + +
    +
  • + ))} +
+ )} +
+
+ + {/* L4 CTA */} +
+
+

有具体场景想聊?

+

+ 把你的问题带来,我们先给判断,再谈方案。 +

+
+ 预约咨询 + + 查看能力组 + +
+
+
+
+ ); +} + +function FilterTab({ + label, + activeState, + onClick, +}: { + label: string; + activeState: boolean; + onClick: () => void; +}) { + return ( + + ); +} diff --git a/src/app/(marketing)/insights/page.tsx b/src/app/(marketing)/insights/page.tsx new file mode 100644 index 0000000..4351a18 --- /dev/null +++ b/src/app/(marketing)/insights/page.tsx @@ -0,0 +1,75 @@ +import { Metadata } from 'next'; +import { COMPANY_INFO } from '@/lib/constants'; +import { getPublishedItems } from '@/lib/cms/data-server'; +import type { NewsItem } from '@/lib/constants/news'; +import InsightsContent, { type InsightEntry } from './insights-content'; + +export const metadata: Metadata = { + title: `洞察 - ${COMPANY_INFO.displayName}`, + description: `${COMPANY_INFO.displayName}的方法论、技术与观点:数字化转型怎么判断、怎么交付、怎么验收。`, +}; + +// ISR 与 /news 同档;CMS 发布经 /api/cms/revalidate 主动刷新。 +// ⚠ 新路由必须同步进 revalidate 的路径表与 check:headings 的 PAGES, +// 否则「全站扫描」的分母会静默变小而门禁仍然绿。 +export const revalidate = 3600; + +/** 洞察条目 kind:news 分类沿用既有 taxonomy,方法论与案例是另外两路真源 */ +async function buildEntries(): Promise { + const [newsItems, caseItems, methodologyItems] = await Promise.all([ + getPublishedItems('news').catch(() => []), + getPublishedItems('case-study').catch(() => []), + getPublishedItems('methodology').catch(() => []), + ]); + + const news: InsightEntry[] = newsItems.map((item) => { + const data = item.data as unknown as NewsItem; + return { + id: `news-${data.id || item.slug}`, + kind: 'writing' as const, + title: data.title || item.title, + excerpt: data.excerpt || '', + date: data.date || '', + href: `/news/${data.id || item.slug}`, + }; + }); + + // 方法论:/methodology 是一个 4 阶段的页面型模型(1 行),不是逐篇内容 + const methodology: InsightEntry[] = methodologyItems.map((item) => { + const data = item.data as { title?: string; description?: string; summary?: string }; + return { + id: `methodology-${item.slug}`, + kind: 'methodology' as const, + title: data.title || item.title, + excerpt: data.description || data.summary || '', + date: '', + href: '/methodology', + }; + }); + + /** + * 案例:**当前恒为空数组**,因为 case-study 模型 0 行 + * (prisma/seeds/case-studies.ts:11 明示「首批客户共创阶段,暂无对外可验证的客户案例」)。 + * 零编造原则下这里不造任何条目;真实授权案例落库的当天,下面的 map 就开始出数, + * 前端不需要再改一行 —— 这就是「留结构化插槽」的实际含义。 + */ + const cases: InsightEntry[] = caseItems.map((item) => { + const data = item.data as { title?: string; excerpt?: string; industry?: string; publishedAt?: string }; + return { + id: `case-${item.slug}`, + kind: 'case' as const, + title: data.title || item.title, + excerpt: data.excerpt || '', + date: data.publishedAt || '', + industry: data.industry, + href: `/cases/${item.slug}`, + }; + }); + + return [...methodology, ...cases, ...news].sort((a, b) => (b.date || '').localeCompare(a.date || '')); +} + +export default async function InsightsPage() { + const entries = await buildEntries(); + return ; +} diff --git a/src/app/api/cms/revalidate/route.test.ts b/src/app/api/cms/revalidate/route.test.ts index 5e9a8ba..d212e9e 100644 --- a/src/app/api/cms/revalidate/route.test.ts +++ b/src/app/api/cms/revalidate/route.test.ts @@ -287,3 +287,34 @@ describe('POST /api/cms/revalidate', () => { expect(body.data.revalidatedPaths).toContain('/products/erp-upgrade'); }); }); + +// ── 洞察枢纽的失效映射(2026-10-16 双轴改造新增路由)────────────────────── +// /insights 不在 CONTENT_TYPE_CONFIGS 的任何 listPage 里 ⇒ 通用推导只会刷 /news、 +// /methodology。少登记这一条的后果不是报错,而是**后台发了新内容、洞察页仍端出旧 +// ISR 快照,最长 1 小时,且没有任何门禁会红**。所以正反两向都要钉住。 +describe('POST /api/cms/revalidate —— /insights 失效映射', () => { + it.each(['news', 'case-study', 'methodology'])( + '%s 变更必须同时刷 /insights', + async (modelCode) => { + const response = await POST(createMockRequest({ modelCode })); + const body = await response.json(); + + expect(response.status).toBe(200); + expect(mockRevalidatePath).toHaveBeenCalledWith('/insights'); + expect(body.data.revalidatedPaths).toContain('/insights'); + }, + ); + + // 负对照:映射不能宽到「什么都刷」——那会让这条断言恒真、失去约束力 + it('product 变更不该刷 /insights(洞察轴不读 product 模型)', async () => { + const response = await POST(createMockRequest({ modelCode: 'product', slug: 'erp' })); + expect(response.status).toBe(200); + expect(mockRevalidatePath).not.toHaveBeenCalledWith('/insights'); + }); + + it('同一 modelCode 重复调用只刷一次 /insights(去重仍成立)', async () => { + await POST(createMockRequest({ modelCode: 'news', slug: 'a' })); + const calls = mockRevalidatePath.mock.calls.filter((c) => c[0] === '/insights'); + expect(calls).toHaveLength(1); + }); +}); diff --git a/src/app/api/cms/revalidate/route.ts b/src/app/api/cms/revalidate/route.ts index 0202ba6..87b12cc 100644 --- a/src/app/api/cms/revalidate/route.ts +++ b/src/app/api/cms/revalidate/route.ts @@ -20,6 +20,12 @@ const HOME_AFFECTED_MODELS = new Set([ 'news', ]); +// 洞察枢纽 /insights 的数据来自三路真源:news(技术与观点)、case-study(客户成果,当前 0 行)、 +// methodology(方法论)。它**不在** CONTENT_TYPE_CONFIGS 的任何 listPage 里 —— +// 通用推导只会刷 /news、/methodology,于是后台发了新内容而 /insights 仍端出旧 ISR 快照, +// 最长 1 小时不可见,且没有任何门禁会红。新路由必须显式登记失效映射。 +const INSIGHTS_AFFECTED_MODELS = new Set(['news', 'case-study', 'methodology']); + interface RevalidateRequestBody { event?: string; modelCode?: string; @@ -122,6 +128,15 @@ export async function POST(request: NextRequest) { revalidatedPaths.push('/products/erp-upgrade'); } + // 洞察枢纽:三个上游模型任一变更都要刷 /insights + if ( + INSIGHTS_AFFECTED_MODELS.has(body.modelCode) && + !revalidatedPaths.includes('/insights') + ) { + revalidatePath('/insights'); + revalidatedPaths.push('/insights'); + } + // 首页相关模型变更时同步刷新 / if (HOME_AFFECTED_MODELS.has(body.modelCode) && !revalidatedPaths.includes('/')) { revalidatePath('/'); diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 80be67c..8bfdc66 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -16,9 +16,9 @@ import { MotionProvider } from "@/components/ui/motion-provider"; import { BackToTop } from "@/components/ui/back-to-top"; import { ClientLayout } from "@/components/layout/client-layout"; import { getPublishedItems } from "@/lib/cms/data-server"; -import { SiteConfigProvider, type SiteConfig, type NavigationItem, type MegaDropdownGroup, type MegaDropdownItem } from "@/lib/site-config"; +import { SiteConfigProvider, type SiteConfig, type NavigationItem, type MegaDropdownItem } from "@/lib/site-config"; import { COMPANY_INFO, BRAND_NARRATIVE, type BrandPillar } from "@/lib/constants/company"; -import { NAVIGATION_V2, MEGA_DROPDOWN_DATA } from "@/lib/constants/navigation"; +import { resolveNavigation, injectStandaloneProducts } from "@/lib/navigation-resolution"; /** * 拉丁字形使用 Geist(本地 woff2,无网络请求); @@ -127,21 +127,18 @@ export default async function RootLayout({ }; }); - // Build megaDropdown with standalone products dynamically injected - const baseMegaDropdown = (navData?.megaDropdown as Record) || MEGA_DROPDOWN_DATA; - const megaDropdown: Record = {}; - for (const [key, groups] of Object.entries(baseMegaDropdown)) { - if (key === 'products' && standaloneNavItems.length > 0) { - megaDropdown[key] = groups.map((group) => { - if (group.id === 'standalone-products') { - return { ...group, description: undefined, items: standaloneNavItems }; - } - return group; - }); - } else { - megaDropdown[key] = groups; - } + // 导航解析:**代码为真源,CMS 仅在完整自洽时覆盖**。 + // 原写法是 `(navData?.mainNav as ...) || NAVIGATION_V2` —— DB 行胜出、代码只兜底, + // 于是「只改 navigation.ts 会上线一个生产静默忽略它的新导航」。详见 lib/navigation-resolution.ts。 + const nav = resolveNavigation(navData); + if (nav.issues.length > 0) { + // 渲染期不写库(Notification 是后台数据,在 RSC 里写它等于给每次首页渲染挂写副作用), + // 但「为什么没用后台配置」必须可见,否则 fail-closed 会被读成"后台改了没反应"的玄学。 + console.warn('[navigation] 退回代码真源:\n ' + nav.issues.join('\n ')); } + // 独立产品按**组 id** 注入(原实现按 key==='products' 匹配,双轴改名后该 key 已不存在, + // 沿用会静默丢失这一组:面板照样渲染,只是少了它)。 + const megaDropdown = injectStandaloneProducts(nav.megaDropdown, standaloneNavItems); const siteConfig: SiteConfig = { name: (configData?.name as string) || COMPANY_INFO.name, @@ -160,7 +157,7 @@ export default async function RootLayout({ address: (configData?.address as string) || COMPANY_INFO.address, icp: (configData?.icp as string) || COMPANY_INFO.icp, police: (configData?.police as string) || COMPANY_INFO.police, - mainNav: (navData?.mainNav as NavigationItem[]) || NAVIGATION_V2, + mainNav: nav.mainNav as unknown as NavigationItem[], megaDropdown, }; diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index a2a6849..2b58c0b 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -17,6 +17,9 @@ export default async function sitemap(): Promise { // 案例列表页:数据库 case-study 暂无已发布内容,空列表页不收录(页面保留,待产品补数据后恢复)。 // { url: `${BASE_URL}/cases`, lastModified: new Date(), changeFrequency: 'weekly', priority: 0.8 }, { url: `${BASE_URL}/news`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.7 }, + // 洞察枢纽(双轴改造新增):聚合 news + methodology + case-study。 + // /news 暂留(已被索引、且 2 条内容仍在贡献长尾),第二批用 301 归并 —— 见计划 §11 待拍 #3。 + { url: `${BASE_URL}/insights`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.8 }, { url: `${BASE_URL}/team`, lastModified: new Date(), changeFrequency: 'monthly', priority: 0.6 }, { url: `${BASE_URL}/methodology`, lastModified: new Date(), changeFrequency: 'monthly', priority: 0.6 }, { url: `${BASE_URL}/contact`, lastModified: new Date(), changeFrequency: 'monthly', priority: 0.7 }, diff --git a/src/components/layout/footer.test.tsx b/src/components/layout/footer.test.tsx index 01d0158..2cc41f4 100644 --- a/src/components/layout/footer.test.tsx +++ b/src/components/layout/footer.test.tsx @@ -43,35 +43,40 @@ jest.mock('@/lib/site-config', () => ({ icp: '蜀ICP备XXXXXXXX号', police: '川公网安备XXXXXXXXXXX号', megaDropdown: { - products: [ + industries: [ { - id: 'group1', - title: '企业套装', - items: [ - { id: 'erp', title: 'ERP 管理系统', description: '财务·采购·销售·库存·生产', href: '/products/erp' }, - { id: 'crm', title: 'CRM 客户管理', description: '线索·商机·合同·服务', href: '/products/crm' }, - ], - }, - ], - solutions: [ - { - id: 'group1', - title: '行业解决方案', + id: 'industry-solutions', + title: '行业实践', items: [ { id: 'manufacturing', title: '制造业', description: '智能制造·MES·质量管控', href: '/solutions/manufacturing' }, { id: 'retail', title: '零售业', description: '全渠道·会员·精准营销', href: '/solutions/retail' }, ], }, ], - services: [ + capabilities: [ { - id: 'professional-services', - title: '专业服务', + id: 'capability-groups', + title: '能力组', items: [ { id: 'consulting', title: '战略咨询', description: '数字化转型咨询规划', href: '/services/consulting' }, { id: 'software', title: '企业软件', description: 'ERP/CRM/BI 系统实施', href: '/services/software' }, ], }, + { + id: 'enterprise-suite', + title: '产品矩阵', + items: [ + { id: 'erp', title: 'ERP 管理系统', description: '财务·采购·销售·库存·生产', href: '/products/erp' }, + { id: 'crm', title: 'CRM 客户管理', description: '线索·商机·合同·服务', href: '/products/crm' }, + ], + }, + ], + insights: [ + { + id: 'insight-groups', + title: '洞察', + items: [{ id: 'all', title: '全部洞察', description: '', href: '/insights' }], + }, ], }, }), @@ -90,6 +95,8 @@ jest.mock('@/lib/constants', () => ({ icp: '蜀ICP备XXXXXXXX号', police: '川公网安备XXXXXXXXXXX号', }, + MEGA_KEYS: { industries: 'industries', capabilities: 'capabilities', insights: 'insights' }, + STANDALONE_GROUP_ID: 'standalone-products', MEGA_DROPDOWN_DATA: { products: [ { @@ -140,12 +147,12 @@ describe('Footer', () => { it('should render products section', () => { render(