等待后端更新接口
This commit is contained in:
@@ -11,15 +11,10 @@ const familyPendingPages = [
|
||||
];
|
||||
|
||||
const contentPendingPages = [
|
||||
'profile-admin-permissions.html',
|
||||
'profile-data-reminders.html'
|
||||
];
|
||||
|
||||
const residualPendingPages = [
|
||||
'profile-share.html'
|
||||
];
|
||||
|
||||
const pendingPages = familyPendingPages.concat(contentPendingPages, residualPendingPages);
|
||||
const pendingPages = familyPendingPages.concat(contentPendingPages);
|
||||
|
||||
function read(relativePath) {
|
||||
return fs.readFileSync(path.join(root, relativePath), 'utf8');
|
||||
@@ -47,8 +42,27 @@ test('待开发页面显式加载状态脚本', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('缺少 PC 接口契约的页面不展示静态成员、邀请或奖励数据', () => {
|
||||
const reminders = read('profile-data-reminders.html');
|
||||
const invite = read('profile-invite.html');
|
||||
const share = read('profile-share.html');
|
||||
|
||||
assert.match(reminders, /当前 PC 接口未提供资料缺项提醒列表/);
|
||||
assert.doesNotMatch(reminders, /鹿野 Loyel|张三|缺少出生日期/);
|
||||
assert.match(invite, /当前 PC 接口未提供邀请码/);
|
||||
assert.match(invite, /当前 PC 接口未提供邀请链接/);
|
||||
assert.doesNotMatch(invite, /data-invite-code|data-invite-link|加载中/);
|
||||
assert.match(share, /当前 PC 接口未提供分享链接或二维码/);
|
||||
assert.match(share, /当前 PC 接口未提供分享记录/);
|
||||
assert.match(share, /当前 PC 接口未提供收益账户或余额/);
|
||||
assert.match(share, /当前 PC 接口未提供提现方式、申请或记录/);
|
||||
assert.doesNotMatch(share, /data-member-overview|data-invite-link|data-withdraw(?:-form|-record)|3 人访问|1 人完成注册|加载中/);
|
||||
assert.doesNotMatch(share, /data-feature-status="pending"|pending-pages\.js/);
|
||||
assert.match(share, /class="module-card is-unavailable" aria-disabled="true"/);
|
||||
});
|
||||
|
||||
test('已接入的家谱业务页面保持真实功能状态', () => {
|
||||
['profile-families.html', 'profile-create-family.html', 'profile-join-family.html', 'profile-join-review.html', 'profile-family-home.html', 'profile-family-admin.html', 'profile-feedback.html', 'profile-services.html', 'profile-content.html', 'profile-feed.html', 'profile-feed-edit.html', 'profile-feed-detail.html', 'profile-generation.html', 'profile-tree.html', 'profile-article.html', 'profile-article-edit.html', 'profile-album.html', 'profile-album-edit.html', 'profile-album-detail.html', 'profile-video.html', 'profile-video-edit.html', 'profile-gift.html', 'profile-gift-edit.html', 'profile-ceremony.html', 'profile-ceremony-detail.html', 'profile-growth.html', 'profile-growth-edit.html', 'profile-relative.html', 'profile-relative-edit.html', 'profile-memo.html', 'profile-memo-edit.html', 'profile-merit.html', 'profile-merit-edit.html', 'profile-messages.html'].forEach((page) => {
|
||||
['profile-families.html', 'profile-create-family.html', 'profile-join-family.html', 'profile-join-review.html', 'profile-family-home.html', 'profile-family-admin.html', 'profile-admin-permissions.html', 'profile-feedback.html', 'profile-services.html', 'profile-content.html', 'profile-feed.html', 'profile-feed-edit.html', 'profile-feed-detail.html', 'profile-generation.html', 'profile-tree.html', 'profile-article.html', 'profile-article-edit.html', 'profile-album.html', 'profile-album-edit.html', 'profile-album-detail.html', 'profile-video.html', 'profile-video-edit.html', 'profile-gift.html', 'profile-gift-edit.html', 'profile-ceremony.html', 'profile-ceremony-detail.html', 'profile-growth.html', 'profile-growth-edit.html', 'profile-relative.html', 'profile-relative-edit.html', 'profile-memo.html', 'profile-memo-edit.html', 'profile-merit.html', 'profile-merit-edit.html', 'profile-messages.html'].forEach((page) => {
|
||||
assert.doesNotMatch(read(page), /data-feature-status="pending"/, `${page} 不应标记为待开发`);
|
||||
});
|
||||
assert.match(read('profile-generation.html'), /src="public\/js\/generation-pages\.js"/);
|
||||
@@ -61,6 +75,9 @@ test('已接入的家谱业务页面保持真实功能状态', () => {
|
||||
assert.match(read('profile-family-home.html'), /src="public\/js\/family-home-pages\.js"/);
|
||||
assert.match(read('profile-tree.html'), /src="public\/js\/lineage-pages\.js"/);
|
||||
assert.match(read('profile-family-admin.html'), /src="public\/js\/member-admin-pages\.js"/);
|
||||
assert.doesNotMatch(read('profile-admin-permissions.html'), /src="public\/js\/pending-pages\.js"/);
|
||||
assert.match(read('profile-admin-permissions.html'), /href="profile-family-admin\.html" data-genealogy-context-link/);
|
||||
assert.match(read('profile-join-review.html'), /href="profile-admin-permissions\.html" data-genealogy-context-link/);
|
||||
assert.match(read('profile-article.html'), /src="public\/js\/article-pages\.js"/);
|
||||
assert.match(read('profile-article-edit.html'), /src="public\/js\/article-pages\.js"/);
|
||||
assert.match(read('profile-album.html'), /src="public\/js\/album-pages\.js"/);
|
||||
@@ -93,11 +110,21 @@ test('待开发的家谱管理页明确放行已接入的字辈入口并透传
|
||||
});
|
||||
|
||||
test('待开发页面仅放行显式标记的可用功能入口', () => {
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({ href: 'profile-share.html' })), true);
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({ href: 'profile-invite.html' })), true);
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({ href: 'profile-feed.html', 'data-feature-link': 'available' })), false);
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({ href: '#section' })), false);
|
||||
});
|
||||
|
||||
test('待开发邀请页允许返回已接入的成员管理', () => {
|
||||
const invite = read('profile-invite.html');
|
||||
|
||||
assert.match(invite, /href="profile-family-admin\.html"[^>]*data-feature-link="available"[^>]*data-genealogy-context-link/);
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({
|
||||
href: 'profile-family-admin.html',
|
||||
'data-feature-link': 'available'
|
||||
})), false);
|
||||
});
|
||||
|
||||
test('内容入口明确保留家族圈动态跳转', () => {
|
||||
assert.match(read('profile-content.html'), /href="profile-feed\.html" data-feature-link="available"/);
|
||||
assert.match(read('profile-content.html'), /href="profile-growth\.html" data-feature-link="available" data-genealogy-context-link/);
|
||||
|
||||
Reference in New Issue
Block a user