309598bfa6
- 在ApiClient中新增submitFeedback、myFeedback、helpArticles、helpArticleDetail、 siteArticles、promotions、vipPackages、createVipOrder、vipOrders等方法 - 添加帮助文章和站点资讯的参数验证逻辑 - 更新测试文件添加新的API方法测试用例 - 在HTML页面中添加反馈、帮助和VIP服务相关页面的脚本引用 - 更新加入家谱页面为完整的申请流程界面 - 修改资讯详情页面为站点资讯展示页面 - 更新AxiosRequestUtil中认证处理逻辑 - 添加世系树渲染的HTML生成函数用于页面复用 - 更新文档中的API契约说明和页面规划
57 lines
2.7 KiB
JavaScript
57 lines
2.7 KiB
JavaScript
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
const test = require('node:test');
|
|
|
|
const root = path.join(__dirname, '..');
|
|
|
|
function read(file) {
|
|
return fs.readFileSync(path.join(root, file), 'utf8');
|
|
}
|
|
|
|
test('内容发布页为全部家谱功能入口透传真实家谱上下文', () => {
|
|
const page = read('profile-content.html');
|
|
|
|
assert.doesNotMatch(page, /data-feature-status="pending"|pending-pages\.js|最近内容加载中/);
|
|
['profile-article.html', 'profile-album.html', 'profile-video.html', 'profile-merit.html', 'profile-gift.html', 'profile-feed.html', 'profile-growth.html', 'profile-relative.html', 'profile-memo.html'].forEach((href) => {
|
|
assert.match(page, new RegExp('href="' + href.replace('.', '\\.') + '"[^>]*data-genealogy-context-link'), `${href} 缺少家谱上下文透传`);
|
|
});
|
|
});
|
|
|
|
test('家谱主页公开谱文、相册、视频、功德和祭祀活动入口并透传上下文', () => {
|
|
const page = read('profile-family-home.html');
|
|
|
|
['profile-article.html', 'profile-album.html', 'profile-video.html', 'profile-merit.html', 'profile-ceremony.html'].forEach((href) => {
|
|
assert.match(page, new RegExp('href="' + href.replace('.', '\\.') + '"[^>]*data-genealogy-context-link'), `${href} 缺少家谱主页入口`);
|
|
});
|
|
});
|
|
|
|
test('个人中心功能入口没有把家谱业务页当作无上下文普通链接', () => {
|
|
const page = read('profile.html');
|
|
|
|
['profile-article.html', 'profile-album.html', 'profile-video.html', 'profile-merit.html', 'profile-gift.html'].forEach((href) => {
|
|
assert.match(page, new RegExp('href="' + href.replace('.', '\\.') + '"[^>]*data-genealogy-context-link'), `${href} 缺少个人中心上下文入口`);
|
|
});
|
|
});
|
|
|
|
test('加入申请与管理员审核入口使用真实页面和家谱上下文', () => {
|
|
const families = read('profile-families.html');
|
|
const familyAdmin = read('profile-family-admin.html');
|
|
const profile = read('profile.html');
|
|
|
|
assert.match(families, /href="profile-join-family\.html"/);
|
|
assert.doesNotMatch(families, /邀请码|分享码|手填.*ID/);
|
|
assert.match(familyAdmin, /href="profile-join-review\.html"[^>]*data-genealogy-context-link/);
|
|
assert.match(profile, /href="profile-join-review\.html"[^>]*data-genealogy-context-link/);
|
|
});
|
|
|
|
test('帮助中心和服务中心开放同一反馈记录闭环', () => {
|
|
const help = read('help.html');
|
|
const services = read('profile-services.html');
|
|
|
|
assert.match(help, /href="submit-ticket\.html"/);
|
|
assert.match(help, /href="my-tickets\.html"/);
|
|
assert.match(services, /href="profile-feedback\.html"[^>]*data-feature-link="available"/);
|
|
assert.doesNotMatch(help + services, /手填.*feedbackId|独立.*ticket.*接口/i);
|
|
});
|