平台订单快捷筛选回执/退款状态补齐 data-role 与口径护栏
This commit is contained in:
@@ -341,11 +341,11 @@
|
||||
</div>
|
||||
|
||||
<div class="inline-links mt-6">
|
||||
<a href="{!! $buildQuickFilterUrl(['receipt_status' => 'has']) !!}" class="muted">有回执</a>
|
||||
<a href="{!! $buildQuickFilterUrl(['receipt_status' => 'none']) !!}" class="muted">无回执</a>
|
||||
<a data-role="po-quickfilter-receipt-has" href="{!! $buildQuickFilterUrl(['receipt_status' => 'has']) !!}" class="muted">有回执</a>
|
||||
<a data-role="po-quickfilter-receipt-none" href="{!! $buildQuickFilterUrl(['receipt_status' => 'none']) !!}" class="muted">无回执</a>
|
||||
<a data-role="po-quickfilter-paid-no-receipt" href="{!! $buildQuickFilterUrl(['payment_status' => 'paid', 'receipt_status' => 'none']) !!}" class="muted">已付无回执</a>
|
||||
<a href="{!! $buildQuickFilterUrl(['refund_status' => 'has']) !!}" class="muted">有退款</a>
|
||||
<a href="{!! $buildQuickFilterUrl(['refund_status' => 'none']) !!}" class="muted">无退款</a>
|
||||
<a data-role="po-quickfilter-refund-has" href="{!! $buildQuickFilterUrl(['refund_status' => 'has']) !!}" class="muted">有退款</a>
|
||||
<a data-role="po-quickfilter-refund-none" href="{!! $buildQuickFilterUrl(['refund_status' => 'none']) !!}" class="muted">无退款</a>
|
||||
<a href="{!! $buildQuickFilterUrl(['payment_status' => 'partially_refunded']) !!}" class="muted">部分退款</a>
|
||||
<a href="{!! $buildQuickFilterUrl(['payment_status' => 'refunded']) !!}" class="muted">已退款</a>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformOrderIndexQuickFiltersReceiptAndRefundStatusShouldHaveDataRoleTest 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_receipt_and_refund_status_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-receipt-has"', $html);
|
||||
$this->assertStringContainsString('data-role="po-quickfilter-receipt-none"', $html);
|
||||
$this->assertStringContainsString('data-role="po-quickfilter-refund-has"', $html);
|
||||
$this->assertStringContainsString('data-role="po-quickfilter-refund-none"', $html);
|
||||
|
||||
// 也钉一下关键 query 语义
|
||||
$this->assertStringContainsString('receipt_status=has', $html);
|
||||
$this->assertStringContainsString('receipt_status=none', $html);
|
||||
$this->assertStringContainsString('refund_status=has', $html);
|
||||
$this->assertStringContainsString('refund_status=none', $html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user