Users: Hid lanuage preference for guest user
Some checks failed
analyse-php / build (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-migrations / build (8.4) (push) Has been cancelled
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
test-php / build (8.4) (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled

Hiding since it's not really used, and may mislead on how to set default
app language (which should be done via env options).
Updated test to cover.

For #5356
This commit is contained in:
Dan Brown 2024-12-13 15:19:09 +00:00
parent 7e1a8e5ec6
commit a8ef820443
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 8 additions and 2 deletions

View File

@ -34,7 +34,9 @@
</div>
</div>
@include('users.parts.language-option-row', ['value' => old('language') ?? $user->getLocale()->appLocale()])
@if(!$user->isGuest())
@include('users.parts.language-option-row', ['value' => old('language') ?? $user->getLocale()->appLocale()])
@endif
</div>
<div class="text-right">

View File

@ -202,9 +202,13 @@ class UserManagementTest extends TestCase
public function test_guest_profile_shows_limited_form()
{
$guest = $this->users->guest();
$resp = $this->asAdmin()->get('/settings/users/' . $guest->id);
$resp->assertSee('Guest');
$this->withHtml($resp)->assertElementNotExists('#password');
$html = $this->withHtml($resp);
$html->assertElementNotExists('#password');
$html->assertElementNotExists('[name="language"]');
}
public function test_guest_profile_cannot_be_deleted()