fix: show fallback ICP number in footer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -37,14 +37,14 @@ test("header reads company name and CMS navigation", async () => {
|
||||
assert.ok(!tree.some((node) => node.props?.children === "世耀科技"));
|
||||
});
|
||||
|
||||
test("footer does not invent an ICP number for an unconfigured company", async () => {
|
||||
test("footer falls back to the configured ICP number when site settings are empty", async () => {
|
||||
const { default: Footer } = loadModule("components/layout/Footer.tsx", {
|
||||
"@/services/navigation.service": { getNavigationMenu: async () => null },
|
||||
"@/services/site-settings.service": { getSiteSettings: async () => ({ company_name: "测试软件公司", icp_number: "" }) },
|
||||
});
|
||||
const tree = nodes(await Footer());
|
||||
assert.ok(!tree.some((node) => node.props?.href === "https://beian.miit.gov.cn/"));
|
||||
assert.ok(!tree.some((node) => typeof node.props?.children === "string" && node.props.children.includes("冀ICP备")));
|
||||
assert.ok(tree.some((node) => node.props?.href === "https://beian.miit.gov.cn/"));
|
||||
assert.ok(tree.some((node) => node.props?.children === "冀ICP备2025130506号-1"));
|
||||
});
|
||||
|
||||
test("about page uses CMS content, supports drafts and returns 404 when missing", async () => {
|
||||
|
||||
Reference in New Issue
Block a user