新增座驾购买公屏通知

This commit is contained in:
pllx
2026-04-30 11:27:53 +08:00
parent 06864a9cec
commit 0fe003a773
4 changed files with 73 additions and 0 deletions
+11
View File
@@ -122,6 +122,17 @@ class RideControllerTest extends TestCase
'remark' => '购买聊天室座驾:测试座驾',
'room_id' => $room->id,
]);
$messages = app(\App\Services\ChatStateService::class)->getNewMessages($room->id, 0);
$purchaseNotice = collect($messages)->first(fn (array $message): bool => ($message['action'] ?? '') === 'ride_purchase');
$this->assertNotNull($purchaseNotice);
$this->assertSame('系统传音', $purchaseNotice['from_user']);
$this->assertStringContainsString('【座驾】', $purchaseNotice['content']);
$this->assertStringContainsString($user->username, $purchaseNotice['content']);
$this->assertStringContainsString('测试座驾', $purchaseNotice['content']);
$this->assertStringContainsString('openRideModal()', $purchaseNotice['content']);
$this->assertStringContainsString('购买座驾', $purchaseNotice['content']);
}
/**