## Summary - consolidate internal platform naming from `Tenant` to `Environment` / `ManagedEnvironment` across models, controllers, services, and Filament resources - rename environment-scoped UI surfaces such as dashboards, chooser flows, navigation, and related widgets to match the updated environment-first domain language - align middleware, onboarding/review lifecycle services, jobs, and route/context controllers with the new environment-scoped architecture ## Validation - not rerun as part of this commit/push/PR request ## Notes - branch is 1 commit ahead of `platform-dev` - main commit: `refactor: consolidate internal tenant model naming` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #355
41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Filament\Pages\EnvironmentDashboard;
|
|
use App\Models\ManagedEnvironment;
|
|
use App\Support\Workspaces\WorkspaceContext;
|
|
use Filament\Facades\Filament;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function (): void {
|
|
Http::preventStrayRequests();
|
|
});
|
|
|
|
it('shows a Monitoring group with central shortcuts in the tenant sidebar', function (): void {
|
|
$tenant = ManagedEnvironment::factory()->create();
|
|
[$user, $tenant] = createUserWithTenant($tenant, role: 'owner');
|
|
|
|
$this->actingAs($user)
|
|
->withSession([WorkspaceContext::SESSION_KEY => (int) $tenant->workspace_id])
|
|
->get(EnvironmentDashboard::getUrl(panel: 'admin', tenant: $tenant))
|
|
->assertOk();
|
|
|
|
$panel = Filament::getCurrentOrDefaultPanel();
|
|
|
|
$monitoringLabels = collect($panel->getNavigationItems())
|
|
->filter(static fn ($item): bool => $item->getGroup() === 'Monitoring')
|
|
->map(static fn ($item): string => $item->getLabel())
|
|
->values()
|
|
->all();
|
|
|
|
expect($monitoringLabels)->toContain('Operations');
|
|
expect($monitoringLabels)->toContain('Alerts');
|
|
expect($monitoringLabels)->toContain('Audit Log');
|
|
|
|
expect($monitoringLabels)->not->toContain('Runs');
|
|
});
|