removed throttle for mod

This commit is contained in:
2026-08-27 15:38:12 +02:00
parent b2c1d67283
commit 36f82d1a0a
5 changed files with 80 additions and 15 deletions
+52
View File
@@ -59,6 +59,58 @@ test('a participant can throw a realtime paper ball at another player', function
->and($room->state_version)->toBe($stateVersion);
});
test('moderator paper ball throws are not rate limited', function () {
Event::fake([PaperBallThrown::class]);
$room = createEmoteRoom();
$moderator = $room->players()->create([
'name' => 'Eric',
'is_moderator' => true,
]);
$target = $room->players()->create([
'name' => 'Anna',
'is_moderator' => false,
]);
for ($throwCount = 0; $throwCount < 11; $throwCount++) {
$this->withSession(["room_players.{$room->id}" => $moderator->id])
->postJson(route('room.emote.paper-ball.store', $room), [
'target_player_id' => $target->id,
])
->assertNoContent();
}
Event::assertDispatchedTimes(PaperBallThrown::class, 11);
});
test('participant paper ball throws remain rate limited', function () {
Event::fake([PaperBallThrown::class]);
$room = createEmoteRoom();
$moderator = $room->players()->create([
'name' => 'Eric',
'is_moderator' => true,
]);
$participant = $room->players()->create([
'name' => 'Anna',
'is_moderator' => false,
]);
for ($throwCount = 0; $throwCount < 10; $throwCount++) {
$this->withSession(["room_players.{$room->id}" => $participant->id])
->postJson(route('room.emote.paper-ball.store', $room), [
'target_player_id' => $moderator->id,
])
->assertNoContent();
}
$this->withSession(["room_players.{$room->id}" => $participant->id])
->postJson(route('room.emote.paper-ball.store', $room), [
'target_player_id' => $moderator->id,
])
->assertTooManyRequests();
Event::assertDispatchedTimes(PaperBallThrown::class, 10);
});
test('a participant cannot throw a paper ball at themselves', function () {
Event::fake([PaperBallThrown::class]);
$room = createEmoteRoom();