<?php

namespace Tests\Unit\Services\Notifications;

use App\Services\Notifications\NotificationDeletedService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;

class NotificationDeletedServiceTest extends TestCase
{
    use RefreshDatabase;

    public function test_list_returns_deleted_notifications(): void
    {
        DB::table('notifications')->insert([
            'id' => 1,
            'title' => 'Deleted',
            'message' => 'Message',
            'target_group' => 'parent',
            'delivery_channels' => json_encode(['in_app']),
            'deleted_at' => now(),
            'created_at' => now(),
            'updated_at' => now(),
        ]);

        $service = new NotificationDeletedService();
        $result = $service->list();

        $this->assertCount(1, $result['notifications']);
        $this->assertSame(1, $result['notifications'][0]['id']);
    }
}
