Expand profile gender options and cover country plus activity persistence.

Allow the broader gender enum and add tests for country saves and discovery event recording.
This commit is contained in:
test
2026-09-20 14:50:59 +02:00
parent 4479d81253
commit 39819a85cb
3 changed files with 112 additions and 0 deletions
@@ -30,6 +30,25 @@ it('stores a selected country on the personal settings endpoint', function (): v
expect($user->country_id)->toBe($country->id);
expect(optional($user->profile)->country_code)->toBe('SI');
expect(optional($user->profile)->gender)->toBe('M');
});
it('stores prefer-not-to-say gender as X on the personal settings endpoint', function (): void {
$this->withoutMiddleware(ForumBotProtectionMiddleware::class);
$user = User::factory()->create();
$response = $this->actingAs($user)->postJson('/settings/personal/update', [
'birthday' => '1991-05-10',
'gender' => 'x',
]);
$response->assertOk();
$user->refresh();
expect(optional($user->profile)->gender)->toBe('X');
expect(optional($user->profile)->birthdate?->toDateString())->toBe('1991-05-10');
});
it('rejects invalid country identifiers on the personal settings endpoint', function (): void {