<?php

namespace Tests\Feature;

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

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

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

        $html = (string) $res->getContent();
        $this->assertStringContainsString('data-role="po-summary-link-go-add-payment-receipt"', $html);
        $this->assertStringContainsString('aria-label="直达补回执面板"', $html);
        $this->assertStringContainsString('title="直达补回执面板"', $html);
    }
}
