feat(mpuniapp): 重构名片主个人中心与我的页面,达成瑞士国际主义与Bento Grid现代SaaS体验
这个提交包含在:
@@ -68,6 +68,7 @@ type UseProfileModule = {
|
||||
toggleRadarPush: (state: ProfileState, value?: boolean, storage?: StorageApi) => boolean;
|
||||
toggleLeadNotice: (state: ProfileState, value?: boolean, storage?: StorageApi) => boolean;
|
||||
setPreferredLocale: (state: ProfileState, locale: string, storage?: StorageApi) => OmniLocale;
|
||||
calculateQuotaPercent: (used: number, limit: number) => number;
|
||||
resolveProfileText: (key: string) => string;
|
||||
};
|
||||
|
||||
@@ -329,6 +330,29 @@ describe('OmniCard AI 名片主个人中心与消息通知配置 (useProfile.uts
|
||||
expect(state.account.company).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('5. 商业化配额计算与现代化 UX 词条 (calculateQuotaPercent & resolveProfileText)', () => {
|
||||
it('5.1 calculateQuotaPercent 正确计算百分比并处理极值边界', () => {
|
||||
const { calculateQuotaPercent } = loadUseProfile();
|
||||
expect(calculateQuotaPercent(0, 5)).toBe(0);
|
||||
expect(calculateQuotaPercent(2, 5)).toBe(40);
|
||||
expect(calculateQuotaPercent(5, 5)).toBe(100);
|
||||
expect(calculateQuotaPercent(6, 5)).toBe(100); // 溢出截断
|
||||
expect(calculateQuotaPercent(1, 0)).toBe(100); // 防除以0
|
||||
expect(calculateQuotaPercent(-1, 5)).toBe(0); // 负数防卫
|
||||
});
|
||||
|
||||
it('5.2 resolveProfileText 包含商业化套餐与微指标新词条', () => {
|
||||
const { resolveProfileText } = loadUseProfile();
|
||||
expect(resolveProfileText('tierPro')).toBeTruthy();
|
||||
expect(resolveProfileText('previewPortal')).toBeTruthy();
|
||||
expect(resolveProfileText('metricsCards')).toBeTruthy();
|
||||
expect(resolveProfileText('metricsVisitors')).toBeTruthy();
|
||||
expect(resolveProfileText('metricsLeads')).toBeTruthy();
|
||||
expect(resolveProfileText('upgradeQuota')).toBeTruthy();
|
||||
expect(resolveProfileText('confirmLogoutTitle')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('OmniCard AI 名片主个人中心视图契约 (index.uvue & pages.json)', () => {
|
||||
|
||||
在新工单中引用
屏蔽一个用户