From 3ab370df3db866d5fe4d5a000346e56924e133a6 Mon Sep 17 00:00:00 2001 From: renshen <1005457301@qq.com> Date: Tue, 11 Aug 2026 18:34:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/business_navigation.php | 5 +++- tests/Feature/Business/PagesTest.php | 29 +++++++++++++++++++---- tests/Feature/Settings/NavigationTest.php | 9 ++++++- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/config/business_navigation.php b/config/business_navigation.php index 9a0bdba2..702d1808 100644 --- a/config/business_navigation.php +++ b/config/business_navigation.php @@ -142,7 +142,10 @@ return [ 'slug' => 'refunds', 'title' => '退款', 'icon' => 'assignment_return', - 'pages' => [], + 'pages' => [ + ['slug' => 'jingxi-refund-data', 'title' => '京喜退款数据'], + ['slug' => 'non-jingxi-refund-data', 'title' => '非京喜退款数据'], + ], ], [ 'slug' => 'store-receivables', diff --git a/tests/Feature/Business/PagesTest.php b/tests/Feature/Business/PagesTest.php index 3dea32f8..08a2101f 100644 --- a/tests/Feature/Business/PagesTest.php +++ b/tests/Feature/Business/PagesTest.php @@ -80,7 +80,7 @@ class PagesTest extends FeatureTestCase ->assertDontSee('class="business-blank-page"', false); } - public function testRefundSectionUsesTheGenericBusinessPageRoute() + public function testRefundPagesUseTheGenericBusinessPageRoute() { $this->user->attachPermission( Permission::where('name', 'read-admin-panel')->firstOrFail() @@ -90,10 +90,29 @@ class PagesTest extends FeatureTestCase ->get(route('business.pages.show', [ 'section' => 'refunds', ])) - ->assertOk() - ->assertSeeText('退款') - ->assertSeeText('该页面暂未配置数据表,敬请期待。') - ->assertSee('class="biz-empty"', false); + ->assertRedirect(route('business.pages.show', [ + 'section' => 'refunds', + 'page' => 'jingxi-refund-data', + ])); + + foreach ([ + 'jingxi-refund-data' => '京喜退款数据', + 'non-jingxi-refund-data' => '非京喜退款数据', + ] as $page => $title) { + $this->get(route('business.pages.show', [ + 'section' => 'refunds', + 'page' => $page, + ])) + ->assertOk() + ->assertSeeText($title) + ->assertSeeText('该页面暂未配置数据表,敬请期待。') + ->assertSee('class="biz-empty"', false); + } + + $this->withExceptionHandling()->get(route('business.pages.show', [ + 'section' => 'refunds', + 'page' => 'unknown-refund-page', + ]))->assertNotFound(); } public function testPaperMaterialPagesRenderAsSeparateTables() diff --git a/tests/Feature/Settings/NavigationTest.php b/tests/Feature/Settings/NavigationTest.php index 4aa89068..6039d0a5 100644 --- a/tests/Feature/Settings/NavigationTest.php +++ b/tests/Feature/Settings/NavigationTest.php @@ -72,7 +72,14 @@ class NavigationTest extends FeatureTestCase ); $this->assertSame('退款', $refund['title']); $this->assertSame('assignment_return', $refund['icon']); - $this->assertSame([], $refund['pages']); + $this->assertSame( + ['jingxi-refund-data', 'non-jingxi-refund-data'], + array_column($refund['pages'], 'slug') + ); + $this->assertSame( + ['京喜退款数据', '非京喜退款数据'], + array_column($refund['pages'], 'title') + ); } } -- 2.47.2