等待后端更新接口

This commit is contained in:
2026-08-03 16:49:26 +08:00
parent ac5823547a
commit 5b79893650
131 changed files with 5324 additions and 1392 deletions
+33 -2
View File
@@ -119,6 +119,8 @@ test('家谱主页只把缺失登录态和 401 视为登录失效', () => {
assert.equal(FamilyHomePages.shouldRedirectToLogin({
getToken() { return ''; }
}), true);
assert.equal(FamilyHomePages.isForbidden({ status: 403 }), true);
assert.equal(FamilyHomePages.isForbidden({ status: 401 }), false);
});
test('家谱主页只读取当前家谱概览和世系树', async () => {
@@ -152,30 +154,57 @@ test('家谱主页只读取当前家谱概览和世系树', async () => {
assert.deepEqual(result.tree, tree);
});
test('家谱主页开放真实只读概览且不制造邀请或聚合统计入口', () => {
test('家谱主页以 PC 工作台分组开放已接入功能且不制造旧 APP 伪功能', () => {
const source = fs.readFileSync(path.join(root, 'profile-family-home.html'), 'utf8');
const script = fs.readFileSync(path.join(root, 'public', 'js', 'family-home-pages.js'), 'utf8');
assert.doesNotMatch(source, /data-feature-status="pending"|pending-pages\.js/);
assert.doesNotMatch(source, /四川武胜汤氏族/);
assert.doesNotMatch(source, /href="profile-invite\.html"/);
assert.doesNotMatch(source, /href="profile-document/);
assert.match(source, /PC 暂未开放邀请/);
assert.match(source, /class="module-card is-unavailable" aria-disabled="true">\s*<span class="icon">邀<\/span>/);
assert.match(source, /重要证件/);
assert.match(source, /当前 PC 接口未提供家谱证件的列表、上传或维护能力/);
assert.match(source, /<h3>删除家谱<\/h3>/);
assert.match(source, /当前 PC 家谱契约未提供删除接口,暂不能查看或执行删除操作。/);
assert.doesNotMatch(source, /data-genealogy-delete|deleteGenealogy/);
assert.match(source, /亲友往来(贺礼簿)/);
assert.match(source, /备忘录(家族恩人)/);
assert.match(source, /当前 PC 不区分独立分类/);
assert.match(source, /data-family-home-title/);
assert.match(source, /data-family-home-overview/);
assert.match(source, /data-family-home-member-count/);
assert.match(source, /data-family-home-person-count/);
assert.match(source, /data-family-home-management/);
assert.match(source, /data-lineage-home-tree/);
assert.match(source, /data-family-home-overview[^>]*>[\s\S]*data-api-state="loading"/);
assert.match(source, /data-lineage-home-tree[^>]*>[\s\S]*data-api-state="loading"/);
assert.match(source, /src="public\/js\/lineage-pages\.js"/);
assert.match(source, /src="public\/js\/family-home-pages\.js"/);
assert.match(script, /root\.ProfileUI && root\.ProfileUI\.setApiState/);
assert.match(script, /setHomeState\('\[data-family-home-overview\]', 'loading', '正在加载家谱概览…'\)/);
assert.match(script, /setHomeState\('\[data-lineage-home-tree\]', 'loading', '正在加载世系树…'\)/);
assert.match(script, /setHomeState\('\[data-lineage-home-tree\]', 'empty', '暂无世系树'\)/);
assert.match(script, /treeHtml = Array\.isArray\(result\) \? root\.LineagePages\.renderLineageTreeHtml\(result\) : '';/);
assert.match(script, /if \(!treeHtml\) \{/);
assert.match(script, /当前账号无权查看该家谱世系树。/);
[
'profile-feed.html',
'profile-tree.html',
'profile-generation.html',
'profile-article.html',
'profile-album.html',
'profile-video.html',
'profile-merit.html',
'profile-ceremony.html'
'profile-ceremony.html',
'profile-gift.html',
'profile-growth.html',
'profile-relative.html',
'profile-memo.html',
'profile-family-admin.html',
'profile-services.html'
].forEach((href) => {
assert.match(
source,
@@ -183,4 +212,6 @@ test('家谱主页开放真实只读概览且不制造邀请或聚合统计入
`${href} 缺少家谱上下文`
);
});
assert.match(source, /<h3>会员与订单<\/h3>/);
assert.match(source, /关联当前家谱创建会员订单,并查看已有订单。/);
});