Compare commits

..

No commits in common. "8f3777c0630e521035e76456322717139d7434a7" and "e720b9a9127edee2d147f4b2177f9cbb6179402a" have entirely different histories.

View File

@ -10,17 +10,6 @@
use Illuminate\Support\Facades\Http;
use Livewire\Livewire;
function getTableEmptyStateAction($component, string $name): ?\Filament\Actions\Action
{
foreach ($component->instance()->getTable()->getEmptyStateActions() as $action) {
if ($action instanceof \Filament\Actions\Action && $action->getName() === $name) {
return $action;
}
}
return null;
}
uses(RefreshDatabase::class);
beforeEach(function (): void {
@ -85,14 +74,11 @@ function getTableEmptyStateAction($component, string $name): ?\Filament\Actions\
Filament::setTenant($tenant, true);
$component = Livewire::actingAs($user)
Livewire::actingAs($user)
->test(ListBackupSets::class)
->assertTableEmptyStateActionsExistInOrder(['create']);
$action = getTableEmptyStateAction($component, 'create');
expect($action)->not->toBeNull();
expect($action->isVisible())->toBeTrue();
expect($action->isDisabled())->toBeFalse();
->assertTableEmptyStateActionsExistInOrder(['create'])
->assertActionVisible('create')
->assertActionEnabled('create');
});
test('backup sets list shows empty state create action disabled for members without sync capability', function () {
@ -101,12 +87,9 @@ function getTableEmptyStateAction($component, string $name): ?\Filament\Actions\
Filament::setTenant($tenant, true);
$component = Livewire::actingAs($user)
Livewire::actingAs($user)
->test(ListBackupSets::class)
->assertTableEmptyStateActionsExistInOrder(['create']);
$action = getTableEmptyStateAction($component, 'create');
expect($action)->not->toBeNull();
expect($action->isVisible())->toBeTrue();
expect($action->isDisabled())->toBeTrue();
->assertTableEmptyStateActionsExistInOrder(['create'])
->assertActionVisible('create')
->assertActionDisabled('create');
});