新增订单数据一级导航,并覆盖工作区路由和导航顺序。 Co-authored-by: renshen <1005457301@qq.com> Co-committed-by: renshen <1005457301@qq.com>
196 lines
7.4 KiB
PHP
196 lines
7.4 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\Business;
|
|
|
|
use App\Models\Auth\Permission;
|
|
use Tests\Feature\FeatureTestCase;
|
|
|
|
class PagesTest extends FeatureTestCase
|
|
{
|
|
public function testTaobaoAlipayBillsEndpointIsAvailableToWorkspaceUsers()
|
|
{
|
|
$this->user->attachPermission(
|
|
Permission::where('name', 'read-admin-panel')->firstOrFail()
|
|
);
|
|
|
|
$this->loginAs()
|
|
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
|
->get(route('ecommerce-finance.alipay-bills.index'))
|
|
->assertOk()
|
|
->assertJsonStructure([
|
|
'current_page',
|
|
'data',
|
|
'total',
|
|
'summary' => ['income', 'expense', 'count', 'balance'],
|
|
]);
|
|
}
|
|
|
|
public function testSupplierPayablesPageRendersItsSpecificContent()
|
|
{
|
|
$this->user->attachPermission(
|
|
Permission::where('name', 'read-admin-panel')->firstOrFail()
|
|
);
|
|
|
|
$this->loginAs()
|
|
->get(route('business.pages.show', [
|
|
'section' => 'supplier-payables',
|
|
'page' => 'payment-reconciliation',
|
|
]))
|
|
->assertOk()
|
|
->assertSee('id="goods-reconciliation-app"', false)
|
|
->assertSee('public/js/ecommerce-finance/goods-reconciliations.min.js', false)
|
|
->assertDontSee('class="business-blank-page"', false);
|
|
}
|
|
|
|
public function testOrderDataSectionOpensThroughTheSharedWorkspaceRoute()
|
|
{
|
|
$this->user->attachPermission(
|
|
Permission::where('name', 'read-admin-panel')->firstOrFail()
|
|
);
|
|
|
|
$this->loginAs()
|
|
->get(route('business.pages.show', ['section' => 'order-data']))
|
|
->assertOk()
|
|
->assertSeeText('订单数据')
|
|
->assertSeeText('该页面暂未配置数据表,敬请期待。');
|
|
}
|
|
|
|
public function testPaperMaterialPagesRenderAsSeparateTables()
|
|
{
|
|
$this->user->attachPermission(
|
|
Permission::where('name', 'read-admin-panel')->firstOrFail()
|
|
);
|
|
|
|
$pages = [
|
|
'paper-prices' => '价格类型',
|
|
'paper-details' => '压贴厂金额',
|
|
'penalty-details' => '违约金',
|
|
'paper-factory-payables' => '2026年公司应付纸厂6月份货款',
|
|
];
|
|
|
|
foreach ($pages as $page => $expectedHeader) {
|
|
$this->loginAs()
|
|
->get(route('business.pages.show', [
|
|
'section' => 'paper-materials',
|
|
'page' => $page,
|
|
]))
|
|
->assertOk()
|
|
->assertSee($expectedHeader)
|
|
->assertSee('class="paper-material-table', false)
|
|
->assertDontSee('class="business-blank-page"', false);
|
|
}
|
|
}
|
|
|
|
public function testEdgeBandingMaterialPagesRenderAsSeparateTables()
|
|
{
|
|
$this->user->attachPermission(
|
|
Permission::where('name', 'read-admin-panel')->firstOrFail()
|
|
);
|
|
|
|
$pages = [
|
|
'edge-banding-prices' => '价格类型',
|
|
'details' => '封边条厂单价',
|
|
'compensation' => '最新出库日期',
|
|
'edge-banding-payables' => '2026年公司应付封边条厂6月份货款',
|
|
];
|
|
|
|
foreach ($pages as $page => $expectedHeader) {
|
|
$response = $this->loginAs()
|
|
->get(route('business.pages.show', [
|
|
'section' => 'edge-banding-materials',
|
|
'page' => $page,
|
|
]))
|
|
->assertOk()
|
|
->assertSee($expectedHeader)
|
|
->assertSee('class="edge-banding-table', false)
|
|
->assertDontSee('class="business-blank-page"', false);
|
|
|
|
if ($page !== 'compensation') {
|
|
$response->assertSeeText('该上游数据同步尚未启用,请联系管理员。');
|
|
}
|
|
}
|
|
}
|
|
|
|
public function testLaminationFactoryPayablePagesRenderAsSeparateTables()
|
|
{
|
|
$this->user->attachPermission(
|
|
Permission::where('name', 'read-admin-panel')->firstOrFail()
|
|
);
|
|
|
|
$pages = [
|
|
'lamination-prices' => '执行日期',
|
|
'finished-board-prices' => '最新价格',
|
|
'lamination-fees' => '单号类型',
|
|
'finished-board-freight' => '成品板规格',
|
|
'paper-stock-in' => '家具厂',
|
|
'paper-stock-out' => '压贴厂金额',
|
|
'factory-raw-boards' => '纸张合计',
|
|
'raw-board-freight' => '素板规格',
|
|
'invoice-tax-points' => '对账金额',
|
|
'factory-compensation' => '来源金额',
|
|
'factory-payables-details' => '成品板运费合计',
|
|
'factory-payables-report' => '2026年公司应付压贴厂5月份货款',
|
|
];
|
|
|
|
foreach ($pages as $page => $expectedHeader) {
|
|
$this->loginAs()
|
|
->get(route('business.pages.show', [
|
|
'section' => 'lamination-factory-payables',
|
|
'page' => $page,
|
|
]))
|
|
->assertOk()
|
|
->assertSee($expectedHeader)
|
|
->assertSee('class="lamination-table', false)
|
|
->assertDontSee('class="business-blank-page"', false);
|
|
}
|
|
}
|
|
|
|
public function testMergedFeaturePagesRenderTheirDedicatedContent()
|
|
{
|
|
$this->user->attachPermission(
|
|
Permission::where('name', 'read-admin-panel')->firstOrFail()
|
|
);
|
|
|
|
$pages = [
|
|
['supplier-payables', 'product-prices', '数据读取失败,请稍后重试。'],
|
|
['courier-payables', 'freight-reconciliation', '快递单号'],
|
|
['courier-payables', 'bookkeeping-details', '暂无记账明细'],
|
|
['courier-payables', 'compensation-details', '暂无赔偿明细'],
|
|
['courier-payables', 'advance-details', '暂无借支明细'],
|
|
['courier-payables', 'other-adjustments', '暂无其他扣款补款明细'],
|
|
['raw-board-payables', 'board-prices', '价格类型'],
|
|
['raw-board-payables', 'board-reconciliation', '运费(包含分摊运费)'],
|
|
['raw-board-payables', 'compensation-details', '暂无素板赔付明细'],
|
|
['raw-board-payables', 'board-payables-report', '暂无素板应付汇总数据'],
|
|
];
|
|
|
|
foreach ($pages as [$section, $page, $expectedText]) {
|
|
$this->loginAs()
|
|
->get(route('business.pages.show', compact('section', 'page')))
|
|
->assertOk()
|
|
->assertSeeText($expectedText)
|
|
->assertDontSee('class="business-blank-page"', false);
|
|
}
|
|
}
|
|
|
|
public function testBoardInventoryDetailsRendersWorkbookColumnsAsItsOwnPage()
|
|
{
|
|
$this->user->attachPermission(
|
|
Permission::where('name', 'read-admin-panel')->firstOrFail()
|
|
);
|
|
|
|
$this->loginAs()
|
|
->get(route('business.pages.show', [
|
|
'section' => 'inventory-management',
|
|
'page' => 'board-inventory-details',
|
|
]))
|
|
->assertOk()
|
|
->assertSee('class="upstream-data-table upstream-data-table--inventory"', false)
|
|
->assertSeeText('加权平均单价')
|
|
->assertSeeText('上月剩余价值')
|
|
->assertSeeText('出库金额')
|
|
->assertDontSee('class="business-data-page"', false)
|
|
->assertDontSee('class="business-blank-page"', false);
|
|
}
|
|
}
|