<?php

namespace Tests\Feature;

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

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

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

        $html = (string) $res->getContent();
        $this->assertStringContainsString('data-role="po-page-jump-links" aria-label="平台订单页内导航"', $html);
        $this->assertStringContainsString('data-role="po-page-jump-quick-filters" aria-label="定位到快捷筛选"', $html);
        $this->assertStringContainsString('data-role="po-page-jump-filters" aria-label="定位到筛选条件"', $html);
        $this->assertStringContainsString('data-role="po-page-jump-summary" aria-label="定位到摘要概览"', $html);
        $this->assertStringContainsString('data-role="po-page-jump-tools" aria-label="定位到工具区"', $html);
        $this->assertStringContainsString('data-role="po-page-jump-list" aria-label="定位到订单列表"', $html);
    }
}
