平台订单快捷筛选补齐 BMPA 成功/失败 data-role 与口径护栏

This commit is contained in:
萝卜
2026-03-18 16:02:50 +08:00
parent 13d87748c6
commit 5a5ee2319f
2 changed files with 39 additions and 2 deletions

View File

@@ -335,8 +335,8 @@
<a href="{!! $buildQuickFilterUrl(['payment_status' => 'paid', 'status' => 'pending', 'sync_status' => 'unsynced']) !!}" class="muted">待生效</a>
<a data-role="po-quickfilter-syncable" href="{!! $buildQuickFilterUrl(['syncable_only' => '1', 'sync_status' => 'unsynced']) !!}" class="muted">可同步订阅</a>
<a data-role="po-quickfilter-sync-failed" href="{!! $buildQuickFilterUrl(['sync_status' => 'failed']) !!}" class="muted">同步失败</a>
<a href="{!! $buildQuickFilterUrl(['bmpa_failed_only' => '1']) !!}" class="muted">BMPA失败</a>
<a href="{!! $buildQuickFilterUrl(['bmpa_success_only' => '1']) !!}" class="muted">BMPA成功</a>
<a data-role="po-quickfilter-bmpa-failed" href="{!! $buildQuickFilterUrl(['bmpa_failed_only' => '1']) !!}" class="muted">BMPA失败</a>
<a data-role="po-quickfilter-bmpa-success" href="{!! $buildQuickFilterUrl(['bmpa_success_only' => '1']) !!}" class="muted">BMPA成功</a>
<a href="{!! $buildQuickFilterUrl(['renewal_missing_subscription' => '1']) !!}" class="muted">续费缺订阅</a>
</div>

View File

@@ -0,0 +1,37 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexQuickFiltersBmpaFailedAndSuccessShouldHaveDataRoleTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_platform_orders_index_quick_filters_bmpa_failed_and_success_should_have_data_role(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('data-role="po-quickfilter-bmpa-failed"', $html);
$this->assertStringContainsString('data-role="po-quickfilter-bmpa-success"', $html);
$this->assertStringContainsString('bmpa_failed_only=1', $html);
$this->assertStringContainsString('bmpa_success_only=1', $html);
}
}