<?php

namespace Tests\Feature;

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

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

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

        $html = (string) $res->getContent();

        $this->assertStringContainsString('data-role="analysis-skeleton-row2"', $html);
        $this->assertStringContainsString('最近平台订单', $html);
        $this->assertStringContainsString('占比', $html);
    }
}
