Files
docs/悦/货代SAAS平台后台/tests/verify-outbound-vehicle-buy-appointment.cjs
T
2026-08-22 09:50:50 +08:00

21 lines
1.3 KiB
JavaScript

const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const root = path.resolve(__dirname, '..');
const modal = fs.readFileSync(path.join(root, 'prototype-src/tail.html'), 'utf8');
const app = fs.readFileSync(path.join(root, 'prototype-src/app.js'), 'utf8');
assert.match(modal, /<option value="买约">买约<\/option>/, '预约账号缺少买约选项');
assert.match(modal, /id="bol-sellerName"/, '缺少买约卖家姓名字段');
assert.match(modal, /id="bol-buyAppointmentFee"/, '缺少买约费用字段');
assert.match(modal, /id="bol-buyAppointmentVoucher"/, '缺少买约付款凭证字段');
assert.match(modal, /id="bol-courier-company-field"[\s\S]*id="bol-courierCompanyId"/, '快递公司字段缺失');
const activeModal = modal.split('<template id="legacy-bol-fields">')[0];
assert.doesNotMatch(activeModal, /<div class="form-group"><label>预约号<\/label><input id="bol-appointmentNo"/, '预约号仍在转派送表单中可见');
assert.match(app, /handleOutboundVehicleAppointmentAccountChange\(\)/, '缺少预约账号联动处理');
assert.match(app, /buyAppointmentFee|buyAppointmentVoucher/, '买约字段未接入保存数据');
assert.match(app, /sellerName/, '卖家姓名未接入保存数据');
console.log('验证通过:排车转派送买约字段已接入。');