<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class AdminPlatformOrderQuickFiltersGroupsShouldHaveAriaLabelTest 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_quick_filter_groups_should_have_aria_label(): void
    {
        $this->loginAsPlatformAdmin();

        $res = $this->get('/admin/platform-orders');
        $res->assertOk();

        $html = (string) $res->getContent();
        $this->assertStringContainsString('data-role="po-quickfilter-primary-group" aria-label="平台订单主链快捷筛选组"', $html);
        $this->assertStringContainsString('data-role="po-quickfilter-receipt-refund-group" aria-label="平台订单收付治理快捷筛选组"', $html);
        $this->assertStringContainsString('data-role="po-quickfilter-governance-batch-group" aria-label="平台订单异常与批量治理快捷筛选组"', $html);
    }
}
