<?php

namespace Tests\Feature;

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

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

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

        $html = (string) $res->getContent();
        $this->assertStringContainsString('data-role="po-quickfilter-unpaid"', $html);
        $this->assertStringContainsString('待支付', $html);
        $this->assertStringContainsString('data-role="po-quickfilter-paid-no-receipt"', $html);
        $this->assertStringContainsString('已付无回执', $html);
        $this->assertStringContainsString('data-role="po-quickfilter-receipt-has"', $html);
        $this->assertStringContainsString('有回执', $html);
    }
}
