Some checks failed
Main Confidence / confidence (push) Failing after 56s
## Summary - add the localization v1 foundation with request-time locale resolution and workspace or user preference handling - localize the first-wave platform surfaces for auth, shell, dashboards, findings, baseline compare, and review workspace chrome - add Pest coverage for locale resolution, preference flows, fallback behavior, notifications, and governance surface localization ## Scope - active spec: specs/252-platform-localization-v1 - target branch: dev ## Notes - machine-readable artifacts remain invariant and are not localized in this slice - the branch includes the related spec kit artifacts for the feature Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #293
44 lines
1.6 KiB
PHP
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);
|
|
});
|