- Add HasFactory trait to all model classes for factory support - Create factory classes for all models (Classification, Company, ContentRecap, Department, IssueManagement, Journalist, Location, MediaMonitoring, MediaMonitoringTheme, PartnerMedia, SubClassification, SubLocation, Theme, User) - Add unit tests for all models with relationship and attribute validation - Add unit tests for all enums (Channel, ContentType, IsActive, IssueSentiment, MediaClassification, MediaType, SocialMedia) - Add feature tests for factory integration and basic application functionality - Add tests for Filament actions, columns, and media library utilities - Add tests for model policies (Classification, Theme) and traits (WithComment, WithValue) - Update phpunit.xml configuration for test environment - Add test documentation and working tests reference guide - Add ContentType enum casting to ContentRecap model - Add MediaMonitoringTheme relationships and factory support - Establish comprehensive testing infrastructure for improved code quality and reliability
46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?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();
|
|
});
|
|
});
|