142 lines
5.4 KiB
PHP
142 lines
5.4 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\Business;
|
|
|
|
use App\Models\Auth\Permission;
|
|
use Tests\Feature\FeatureTestCase;
|
|
|
|
class PagesTest extends FeatureTestCase
|
|
{
|
|
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 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) {
|
|
$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);
|
|
}
|
|
}
|
|
|
|
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', '暂无素板应付汇总数据'],
|
|
['inventory-management', 'board-inventory-details', '暂无板材库存明细数据'],
|
|
];
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|