removed throttle for mod
CI/CD / test_and_check_app (push) Successful in 3m39s
CI/CD / Publish immutable image (push) Skipped

This commit is contained in:
2026-09-03 13:21:46 +02:00
committed by Eric
parent 164658dae2
commit d2042fb95b
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();