<?php

namespace Tests\Feature;

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

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

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

        $html = (string) $res->getContent();
        $this->assertStringContainsString('data-role="po-summary-jump-paid-no-receipt" aria-label="定位到已付无回执摘要卡"', $html);
        $this->assertStringContainsString('data-role="po-summary-jump-reconcile-mismatch" aria-label="定位到对账不一致摘要卡"', $html);
        $this->assertStringContainsString('data-role="po-summary-jump-syncable" aria-label="定位到可同步摘要卡"', $html);
        $this->assertStringContainsString('data-role="po-summary-jump-renewal-missing-sub" aria-label="定位到续费缺订阅摘要卡"', $html);
    }
}
