<?php

namespace Tests\Feature;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class AdvancedPortalPagesTest extends TestCase
{
    use RefreshDatabase;

    public function test_admin_can_open_advanced_management_pages(): void
    {
        $admin = User::create([
            'name' => 'Advanced Admin',
            'email' => 'advanced-admin@mgg.test',
            'password' => 'password',
            'role' => 'admin',
        ]);

        foreach ([
            '/admin/plus-tracker',
            '/admin/notifications',
            '/admin/payment-methods',
            '/admin/settings/profile',
            '/admin/settings/website',
            '/admin/settings/brand',
            '/admin/settings/payment',
            '/admin/settings/roles',
            '/admin/settings/notifications',
            '/admin/settings/security',
            '/admin/settings/system',
            '/admin/settings/modules',
            '/gts-admin/dashboard',
            '/gts-admin/api-manager',
            '/gts-admin/gts-clients',
            '/gts-admin/gts-services',
            '/gts-admin/gts-orders',
            '/gts-admin/gts-wallets',
            '/gts-admin/gts-wallet-transactions',
        ] as $url) {
            $this->actingAs($admin)->get($url)->assertOk();
        }
    }

    public function test_home_page_has_agency_sections(): void
    {
        $this->get('/')
            ->assertOk()
            ->assertSee('Trusted Brands')
            ->assertSee('Portfolio Preview')
            ->assertSee('Dashboard Preview')
            ->assertSee('Why Choose Us')
            ->assertSee('Workflow')
            ->assertSee('GTS System')
            ->assertSee('Testimonials')
            ->assertSee('FAQ');
    }
}
