<?php

namespace Tests\Feature;

use App\Models\AllowedPage;
use App\Models\Avatar;
use App\Models\PlatformConnection;
use App\Models\User;
use App\Models\Voice;
use Database\Seeders\ProductionSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class ProductionSeederTest extends TestCase
{
    use RefreshDatabase;

    public function test_production_catalogs_are_repeatable_without_demo_users_or_token_connections(): void
    {
        $this->seed(ProductionSeeder::class);
        $this->seed(ProductionSeeder::class);

        $this->assertSame(125, AllowedPage::query()->forPlatform('facebook')->count());
        $this->assertDatabaseHas('allowed_ad_accounts', [
            'platform' => 'meta',
            'account_id' => 'act_824024712556945',
            'is_active' => false,
        ]);
        $this->assertSame(12, Avatar::query()->count());
        $this->assertSame(10, Voice::query()->count());
        $this->assertSame(0, User::query()->count());
        $this->assertSame(0, PlatformConnection::query()->count());
    }
}
