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
32 lines
1.1 KiB
PHP
32 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\AuditLog;
|
|
use App\Services\Localization\LocaleResolver;
|
|
use App\Services\Settings\SettingsWriter;
|
|
use App\Support\Audit\AuditActionId;
|
|
use Illuminate\Support\Facades\App;
|
|
|
|
it('keeps audit action identifiers and machine values invariant while UI locale is German', function (): void {
|
|
[$workspace, $user] = localizationWorkspaceMember();
|
|
|
|
App::setLocale('de');
|
|
|
|
app(SettingsWriter::class)->updateWorkspaceSetting(
|
|
actor: $user,
|
|
workspace: $workspace,
|
|
domain: LocaleResolver::SETTING_DOMAIN,
|
|
key: LocaleResolver::SETTING_DEFAULT_LOCALE,
|
|
value: 'de',
|
|
);
|
|
|
|
$audit = AuditLog::query()->latest('id')->first();
|
|
|
|
expect($audit)->not->toBeNull()
|
|
->and($audit->action)->toBe(AuditActionId::WorkspaceSettingUpdated->value)
|
|
->and(data_get($audit->metadata, 'domain'))->toBe(LocaleResolver::SETTING_DOMAIN)
|
|
->and(data_get($audit->metadata, 'key'))->toBe(LocaleResolver::SETTING_DEFAULT_LOCALE)
|
|
->and(data_get($audit->metadata, 'after_value'))->toBe('de');
|
|
});
|