等待后端更新接口

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
+28 -2
View File
@@ -15,14 +15,14 @@ function read(relativePath) {
test('加入申请只构造 AppGenealogyJoinApplyBody 并裁剪可选文本', () => {
assert.deepEqual(JoinPages.buildJoinApplyBody({
applicantName: ' 叶子 ',
phone: ' 19181970173 ',
phone: ' 测试联系方式 ',
relationDesc: ' 族亲 ',
applyReason: ' 申请加入 ',
inviterUserId: 'must-drop',
genealogyId: 'must-drop'
}), {
applicantName: '叶子',
phone: '19181970173',
phone: '测试联系方式',
relationDesc: '族亲',
applyReason: '申请加入'
});
@@ -156,17 +156,43 @@ test('申请加入页由后端家谱选项驱动且不允许手填业务 ID 或
assert.match(source, /data-join-apply-page/);
assert.match(source, /data-join-genealogy-search/);
assert.match(source, /data-join-genealogy-search novalidate aria-describedby="join-options-status"/);
assert.match(source, /data-join-genealogy-options/);
assert.match(source, /data-join-options-status role="status" aria-live="polite"/);
assert.match(source, /data-join-selected-genealogy role="status" aria-live="polite"/);
assert.match(source, /data-join-apply-form/);
assert.match(source, /data-join-apply-form novalidate aria-describedby="join-apply-status"/);
assert.match(source, /name="applicantName"/);
assert.match(source, /name="phone"/);
assert.match(source, /name="relationDesc"/);
assert.match(source, /name="applyReason"/);
assert.match(source, /class="join-page-grid"/);
assert.match(source, /class="join-search-panel"/);
assert.match(source, /class="[^"]*join-apply-form/);
assert.match(source, /<div id="join-apply-status" class="form-note" data-join-apply-status role="status" aria-live="polite"/);
assert.match(source, /public\/js\/profile-common\.js/);
assert.match(source, /public\/js\/join-pages\.js/);
assert.doesNotMatch(source, /name="(?:genealogyId|applyId|inviterUserId|inviteCode)"/);
assert.doesNotMatch(source, /邀请码|分享码|手工.*ID|输入.*ID/);
});
test('加入申请及申请列表复用统一状态,并在提交期间替换按钮反馈', () => {
const source = read('public/js/join-pages.js');
const profilePage = read('profile-join-family.html');
assert.match(source, /root\.ProfileUI && root\.ProfileUI\.renderApiState/);
assert.match(source, /root\.ProfileUI && root\.ProfileUI\.setApiState/);
assert.match(source, /function setOptionsState\(options, type, message\)/);
assert.match(source, /function clearSelectedGenealogy\(\)/);
assert.match(source, /clearSelectedGenealogy\(\);\s+setText\('\[data-join-options-status\]'/);
assert.match(source, /setOptionsState\(options, 'loading', '正在读取可申请家谱…'\)/);
assert.match(source, /\[data-join-options-status\]/);
assert.match(source, /getApiStateType\(error\)/);
assert.match(source, /setSubmitPending\(/);
assert.match(source, /正在提交…/);
assert.match(profilePage, /<div class="form-note" role="status" aria-live="polite" data-my-join-applies-status/);
});
test('我的加入申请页加载真实列表和刷新入口', () => {
const source = read('profile-join-family.html');