<?php

use App\Filament\Actions\DefaultBulkActions;
use Filament\Actions\DeleteBulkAction;
use Filament\Actions\ForceDeleteBulkAction;
use Filament\Actions\RestoreBulkAction;

describe('DefaultBulkActions', function () {
    it('returns array of bulk actions', function () {
        $actions = DefaultBulkActions::make('Test Entity');

        expect($actions)->toBeArray()
            ->and($actions)->toHaveCount(3);
    });

    it('includes delete bulk action', function () {
        $actions = DefaultBulkActions::make('Test Entity');

        $hasDeleteAction = collect($actions)->contains(function ($action) {
            return $action instanceof DeleteBulkAction;
        });

        expect($hasDeleteAction)->toBeTrue();
    });

    it('includes force delete bulk action', function () {
        $actions = DefaultBulkActions::make('Test Entity');

        $hasForceDeleteAction = collect($actions)->contains(function ($action) {
            return $action instanceof ForceDeleteBulkAction;
        });

        expect($hasForceDeleteAction)->toBeTrue();
    });

    it('includes restore bulk action', function () {
        $actions = DefaultBulkActions::make('Test Entity');

        $hasRestoreAction = collect($actions)->contains(function ($action) {
            return $action instanceof RestoreBulkAction;
        });

        expect($hasRestoreAction)->toBeTrue();
    });
});
