diff --git a/config/business_navigation.php b/config/business_navigation.php index 134ff684..bb961f39 100644 --- a/config/business_navigation.php +++ b/config/business_navigation.php @@ -167,6 +167,12 @@ return [ ['slug' => 'supplier-payables-report', 'title' => '供应商应付表'], ], ], + [ + 'slug' => 'order-data', + 'title' => '订单数据', + 'icon' => 'receipt_long', + 'pages' => [], + ], [ 'slug' => 'courier-payables', 'title' => '快递应付', diff --git a/tests/Feature/Business/PagesTest.php b/tests/Feature/Business/PagesTest.php index e62026a9..754ab8b0 100644 --- a/tests/Feature/Business/PagesTest.php +++ b/tests/Feature/Business/PagesTest.php @@ -42,6 +42,19 @@ class PagesTest extends FeatureTestCase ->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( diff --git a/tests/Feature/Settings/NavigationTest.php b/tests/Feature/Settings/NavigationTest.php index ff475352..035808d2 100644 --- a/tests/Feature/Settings/NavigationTest.php +++ b/tests/Feature/Settings/NavigationTest.php @@ -42,4 +42,23 @@ class NavigationTest extends FeatureTestCase $this->assertSame('企业设立', $companyRegistration['title']); } + public function testOrderDataIsConfiguredAsStandaloneSectionBetweenPayablesMenus() + { + $navigation = BusinessNavigation::all(); + $slugs = array_column($navigation, 'slug'); + + $supplierIndex = array_search('supplier-payables', $slugs, true); + $orderIndex = array_search('order-data', $slugs, true); + $courierIndex = array_search('courier-payables', $slugs, true); + $orderData = $navigation[$orderIndex] ?? null; + + $this->assertNotFalse($supplierIndex); + $this->assertNotFalse($orderIndex); + $this->assertNotFalse($courierIndex); + $this->assertGreaterThan($supplierIndex, $orderIndex); + $this->assertLessThan($courierIndex, $orderIndex); + $this->assertSame('订单数据', $orderData['title']); + $this->assertSame([], $orderData['pages']); + } + }