mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 22:12:10 +00:00
removed throttle for mod
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user