TenantAtlas/apps/platform/tests/Feature/Localization/AuthAndSystemSurfaceLocalizationTest.php
ahmido 2fa8fc0f87
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 51s
refactor: remove findings lifecycle backfill runtime surfaces (#294)
## Summary
- decommission the legacy findings lifecycle backfill substrate across command, job, service, and UI layers
- remove related platform capabilities, operation catalog entries, and action surface exemptions
- add regression and removal verification tests to ensure runtime integrity and surface absence
- include spec, plan, tasks, and data-model artifacts for the removal slice

## Scope
- active spec: specs/253-remove-findings-backfill-runtime-surfaces
- target branch: dev

## Validation
- integrated regression and removal verification tests for console, findings, and system ops surfaces
- audit log and capability trace verification for the removal path

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #294
2026-04-28 22:00:51 +00:00

44 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
use App\Services\Localization\LocaleResolver;
use App\Support\Workspaces\WorkspaceContext;
it('renders the admin auth surface in the explicit locale override', function (): void {
$this->withSession([LocaleResolver::SESSION_OVERRIDE_KEY => 'de'])
->get('/admin/login')
->assertSuccessful()
->assertSee('Mit Microsoft anmelden')
->assertSee('Tenant-Admin-Zugriff erfordert eine Tenant-Mitgliedschaft');
});
it('keeps system plane resolution independent from user and workspace preferences', function (): void {
[$workspace, $user] = localizationWorkspaceMember();
$user->forceFill(['preferred_locale' => 'de'])->save();
session()->forget(LocaleResolver::SESSION_OVERRIDE_KEY);
$this->actingAs($user)
->withSession([
WorkspaceContext::SESSION_KEY => (int) $workspace->getKey(),
LocaleResolver::SESSION_OVERRIDE_KEY => null,
])
->getJson('/localization/context?plane=system')
->assertSuccessful()
->assertJsonPath('locale', 'en')
->assertJsonPath('source', LocaleResolver::SOURCE_SYSTEM_DEFAULT)
->assertJsonPath('user_preference_locale', null)
->assertJsonPath('workspace_default_locale', null);
$this->actingAs($user)
->withSession([
WorkspaceContext::SESSION_KEY => (int) $workspace->getKey(),
LocaleResolver::SESSION_OVERRIDE_KEY => 'de',
])
->getJson('/localization/context?plane=system')
->assertSuccessful()
->assertJsonPath('locale', 'de')
->assertJsonPath('source', LocaleResolver::SOURCE_EXPLICIT_OVERRIDE);
});