diff --git a/tests/Feature/Business/MarketingAccountBillsTabsTest.php b/tests/Feature/Business/MarketingAccountBillsTabsTest.php index 0e1b0db3..f07d2c1e 100644 --- a/tests/Feature/Business/MarketingAccountBillsTabsTest.php +++ b/tests/Feature/Business/MarketingAccountBillsTabsTest.php @@ -324,6 +324,42 @@ class MarketingAccountBillsTabsTest extends FeatureTestCase } + public function testMarketingAccountBillsRemovesDisabledPlatformTabs(): void + { + $this->allowMarketingAccountBillsPage(); + $repository = Mockery::mock(TmallTaobaoSpreadBillRepository::class); + $repository->shouldReceive('usesBusinessMirror')->andReturnTrue(); + $repository->shouldReceive('paginate')->andReturn(['rows' => [], 'total' => 0]); + $repository->shouldReceive('summary')->andReturn([ + 'income_total' => 0, + 'expense_total' => 0, + 'net' => 0, + 'count' => 0, + ]); + $repository->shouldReceive('storeOptions')->andReturn([]); + $this->app->instance(TmallTaobaoSpreadBillRepository::class, $repository); + + $this->loginAs() + ->get(route('business.pages.show', [ + 'section' => 'billing-transactions', + 'page' => 'marketing-account-bills', + 'tab' => 'taobao-alipay', + ])) + ->assertOk() + ->assertDontSeeText('抖音账户') + ->assertDontSeeText('得物账户') + ->assertDontSeeText('唯品会账户'); + + $page = collect(config('business_navigation')) + ->firstWhere('slug', 'billing-transactions')['pages']; + $marketingBills = collect($page)->firstWhere('slug', 'marketing-account-bills'); + $tabSlugs = collect($marketingBills['tabs'])->pluck('slug')->all(); + + $this->assertNotContains('douyin', $tabSlugs); + $this->assertNotContains('dewu', $tabSlugs); + $this->assertNotContains('vipshop', $tabSlugs); + } + public function testPinduoduoBillsPageShowsExportForTheCurrentFilters(): void { $this->allowMarketingAccountBillsPage();