feat(platform-orders): add bmpa_success_only quick filter and checkbox
This commit is contained in:
@@ -332,6 +332,7 @@
|
||||
<a href="{!! $buildQuickFilterUrl(['syncable_only' => '1', 'sync_status' => 'unsynced']) !!}" class="muted">可同步订阅</a>
|
||||
<a 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 href="{!! $buildQuickFilterUrl(['renewal_missing_subscription' => '1']) !!}" class="muted">续费缺订阅</a>
|
||||
</div>
|
||||
|
||||
@@ -455,6 +456,10 @@
|
||||
<input type="checkbox" name="bmpa_failed_only" value="1" @checked(($filters['bmpa_failed_only'] ?? '') === '1')>
|
||||
<span>只看批量标记支付失败</span>
|
||||
</label>
|
||||
<label class="form-inline-row">
|
||||
<input type="checkbox" name="bmpa_success_only" value="1" @checked(($filters['bmpa_success_only'] ?? '') === '1')>
|
||||
<span>只看批量标记支付成功</span>
|
||||
</label>
|
||||
<label class="form-inline-row">
|
||||
<input type="checkbox" name="synced_only" value="1" @checked(($filters['synced_only'] ?? '') === '1')>
|
||||
<span>只看已同步</span>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user