等待后端更新接口

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
+18
View File
@@ -136,3 +136,21 @@ test('贺礼邀请页面只接入我的邀请闭环,不提供活动或献礼
assert.doesNotMatch(page, /data-ceremony-gift-form/);
assert.doesNotMatch(page, /href="profile-gift-edit\.html"/);
});
test('我的邀请将列表、详情和响应结果写入统一状态组件', () => {
const root = path.join(__dirname, '..');
const page = fs.readFileSync(path.join(root, 'profile-gift.html'), 'utf8');
const source = fs.readFileSync(path.join(root, 'public', 'js', 'ceremony-pages.js'), 'utf8');
assert.match(page, /data-my-invitation-list[^>]*>[\s\S]*data-api-state="loading"/);
assert.match(page, /data-my-invitation-detail[^>]*>[\s\S]*data-api-state="empty"/);
assert.match(page, /data-my-invitation-status/);
assert.match(source, /root\.ProfileUI && root\.ProfileUI\.setApiState/);
assert.match(source, /setInvitationState\('\[data-my-invitation-list\]', 'loading', '正在加载我的邀请…'\)/);
assert.match(source, /setInvitationState\('\[data-my-invitation-list\]', 'empty', '暂无贺礼邀请'\)/);
assert.match(source, /当前账号无权查看邀请。/);
assert.match(source, /正在更新邀请状态…/);
assert.match(source, /当前账号无权响应该邀请。/);
assert.equal(CeremonyPages.isForbidden({ status: 403 }), true);
assert.equal(CeremonyPages.isForbidden({ status: 401 }), false);
});