CaiWuXiTong/tests/Feature/Business/SupplierNegativeAlertPageTest.php
苏木 8c38175318 feat: 新增供应商负数预警子页面
在供应商对账下新增供应商负数预警子页面,并将其置于子菜单第一位。
Co-authored-by: 苏木 <594326199@qq.com>
Co-committed-by: 苏木 <594326199@qq.com>
2026-10-28 10:35:49 +08:00

49 lines
1.6 KiB
PHP

<?php
namespace Tests\Feature\Business;
use App\Models\Auth\Permission;
use App\Utilities\BusinessNavigation;
use Tests\Feature\FeatureTestCase;
class SupplierNegativeAlertPageTest extends FeatureTestCase
{
protected function setUp(): void
{
parent::setUp();
$this->user->attachPermission(
Permission::where('name', 'read-admin-panel')->firstOrFail()
);
}
public function test_supplier_reconciliation_navigation_contains_the_negative_alert_page(): void
{
$section = collect(BusinessNavigation::all())->firstWhere('slug', 'supplier-reconciliation');
$this->assertNotNull($section);
$this->assertContains('supplier-negative-alert', array_column($section['pages'], 'slug'));
$this->assertSame('supplier-negative-alert', $section['pages'][0]['slug']);
$this->assertSame(
'供应商负数预警',
collect($section['pages'])->firstWhere('slug', 'supplier-negative-alert')['title'],
);
}
public function test_negative_alert_page_renders_in_the_supplier_reconciliation_tabs(): void
{
$this->loginAs()
->get(route('business.pages.show', [
'section' => 'supplier-reconciliation',
'page' => 'supplier-negative-alert',
]))
->assertOk()
->assertSeeText('财务端数据')
->assertSeeText('厂家端数据')
->assertSeeText('供应商负数预警')
->assertSeeText('负数判定口径待确认')
->assertSeeText('待接入')
->assertSeeText('返回财务端数据');
}
}