Files
docs/悦/货代SAAS平台后台/tests/verify-fba-inbound-smart-schedule-appointment-search.cjs
T
2026-08-22 09:50:50 +08:00

18 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 overlays = fs.readFileSync(path.join(root, 'prototype-src', 'overlays.html'), 'utf8');
const app = fs.readFileSync(path.join(root, 'prototype-src', 'app.js'), 'utf8');
assert.match(overlays, /id="ds-q-appointment-no"[^>]*placeholder="预约号"/, '智能排车缺少预约号搜索输入框');
assert.match(app, /let dsAppointmentNo='';/, '智能排车缺少预约号筛选状态');
assert.match(app, /dsAppointmentNo='';[\s\S]{0,200}document\.getElementById\('ds-q-appointment-no'\)/, '打开智能排车时未重置预约号');
assert.match(app, /dsAppointmentNo=\(document\.getElementById\('ds-q-appointment-no'\)\.value\|\|''\)\.trim\(\)/, '查询时未读取预约号');
assert.match(app, /document\.getElementById\('ds-q-appointment-no'\)\.value='';/, '重置时未清空预约号');
assert.match(app, /!dsAppointmentNo\|\|String\(o\.appointmentNo\|\|''\)\.toLowerCase\(\)\.includes\(dsAppointmentNo\.toLowerCase\(\)\)/, '订单列表未按预约号筛选');
assert.match(app, /dispatch\.appointmentNo=no;dispatch\.appointmentDate=date;/, '入库单预约保存未同步预约号到智能排车订单');
console.log('验证通过:智能排车支持预约号搜索。');