<?php

namespace Tests\Feature;

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

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

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

        // “其它”除了占比外，还应展示单量（全量-Top5），让运营更直观感知长尾规模。
        $res->assertSee('data-role="plan-order-share-top5-meta"', false);
        $res->assertSee('其它：', false);
        $res->assertSee('单）', false);
    }
}
