feat(platform-orders): add bmpa_success_only quick filter and checkbox

This commit is contained in:
萝卜
2026-03-18 03:35:26 +08:00
parent 2a608e6ed7
commit 613224ea3c
2 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderQuickFilterBmpaSuccessLinkTest 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_page_should_have_quick_filter_for_bmpa_success_set(): void
{
$this->loginAsPlatformAdmin();
$html = $this->get('/admin/platform-orders')
->assertOk()
->getContent();
$this->assertStringContainsString('BMPA成功', $html);
$this->assertStringContainsString('/admin/platform-orders?bmpa_success_only=1', $html);
}
public function test_platform_orders_filters_should_render_bmpa_success_only_checkbox(): void
{
$this->loginAsPlatformAdmin();
$html = $this->get('/admin/platform-orders')
->assertOk()
->getContent();
$this->assertStringContainsString('name="bmpa_success_only"', $html);
$this->assertStringContainsString('只看批量标记支付成功', $html);
}
}