验证20%
This commit is contained in:
@@ -26,12 +26,12 @@ test('家谱主页公开谱文、相册、视频、功德和祭祀活动入口
|
||||
});
|
||||
});
|
||||
|
||||
test('个人中心功能入口没有把家谱业务页当作无上下文普通链接', () => {
|
||||
test('个人中心先引导进入真实家谱列表,不展示无上下文的业务入口', () => {
|
||||
const page = read('profile.html');
|
||||
const main = page.slice(0, page.indexOf('</main>'));
|
||||
|
||||
['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} 缺少个人中心上下文入口`);
|
||||
});
|
||||
assert.match(main, /href="profile-families\.html"/);
|
||||
assert.doesNotMatch(main, /href="profile-(?:article|album|video|merit|gift|join-review)\.html"/);
|
||||
});
|
||||
|
||||
test('加入申请与管理员审核入口使用真实页面和家谱上下文', () => {
|
||||
@@ -42,7 +42,7 @@ test('加入申请与管理员审核入口使用真实页面和家谱上下文',
|
||||
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/);
|
||||
assert.match(profile, /href="profile-families\.html"/);
|
||||
});
|
||||
|
||||
test('帮助中心和服务中心开放同一反馈记录闭环', () => {
|
||||
@@ -54,3 +54,18 @@ test('帮助中心和服务中心开放同一反馈记录闭环', () => {
|
||||
assert.match(services, /href="profile-feedback\.html"[^>]*data-feature-link="available"/);
|
||||
assert.doesNotMatch(help + services, /手填.*feedbackId|独立.*ticket.*接口/i);
|
||||
});
|
||||
|
||||
test('个人中心、我的家谱和当前家谱主页使用明确且可返回的三级路径', () => {
|
||||
const account = read('profile.html');
|
||||
const families = read('profile-families.html');
|
||||
const familyHome = read('profile-family-home.html');
|
||||
const familyHomeRuntime = read('public/js/family-home-pages.js');
|
||||
const coreHeaders = [account, families, familyHome].map((page) => page.slice(0, page.indexOf('</header>'))).join('');
|
||||
|
||||
assert.match(account, /<a class="active" href="profile\.html">个人中心<\/a>/);
|
||||
assert.match(account, /<a href="profile-families\.html">我的家谱<\/a>/);
|
||||
assert.match(families, /<nav class="profile-path" aria-label="当前位置">[\s\S]*个人中心[\s\S]*我的家谱/);
|
||||
assert.match(familyHome, /<nav class="profile-path" aria-label="当前位置">[\s\S]*profile-families\.html[\s\S]*data-family-home-context/);
|
||||
assert.match(familyHomeRuntime, /setText\('\[data-family-home-context\]', result\.overview\.genealogyName\)/);
|
||||
assert.doesNotMatch(coreHeaders, /返回中心|数字家谱/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user