16 lines
953 B
JavaScript
16 lines
953 B
JavaScript
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const root = path.resolve(__dirname, '..');
|
|
const moduleHtml = fs.readFileSync(path.join(root, 'prototype-src/modules/03-overseas-warehouse.html'), 'utf8');
|
|
const appJs = fs.readFileSync(path.join(root, 'prototype-src/app.js'), 'utf8');
|
|
|
|
assert.match(moduleHtml, /<th[^>]*>采购价格<\/th>/, '托盘列表应包含采购价格表头');
|
|
assert.match(appJs, /purchasePrice:/, '托盘数据应包含 purchasePrice');
|
|
assert.match(appJs, /function formatFbaPalletPurchasePrice\(/, '应提供采购价格格式化函数');
|
|
assert.match(appJs, /formatFbaPalletPurchasePrice\(d\.purchasePrice\)/, '列表和详情应使用统一采购价格格式化函数');
|
|
assert.match(appJs, /\['采购价格',formatFbaPalletPurchasePrice\(d\.purchasePrice\)\]/, '托盘详情应显示采购价格');
|
|
|
|
console.log('FBA pallet purchase-price checks passed');
|