TenantAtlas/apps/platform/tests/Browser/Spec299WorkspaceOverviewCutoverSealSmokeTest.php
Ahmed Darrazi 93581573a7
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m46s
feat: finalize managed environment cutover seal
2026-05-13 22:27:48 +02:00

43 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
use App\Models\User;
use App\Models\Workspace;
use App\Models\WorkspaceMembership;
use App\Support\Workspaces\WorkspaceContext;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
pest()->browser()->timeout(20_000);
it('smokes workspace overview environment-first final cutover copy', function (): void {
$user = User::factory()->create();
$workspace = Workspace::factory()->create([
'name' => 'Spec 299 Workspace',
]);
WorkspaceMembership::factory()->create([
'workspace_id' => (int) $workspace->getKey(),
'user_id' => (int) $user->getKey(),
'role' => 'owner',
]);
$this->actingAs($user)->withSession([
WorkspaceContext::SESSION_KEY => (int) $workspace->getKey(),
]);
session()->put(WorkspaceContext::SESSION_KEY, (int) $workspace->getKey());
visit(route('admin.workspace.home', ['workspace' => $workspace]))
->waitForText('Workspace overview')
->assertSee('No accessible environments in this workspace')
->assertSee('Governance risk counts affected environments')
->assertSee('Calm wording stays bounded to visible environments and checked domains')
->assertDontSee('No accessible tenants in this workspace')
->assertDontSee('Governance risk counts affected tenants')
->assertDontSee('Calm wording stays bounded to visible tenants and checked domains')
->assertNoJavaScriptErrors()
->assertNoConsoleLogs();
});