<?php

namespace Tests\Feature;

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

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

        // 护栏：订阅详情页“关联平台订单”区域必须使用统一 List Card + admin pagination。
        // 说明：此处使用扫描型断言，避免依赖具体 seed 数据量/分页是否渲染。
        $blade = file_get_contents(resource_path('views/admin/site_subscriptions/show.blade.php'));
        $this->assertIsString($blade);

        $this->assertStringContainsString('list-card', $blade);
        $this->assertStringContainsString('list-card-table', $blade);
        $this->assertStringContainsString("links('pagination.admin')", $blade);
        $this->assertStringContainsString('table-empty', $blade);
    }
}
