browser()->timeout(45_000); it('Spec322 smokes workspace owned analysis and configuration surfaces stay workspace only', function (): void { $fixture = Spec322Harness::fixture(); Spec322Harness::authenticate($this, $fixture['user'], $fixture['workspace'], $fixture['environmentA']); visit(EnvironmentDashboard::getUrl(panel: 'admin', tenant: $fixture['environmentA'])) ->assertSee($fixture['environmentA']->name) ->assertNoJavaScriptErrors() ->assertNoConsoleLogs(); $surfaces = [ 'baseline profiles' => [ 'url' => BaselineProfileResource::getUrl('index', panel: 'admin'), ], 'my findings' => [ 'url' => MyFindingsInbox::getUrl(panel: 'admin'), ], 'cross-environment compare' => [ 'url' => CrossEnvironmentComparePage::getUrl(panel: 'admin'), ], 'workspace settings' => [ 'url' => WorkspaceSettings::getUrl(panel: 'admin'), ], ]; foreach ($surfaces as $surface) { $expectedPath = json_encode((string) parse_url($surface['url'], PHP_URL_PATH), JSON_THROW_ON_ERROR); $page = visit($surface['url']); Spec322Harness::assertWorkspaceOnly($page, null, $fixture['environmentA']->name); $page->assertScript("window.location.pathname === {$expectedPath}", true); $page->script('window.location.reload();'); Spec322Harness::assertWorkspaceOnly($page, null, $fixture['environmentA']->name); $page->assertScript("window.location.pathname === {$expectedPath}", true); } });