增加 神秘箱子的屏蔽

This commit is contained in:
2026-04-17 15:27:40 +08:00
parent 0f4de941db
commit 0e8a1669b9
4 changed files with 30 additions and 5 deletions
+8 -3
View File
@@ -16,6 +16,10 @@ use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Redis;
use Tests\TestCase;
/**
* 用户控制器功能测试
* 覆盖个人资料、密码与聊天室偏好设置等关键接口。
*/
class UserControllerTest extends TestCase
{
use RefreshDatabase;
@@ -141,19 +145,20 @@ class UserControllerTest extends TestCase
]);
$response = $this->actingAs($user)->putJson('/user/chat-preferences', [
'blocked_system_senders' => ['钓鱼播报', '跑马'],
'blocked_system_senders' => ['钓鱼播报', '神秘箱子', '跑马'],
'sound_muted' => true,
]);
$response->assertOk()
->assertJsonPath('status', 'success')
->assertJsonPath('data.blocked_system_senders.0', '钓鱼播报')
->assertJsonPath('data.blocked_system_senders.1', '跑马')
->assertJsonPath('data.blocked_system_senders.1', '神秘箱子')
->assertJsonPath('data.blocked_system_senders.2', '跑马')
->assertJsonPath('data.sound_muted', true);
$user->refresh();
$this->assertEquals([
'blocked_system_senders' => ['钓鱼播报', '跑马'],
'blocked_system_senders' => ['钓鱼播报', '神秘箱子', '跑马'],
'sound_muted' => true,
], $user->chat_preferences);
}