release: freeze 2026-10-15 validated release baseline
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Canceled after 0s
CI/CD Pipeline / E2E (live stack) (push) Canceled after 0s
CI/CD Pipeline / Backend Build & Test (push) Canceled after 0s
CI/CD Pipeline / Admin Web Build (push) Canceled after 0s
CI/CD Pipeline / Mini Program Compile Check (push) Canceled after 0s
CI/CD Pipeline / Migration Validation (push) Canceled after 0s
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Canceled after 0s

This commit is contained in:
WorkBuddy
2026-10-15 09:47:31 +08:00
parent 827c23db1d
commit 3c2b967274
149 changed files with 4324 additions and 348 deletions
@@ -0,0 +1,46 @@
const assert = require('node:assert/strict');
const fs = require('node:fs');
const vm = require('node:vm');
const path = require('node:path');
const root = path.resolve(__dirname, '../..');
function load(file, api, service) {
let page;
vm.runInNewContext(fs.readFileSync(path.join(root, file), 'utf8'), {
Page: value => { page = value; },
wx: { getStorageSync: () => 'test', showToast() {}, navigateBack() {} },
require: name => name.endsWith('/api') ? api : service,
});
page.setData = data => Object.assign(page.data, data);
return page;
}
(async () => {
const id = '00000000-0000-0000-0000-000000000001';
const calls = [];
const service = { referralService: {
getMyReferralHistory: async () => [{ id, type: 'activity', activityId: id,
activityDisplayId: 'HD20261014001', referralDisplayId: 'ZF20261014001', status: 'pending' }],
confirmReferral: async (value, type) => { calls.push({ value, type }); },
} };
const referral = load('miniapp/pages/referral-confirmation/referral-confirmation.js', {}, service);
await referral.load();
assert.equal(referral.data.referrals[0].detail, 'HD20261014001');
assert.equal(referral.data.referrals[0].referralDisplayId, 'ZF20261014001');
await referral.confirm({ currentTarget: { dataset: { index: 0 } } });
assert.equal(calls[0].value, id);
assert.equal(calls[0].type, 'activity');
service.referralService.getMyReferralHistory = async () => [{ id, type: 'activity', activityId: id }];
await referral.load();
assert.equal(referral.data.referrals[0].detail, '公益活动');
const urls = [];
const detail = load('miniapp/pages/matchmaker-service-detail/matchmaker-service-detail.js', {
get: async url => { urls.push(url); return { serviceId: id, serviceDisplayId: 'FW20261014001', userDisplayNumber: 'YH20261014002', followups: [] }; },
}, {});
detail.data.serviceId = id;
await detail.loadDetail();
assert.equal(urls[0], `/operator/matchmaker/services/${id}`);
assert.equal(detail.data.detail.serviceDisplayId, 'FW20261014001');
const template = fs.readFileSync(path.join(root, 'miniapp/pages/matchmaker-service-detail/matchmaker-service-detail.wxml'), 'utf8');
assert(template.includes('detail.serviceDisplayId'));
assert(!template.includes('{{detail.serviceId}}'));
console.log('PASS: 小程序真实页面脚本显示业务编号、缺号不回退 UUID、确认和详情请求保留内部 UUID。');
})().catch(error => { console.error(error); process.exitCode = 1; });