diff --git a/tests/widget-system/financial-flow-contract.test.cjs b/tests/widget-system/financial-flow-contract.test.cjs index ab70f583..9e1b625d 100644 --- a/tests/widget-system/financial-flow-contract.test.cjs +++ b/tests/widget-system/financial-flow-contract.test.cjs @@ -125,9 +125,21 @@ test('flow retention and archive were deliberately removed', () => { assert.equal(fs.existsSync(path.join(root, 'src/Finance/FinancialFlowRetention.php')), false) }) -test('order detail workbench includes statistics, orders, after-sales and the new filters', () => { +test('order detail page drops tabs; after-sales becomes a standalone submenu', () => { const page = read('src/Admin/Native/PayOrders.php') - for (const tab of ['统计', '订单', '售后']) assert.ok(page.includes(`__('${tab}'`)) + const menus = read('src/Admin/Native/PayMenus.php') + const repository = read('src/Payment/OrderRepositoryCore.php') + // 订单明细页不再有 Tab 分页:统计 Tab 与页面整体删除,售后 Tab 移出 + assert.ok(!page.includes('render_workbench_tabs'), 'workbench tabs must be removed') + assert.ok(!page.includes("$_GET['tab']"), 'tab query param must not be read') + assert.ok(!page.includes('render_statistics_page'), 'statistics page must be removed') + assert.ok(!page.includes('stat_card'), 'stat cards must be removed') + assert.ok(!repository.includes('get_admin_order_stats'), 'dead stats query must be removed') + // 售后独立为子菜单「售后服务」(aksrt_after_sales),无兼容跳转 + assert.ok(menus.includes("'slug' => 'aksrt_after_sales'"), 'after-sales submenu slug') + assert.ok(page.includes('render_after_sales_admin_page'), 'after-sales admin page entry') + assert.ok(page.includes("PAGE_AFTER_SALES_SLUG = 'aksrt_after_sales'"), 'after-sales slug constant') + assert.ok(!page.includes('after-sales'), 'old tab slug must not remain') const domain = read('src/Core/DomainModel.php') for (const status of ['pending', 'paid', 'refunded', 'closed']) assert.ok(domain.includes(`ORDER_STATUS_${status.toUpperCase()}`)) assert.match(page, /STATUS_PENDING[\s\S]*?STATUS_PROCESSING[\s\S]*?STATUS_APPROVED[\s\S]*?STATUS_REJECTED[\s\S]*?STATUS_CANCELLED[\s\S]*?STATUS_COMPLETED/)