避免座驾进房重复欢迎

This commit is contained in:
pllx
2026-04-30 11:12:50 +08:00
parent fc7930046d
commit 522eea72f6
2 changed files with 34 additions and 32 deletions
+3
View File
@@ -1128,8 +1128,10 @@ class ChatControllerTest extends TestCase
$response->assertOk();
$history = collect($response->viewData('historyMessages'));
$rideMessage = $history->first(fn (array $message): bool => ($message['welcome_kind'] ?? '') === 'ride_presence');
$entryBroadcast = $history->first(fn (array $message): bool => ($message['welcome_kind'] ?? '') === 'entry_broadcast');
$this->assertNotNull($rideMessage);
$this->assertNull($entryBroadcast);
$this->assertSame('座驾播报', $rideMessage['from_user']);
$this->assertSame('j35', $rideMessage['ride_key']);
$this->assertSame("{$user->username} 乘坐【歼-35测试座驾】闪亮登场", $rideMessage['effect_title']);
@@ -1217,6 +1219,7 @@ class ChatControllerTest extends TestCase
$this->assertStringContainsString($user->username, $rideMessage['content']);
$this->assertSame('99a', $response->viewData('initialRideEffect'));
$this->assertSame("用户 {$user->username} · 部门 战备部 · 职务 🛡️ 试飞官 · 会员 👑 至尊会员", $response->viewData('initialRideEffectOptions')['effect_user_info']);
$this->assertNull($response->viewData('initialWelcomeMessage'));
$this->assertNull($response->viewData('initialPresenceTheme'));
}