diff --git a/composer.json b/composer.json index 112e58b..df2e9e4 100644 --- a/composer.json +++ b/composer.json @@ -10,23 +10,21 @@ "license": "MIT", "require": { "php": "^8.2", - "codedor/filament-translatable-tabs": "dev-feature/filament-v4", + "codedor/filament-translatable-tabs": "dev-feature/filament-v5", "codedor/laravel-locale-collection": "^1.2.1", - "filament/filament": "^4.0", + "filament/filament": "^4.0|^5.0", "illuminate/contracts": "^10.0|^11.0|^12.0", "maatwebsite/excel": "^3.1", "spatie/laravel-package-tools": "^1.12", "spatie/laravel-translatable": "^6.4" }, "require-dev": { - "filament/upgrade": "^4.0", "larastan/larastan": "^2.4|^3.0", "laravel/pint": "^1.0", "nunomaduro/collision": "^7.0|^8.0", "orchestra/testbench": "^8.0|^9.0|^10.0", "pestphp/pest": "^2.0|^3.0", "pestphp/pest-plugin-laravel": "^2.0|^3.0", - "pestphp/pest-plugin-livewire": "^2.0|^3.0", "phpstan/extension-installer": "^1.1|^2.0", "phpstan/phpstan-deprecation-rules": "^1.0|^2.0", "phpstan/phpstan-phpunit": "^1.0|^2.0" diff --git a/tests/Feature/Filament/TranslatableStringResource/Pages/EditTranslatableStringTest.php b/tests/Feature/Filament/TranslatableStringResource/Pages/EditTranslatableStringTest.php index 38f882b..288da1e 100644 --- a/tests/Feature/Filament/TranslatableStringResource/Pages/EditTranslatableStringTest.php +++ b/tests/Feature/Filament/TranslatableStringResource/Pages/EditTranslatableStringTest.php @@ -4,8 +4,7 @@ use Codedor\LocaleCollection\Locale; use Codedor\TranslatableStrings\Filament\Resources\TranslatableStringResource\Pages\EditTranslatableString; use Codedor\TranslatableStrings\Tests\Fixtures\Models\User; - -use function Pest\Livewire\livewire; +use Livewire\Livewire; beforeEach(function () { LocaleCollection::push(new Locale('en')) @@ -17,7 +16,7 @@ }); it('can edit a translatable string', function () { - livewire(EditTranslatableString::class, [ + Livewire::test(EditTranslatableString::class, [ 'record' => $this->string->getRouteKey(), ]) ->assertSuccessful() diff --git a/tests/Feature/Filament/TranslatableStringResource/Pages/ListTranslatableStringsTest.php b/tests/Feature/Filament/TranslatableStringResource/Pages/ListTranslatableStringsTest.php index b628f27..4bf7876 100644 --- a/tests/Feature/Filament/TranslatableStringResource/Pages/ListTranslatableStringsTest.php +++ b/tests/Feature/Filament/TranslatableStringResource/Pages/ListTranslatableStringsTest.php @@ -11,10 +11,9 @@ use Illuminate\Support\Facades\Queue; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; +use Livewire\Livewire; use Mockery\MockInterface; -use function Pest\Livewire\livewire; - beforeEach(function () { LocaleCollection::push(new Locale('en')) ->push(new Locale('nl')); @@ -28,13 +27,13 @@ }); it('can list translatable strings', function () { - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->assertOk() ->assertCanSeeTableRecords($this->strings); }); it('can sort table', function () { - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->sortTable('scope') ->assertCanSeeTableRecords($this->strings->sortBy('scope'), inOrder: true) ->sortTable('name', 'desc') @@ -42,14 +41,14 @@ ->sortTable('created_at', 'desc') ->assertCanSeeTableRecords($this->strings->sortByDesc('created_at'), inOrder: true) ->sortTable() - ->assertCanSeeTableRecords($this->strings->sortByDesc('created_at'), inOrder: true); + ->assertCanSeeTableRecords($this->strings->sortBy('created_at'), inOrder: true); }); it('can filter on filled in value', function () { $emptyStrings = $this->strings->filter(fn ($string) => blank($string->value)); $notEmptyStrings = $this->strings->filter(fn ($string) => ! blank($string->value)); - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->filterTable('filled_in', '') ->assertCanSeeTableRecords($this->strings) ->filterTable('filled_in', true) @@ -61,30 +60,30 @@ }); it('can filter on scope', function () { - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->filterTable('scope', 'd scope') ->assertCanSeeTableRecords($this->strings->filter(fn ($string) => $string->scope === 'd scope')) ->assertCanNotSeeTableRecords($this->strings->filter(fn ($string) => $string->scope !== 'd scope')); }); it('has an edit action', function () { - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->assertTableActionExists('edit'); }); it('has no delete action', function () { - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->assertTableActionDoesNotExist('delete') ->assertTableBulkActionDoesNotExist('delete'); }); it('has no create action', function () { - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->assertTableActionDoesNotExist('create'); }); it('has an import action that can throw an error', function () { - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->assertActionExists('import') ->callAction('import'); @@ -97,7 +96,7 @@ file_get_contents(__DIR__ . '/../../../../Fixtures/import_truncate.xlsx', 'import_truncate.xlsx') ); - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->assertActionExists('import') ->callAction('import', [ 'overwrite' => true, @@ -137,7 +136,7 @@ }) ); - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->assertActionExists('export') ->callAction('export'); }); @@ -145,7 +144,7 @@ it('has an extract and parse action', function () { Queue::fake(); - livewire(ListTranslatableStrings::class) + Livewire::test(ListTranslatableStrings::class) ->assertActionExists('extract_parse') ->callAction('extract_parse'); diff --git a/tests/TestCase.php b/tests/TestCase.php index cb7c973..553baf4 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -8,7 +8,6 @@ use Codedor\TranslatableTabs\Providers\TranslatableTabsServiceProvider; use Filament\Actions\ActionsServiceProvider; use Filament\FilamentServiceProvider; -use Filament\FilamentServiceProvider as BaseFilamentServiceProvider; use Filament\Forms\FormsServiceProvider; use Filament\Infolists\InfolistsServiceProvider; use Filament\Notifications\NotificationsServiceProvider;