<?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);
    }
}
