进行了一些小优化

This commit is contained in:
2026-08-24 17:35:46 +08:00
parent 85a124b886
commit 9d3bfb91cd
7 changed files with 45 additions and 39 deletions
@@ -177,6 +177,8 @@ test('asset purchases share the order center and refresh every wallet surface',
const repository = fs.readFileSync(path.join(root, 'src', 'Payment', 'OrderRepositoryCore.php'), 'utf8')
const adminRepository = fs.readFileSync(path.join(root, 'src', 'Payment', 'OrderRepositoryAdmin.php'), 'utf8')
const payOrders = fs.readFileSync(path.join(root, 'src', 'Admin', 'Native', 'PayOrders.php'), 'utf8')
const paymentRuntime = fs.readFileSync(path.join(root, 'src', 'Settings', 'PaymentRuntime.php'), 'utf8')
const paymentSchema = fs.readFileSync(path.join(root, 'assets', 'admin', 'src', 'schema', 'sections', 'payment', 'order.js'), 'utf8')
const balanceRest = fs.readFileSync(path.join(root, 'src', 'Credits', 'BalanceServiceRest.php'), 'utf8')
const chargeCard = fs.readFileSync(path.join(root, 'src', 'Payment', 'ChargeCard.php'), 'utf8')
const creditsJs = fs.readFileSync(path.join(root, 'assets', 'js', 'credits.js'), 'utf8')
@@ -223,6 +225,11 @@ test('asset purchases share the order center and refresh every wallet surface',
assert.match(adminRepository, /\$valid_statuses = array_keys\(\\AKSRT\\Core\\DomainModel::order_status_labels\(\)\)/)
assert.doesNotMatch(payOrders, /<select name="new_status">/)
assert.doesNotMatch(`${order}\n${repository}\n${userOrders}\n${payOrders}`, /['"]force['"]\s*=>\s*true/)
assert.match(paymentRuntime, /\$status_keys = \['pending', 'paid', 'refunding', 'refunded', 'closed'\]/)
for (const status of ['pending', 'paid', 'refunding', 'refunded', 'closed']) {
assert.match(paymentSchema, new RegExp(`payment_order_status_${status}`))
}
assert.doesNotMatch(paymentSchema, /payment_order_status_(?:completed|cancelled|processing)/)
assert.match(balanceRest, /register_rest_route\('aksrt\/v1', '\/pay\/assets'/)
assert.match(balanceRest, /'product_type'\s*=>\s*\\AKSRT\\Core\\DomainModel::ORDER_PRODUCT_POINTS/)
@@ -364,7 +364,12 @@ test('profile routes load versioned leaf styles and keep dialogs hidden initiall
assert.match(profileModalsCss, /\.modal-field input\[type="tel"\]/);
assert.doesNotMatch(profileCredits, /credits-signin\.php|data-aksrt-signin-calendar/);
assert.match(profileOrders, /data-aksrt-orders-filter-panel hidden/);
assert.match(profileOrders, /'status'\s*=>\s*\$_GET\['order_status'\]\s*\?\?\s*'all'/);
assert.match(profileOrders, /data-aksrt-orders-filter-panel hidden[\s\S]*?aksrt-orders-page__status-filters[\s\S]*?aksrt-orders-page__type-filters/);
assert.doesNotMatch(profileOrders, /aksrt-orders-page__tabs|aksrt-orders-page__tab(?:\s|<|"|')/);
assert.match(ordersCss, /\.aksrt-orders-page__filter-panel\[hidden\]\s*\{\s*display:\s*none\s*!important;/);
assert.match(ordersCss, /\.aksrt-orders-page__status-filters, \.aksrt-orders-page__type-filters/);
assert.doesNotMatch(ordersCss, /\.aksrt-orders-page__tabs|\.aksrt-orders-page__tab(?:\s|\.|:|\{)/);
assert.match(orderCenterJs, /if \(panel\) panel\.hidden = expanded;/);
assert.match(userCenterJs, /name === 'follow' \|\| name === 'orders'/);
assert.match(userCenterJs, /\['order_status', 'order_type', 'order_number', 'order_page'\]/);