平台订单摘要卡收紧已付无回执治理口径

This commit is contained in:
萝卜
2026-03-18 22:52:51 +08:00
parent 8b4cac8795
commit 619f14c252
4 changed files with 51 additions and 7 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderReceiptSummaryCardShouldUsePaidNoReceiptScopeTest 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_receipt_summary_card_should_use_paid_no_receipt_scope(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('已付无回执订单', $html);
$matched = preg_match('/data-role="po-summary-link-no-receipt-orders"[^>]*href="([^"]+)"/u', $html, $m);
$this->assertSame(1, $matched, '未找到平台订单列表摘要卡“已付无回执订单”链接');
$href = html_entity_decode($m[1] ?? '');
$parts = parse_url($href);
parse_str($parts['query'] ?? '', $q);
$this->assertSame('paid', (string) ($q['payment_status'] ?? ''));
$this->assertSame('none', (string) ($q['receipt_status'] ?? ''));
}
}