<?php

namespace Tests\Feature;

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

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

        $this->get('/admin/plans')
            ->assertOk()
            ->assertSee('套餐总数')
            ->assertSee('启用中套餐')
            ->assertSee('月付套餐')
            ->assertSee('年付套餐')
            ->assertSee('status=active', false)
            ->assertSee('billing_cycle=monthly', false)
            ->assertSee('billing_cycle=yearly', false);
    }
}
