import assert from 'node:assert/strict' import test from 'node:test' import { toxicArrangeBlockMessage } from '../src/utils/pl-quota-cert-waiver' const unbound = '合同HT-1尚未绑定购买证和运输证,请先到合同中绑定后再安排运输' test('marked plans ignore the local certificate gap and keep source errors', () => { assert.equal(toxicArrangeBlockMessage({ quotaCertWaived: true, arrangeBlockMessage: '' }, unbound), '') assert.equal( toxicArrangeBlockMessage({ quotaCertWaived: true, arrangeBlockMessage: '这一段还没有关联合同' }, unbound), '这一段还没有关联合同' ) }) test('unmarked plans still block on the server message or the local certificate gap', () => { assert.equal(toxicArrangeBlockMessage({ arrangeBlockMessage: '证件余量不足' }, unbound), '证件余量不足') assert.equal(toxicArrangeBlockMessage({ arrangeBlockMessage: '' }, unbound), unbound) assert.equal(toxicArrangeBlockMessage(null, unbound), unbound) })