From 488812c0839412df043ea3dce877bbfd2c694bde Mon Sep 17 00:00:00 2001 From: WuYongJie <549727955@qq.com> Date: Wed, 22 Jul 2026 14:09:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=9A=E8=A1=A5=E5=85=A8?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=A1=B5=E9=9D=A2=E4=B8=8E=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E6=9D=83=E9=99=90=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpunit.xml | 2 ++ tests/Feature/Business/PagesTest.php | 29 +++++++++++++++++++++++ tests/Feature/Settings/NavigationTest.php | 10 ++++++++ 3 files changed, 41 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index 1bf28697..d1ff7a1f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -20,10 +20,12 @@ + + diff --git a/tests/Feature/Business/PagesTest.php b/tests/Feature/Business/PagesTest.php index 8cb79566..1d369379 100644 --- a/tests/Feature/Business/PagesTest.php +++ b/tests/Feature/Business/PagesTest.php @@ -109,4 +109,33 @@ class PagesTest extends FeatureTestCase ->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); + } + } } diff --git a/tests/Feature/Settings/NavigationTest.php b/tests/Feature/Settings/NavigationTest.php index 9c87f8d9..d06d2c32 100644 --- a/tests/Feature/Settings/NavigationTest.php +++ b/tests/Feature/Settings/NavigationTest.php @@ -2,6 +2,8 @@ namespace Tests\Feature\Settings; +use App\Models\Auth\Permission; +use App\Models\Auth\Role; use App\Utilities\BusinessNavigation; use Tests\Feature\FeatureTestCase; @@ -9,6 +11,14 @@ class NavigationTest extends FeatureTestCase { public function testAdminCanUpdateSidebarLabels() { + $this->user->roles()->sync([ + Role::where('name', 'admin')->firstOrFail()->id, + ]); + + $this->user->attachPermission( + Permission::where('name', 'read-admin-panel')->firstOrFail() + ); + $this->loginAs() ->get(route('settings.navigation.manage')) ->assertOk()