Compare commits

..

3 Commits

Author SHA1 Message Date
Ahmed Darrazi
8f3777c063 test: fix BackupSet empty state create assertions 2026-02-14 19:58:48 +01:00
Ahmed Darrazi
5c14a0a110 Merge remote-tracking branch 'origin/dev' into docs/constitution-scope-1.8.2-session-1771094891 2026-02-14 19:48:11 +01:00
5770c7b76b Spec 092: Legacy Purge (runs/routes/UI/test shims) (#110)
Implements Spec 092 legacy purge.

Key changes:
- Remove legacy Inventory landing page + view; link Inventory entry directly to Inventory Items.
- Update Drift landing copy to "operation runs"; remove URL heuristic from context bar.
- Remove legacy redirect shim route and assert 404 for old bookmarks.
- Staged job payload change: remove legacy ctor arg; keep legacy field for deserialization compatibility; new payload omits field.
- Remove legacy notification artifact.
- Remove legacy test shim + update tests; strengthen guard suite with scoped exception for job compat field.
- Add spec/plan/tasks/checklist artifacts under specs/092-legacy-purge-final.

Tests:
- Focused Pest suite for guards, legacy routes, redirect behavior, job compatibility, drift copy.
- Pint run: `vendor/bin/sail bin pint --dirty`.

Notes:
- Deploy B final removal of `backupScheduleRunId` should occur only after the compatibility window defined in the spec.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #110
2026-02-14 18:43:56 +00:00

View File

@ -10,6 +10,17 @@
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 {
@ -74,11 +85,14 @@
Filament::setTenant($tenant, true);
Livewire::actingAs($user)
$component = Livewire::actingAs($user)
->test(ListBackupSets::class)
->assertTableEmptyStateActionsExistInOrder(['create'])
->assertActionVisible('create')
->assertActionEnabled('create');
->assertTableEmptyStateActionsExistInOrder(['create']);
$action = getTableEmptyStateAction($component, '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 () {
@ -87,9 +101,12 @@
Filament::setTenant($tenant, true);
Livewire::actingAs($user)
$component = Livewire::actingAs($user)
->test(ListBackupSets::class)
->assertTableEmptyStateActionsExistInOrder(['create'])
->assertActionVisible('create')
->assertActionDisabled('create');
->assertTableEmptyStateActionsExistInOrder(['create']);
$action = getTableEmptyStateAction($component, 'create');
expect($action)->not->toBeNull();
expect($action->isVisible())->toBeTrue();
expect($action->isDisabled())->toBeTrue();
});