## Summary - restore broad full-suite green-signal coverage across platform governance, operations, onboarding, dashboard/productization, and customer review flows - align related platform tests and supporting behavior with the current expected state for this restoration pass - update the spec-candidates queue as part of the same suite-restoration sweep ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Browser/Dashboard/TenantDashboardProductizationSmokeTest.php tests/Browser/Reviews/CustomerReviewWorkspaceSmokeTest.php tests/Browser/Spec194GovernanceFrictionSmokeTest.php tests/Browser/Spec265DecisionRegisterSmokeTest.php` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #351
35 lines
1.4 KiB
PHP
35 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Filament\Pages\TenantDashboard;
|
|
use App\Models\ManagedEnvironment;
|
|
use App\Support\Workspaces\WorkspaceContext;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
it('ignores an intended tenant route that is not valid in the target workspace', function (): void {
|
|
$sourceTenant = ManagedEnvironment::factory()->active()->create(['name' => 'Source ManagedEnvironment']);
|
|
[$user, $sourceTenant] = createUserWithTenant(tenant: $sourceTenant, role: 'owner');
|
|
|
|
$targetWorkspaceTenant = ManagedEnvironment::factory()->active()->create([
|
|
'name' => 'Target ManagedEnvironment',
|
|
]);
|
|
createUserWithTenant(tenant: $targetWorkspaceTenant, user: $user, role: 'owner');
|
|
|
|
$targetWorkspace = $targetWorkspaceTenant->workspace()->firstOrFail();
|
|
|
|
$response = $this->actingAs($user)
|
|
->withSession([
|
|
WorkspaceContext::SESSION_KEY => (int) $sourceTenant->workspace_id,
|
|
WorkspaceContext::INTENDED_URL_SESSION_KEY => "/admin/t/{$sourceTenant->external_id}",
|
|
])
|
|
->post(route('admin.switch-workspace'), [
|
|
'workspace_id' => (int) $targetWorkspace->getKey(),
|
|
]);
|
|
|
|
$response->assertRedirect(TenantDashboard::getUrl(panel: 'admin', tenant: $targetWorkspaceTenant));
|
|
expect(session(WorkspaceContext::SESSION_KEY))->toBe((int) $targetWorkspace->getKey());
|
|
});
|