This commit is contained in:
2026-08-27 13:50:33 +08:00
parent daf0ee2acd
commit 3b38fdd33d
7 changed files with 117 additions and 12 deletions
@@ -4,6 +4,7 @@ import test from 'node:test'
import {
confirmedNetSummary,
normalizeWeightPalletOptionPage,
normalizedGrossKg,
palletOptionsPath,
selectWeightPallet,
@@ -50,10 +51,13 @@ test('HTTP scenario uses pallet option and net weight contracts without legacy f
assert.match(optionsPath, /keyword=TP-09/)
assert.equal(WEIGHT_PALLET_OPTIONS_PAGE_SIZE, 50)
assert.deepEqual(weightPalletOptionRecords({
records: [{ palletId: '1' }], page: 1, size: 50, total: 1000, pages: 20,
records: [{ palletId: '1' }], page: '1', size: '50', total: '1000', pages: '20',
}), [{ palletId: '1' }])
assert.deepEqual(normalizeWeightPalletOptionPage({
records: [], page: '1', size: '20', total: '0', pages: '0',
}), { records: [], page: 1, size: 20, total: 0, pages: 0 })
assert.equal(weightPalletOptionRecords([{ palletId: '1' }]), null)
assert.equal(weightPalletOptionRecords({ records: [], page: 1, size: 1000 }), null)
assert.equal(weightPalletOptionRecords({ records: [], page: 1, size: 1000, total: 0, pages: 0 }), null)
assert.ok(source.indexOf('const palletOptionsResponse') < source.lastIndexOf('const uploadPath'))
assert.match(source, /form\.append\('file'/)
assert.doesNotMatch(source, /form\.append\('palletId'/)