<?php

namespace Tests\Feature;

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

class TranslationResetPreviewEndpointTest extends TestCase
{
    use RefreshDatabase;

    public function test_additional_activity_reset_preview_forbidden_for_super_admin(): void
    {
        $superAdmin = User::factory()->create([
            'role' => 'super_admin',
            'franchisee_id' => null,
        ]);

        $id = (string) Str::uuid();

        $this->actingAs($superAdmin, 'sanctum')
            ->getJson("/admin/additional-activities/{$id}/reset-preview?language=en")
            ->assertStatus(403)
            ->assertJson([
                'status' => false,
                'message' => 'Only franchise users can perform this action.',
            ]);
    }

    public function test_testimonial_reset_preview_forbidden_for_super_admin(): void
    {
        $superAdmin = User::factory()->create([
            'role' => 'super_admin',
            'franchisee_id' => null,
        ]);

        $id = (string) Str::uuid();

        $this->actingAs($superAdmin, 'sanctum')
            ->getJson("/admin/testimonials/{$id}/reset-preview?language=en")
            ->assertStatus(403)
            ->assertJson([
                'status' => false,
                'message' => 'Only franchise users can perform this action.',
            ]);
    }
}
