<?php

namespace Tests\Feature;

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

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

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

        // 收费主链 KPI：套餐/订阅/平台订单
        $res->assertSee('套餐');
        $res->assertSee('订阅');
        $res->assertSee('平台订单');
    }
}
