const assert = require('node:assert/strict'); const fs = require('node:fs'); const html = fs.readFileSync('workbench.html', 'utf8'); function detailActions(id, actionClass) { const detail = html.match(new RegExp(`
([\\s\\S]*?)`))?.[1] || ''; assert.ok(detail, `${id} detail actions should exist`); return detail; } for (const [id, actionClass] of [ ['sea-truck-detail', 'truck-detail-actions'], ['sea-pallet-detail', 'pallet-detail-actions'] ]) { const actions = detailActions(id, actionClass); assert.doesNotMatch(actions, /data-detail-content="status"/); assert.doesNotMatch(actions, /openSeaOrderEditor/); assert.match(actions, /返回列表/); } console.log('sea business detail actions requirements: ok');