收紧回执筛选说明链接样式测试写法
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlatformOrderFiltersReceiptStatusHintLinkShouldKeepLinkClassTest 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_receipt_status_hint_link_should_keep_link_class(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin/platform-orders');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$html = (string) $res->getContent();
|
||||||
|
preg_match('/<a[^>]*data-role="po-receipt-status-broad-none-go-paid-no-receipt"[^>]*>/u', $html, $m);
|
||||||
|
$anchor = $m[0] ?? '';
|
||||||
|
|
||||||
|
$this->assertNotSame('', $anchor, '未找到回执筛选说明中的已付无回执直达入口');
|
||||||
|
$this->assertStringContainsString('class="link"', $anchor);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user