Compare commits
No commits in common. "8f3777c0630e521035e76456322717139d7434a7" and "e720b9a9127edee2d147f4b2177f9cbb6179402a" have entirely different histories.
8f3777c063
...
e720b9a912
@ -10,17 +10,6 @@
|
|||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Livewire\Livewire;
|
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);
|
uses(RefreshDatabase::class);
|
||||||
|
|
||||||
beforeEach(function (): void {
|
beforeEach(function (): void {
|
||||||
@ -85,14 +74,11 @@ function getTableEmptyStateAction($component, string $name): ?\Filament\Actions\
|
|||||||
|
|
||||||
Filament::setTenant($tenant, true);
|
Filament::setTenant($tenant, true);
|
||||||
|
|
||||||
$component = Livewire::actingAs($user)
|
Livewire::actingAs($user)
|
||||||
->test(ListBackupSets::class)
|
->test(ListBackupSets::class)
|
||||||
->assertTableEmptyStateActionsExistInOrder(['create']);
|
->assertTableEmptyStateActionsExistInOrder(['create'])
|
||||||
|
->assertActionVisible('create')
|
||||||
$action = getTableEmptyStateAction($component, 'create');
|
->assertActionEnabled('create');
|
||||||
expect($action)->not->toBeNull();
|
|
||||||
expect($action->isVisible())->toBeTrue();
|
|
||||||
expect($action->isDisabled())->toBeFalse();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('backup sets list shows empty state create action disabled for members without sync capability', function () {
|
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);
|
Filament::setTenant($tenant, true);
|
||||||
|
|
||||||
$component = Livewire::actingAs($user)
|
Livewire::actingAs($user)
|
||||||
->test(ListBackupSets::class)
|
->test(ListBackupSets::class)
|
||||||
->assertTableEmptyStateActionsExistInOrder(['create']);
|
->assertTableEmptyStateActionsExistInOrder(['create'])
|
||||||
|
->assertActionVisible('create')
|
||||||
$action = getTableEmptyStateAction($component, 'create');
|
->assertActionDisabled('create');
|
||||||
expect($action)->not->toBeNull();
|
|
||||||
expect($action->isVisible())->toBeTrue();
|
|
||||||
expect($action->isDisabled())->toBeTrue();
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user