feat: connect company setup data and add about page

This commit is contained in:
2026-10-27 21:36:59 +08:00
parent f990df3023
commit 43edc632a5
8 changed files with 133 additions and 29 deletions
+4 -2
View File
@@ -242,7 +242,7 @@ test("feature grid displays configured icon text", () => {
});
test("footer renders configured navigation, contact and social fields with CMS QR URL", async () => {
const settings = { company_name: "Company", contact_phone: "123456", contact_email: "hello@example.com", address: "Address", wechat_account: "Account", weibo_url: "https://weibo.com/example", wechat_qrcode: { url: "/media/qr.png", title: "QR" } };
const settings = { company_name: "Company", contact_phone: "123456", contact_email: "hello@example.com", address: "Address", icp_number: "测试备案号", icp_url: "https://beian.miit.gov.cn/", wechat_account: "Account", weibo_url: "https://weibo.com/example", wechat_qrcode: { url: "/media/qr.png", title: "QR" } };
const { default: Footer } = loadModule("components/layout/Footer.tsx", {
"@/services/site-settings.service": { getSiteSettings: async () => settings },
"@/services/navigation.service": { getNavigationMenu: async (name) => { assert.equal(name, "footer"); return { items: [{ label: "Contact", url: "/contact", open_in_new_tab: true }] }; } },
@@ -262,6 +262,8 @@ test("footer renders configured navigation, contact and social fields with CMS Q
assert.ok(elements.some((element) => element.props?.src === "https://cms.example.com/media/qr.png"));
assert.ok(elements.some((element) => element.props?.children === settings.address));
assert.ok(elements.some((element) => element.props?.children === settings.wechat_account));
assert.ok(elements.some((element) => element.props?.href === settings.icp_url));
assert.ok(elements.some((element) => element.props?.children === settings.icp_number));
const fallback = loadModule("components/layout/Footer.tsx", {
"@/services/site-settings.service": { getSiteSettings: async () => null },
"@/services/navigation.service": { getNavigationMenu: async () => null },
@@ -269,5 +271,5 @@ test("footer renders configured navigation, contact and social fields with CMS Q
elements.length = 0;
collect(await fallback.default());
assert.ok(elements.some((element) => element.props?.href === "/privacy-policy"));
assert.ok(elements.some((element) => element.props?.children === "冀ICP备2025130506号-1"));
assert.ok(!elements.some((element) => element.props?.href === settings.icp_url));
});