Make the comment rotation interval configurable
Scale slides get the setting comment_interval (seconds per comment, one of Slide::COMMENT_INTERVALS, default 8). The presenter state carries it as results.commentInterval and the rotating comments use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cfb445123e
commit
2301f91457
7 files changed
+66
-5
No files matched your search
@@ -154,6 +154,29 @@ class ScaleCommentsTest extends TestCase
|
||||
$this->assertSame([4, 3], array_column($this->presenterResults($token)['comments'], 'value'));
|
||||
}
|
||||
|
||||
public function testCommentIntervalIsConfigurable(): void
|
||||
{
|
||||
$this->assertSame(8, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, [])['comment_interval']);
|
||||
$this->assertSame(15, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, ['comment_interval' => '15'])['comment_interval']);
|
||||
$this->assertSame(8, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, ['comment_interval' => '7'])['comment_interval']);
|
||||
$this->assertSame(8, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, ['comment_interval' => '-1'])['comment_interval']);
|
||||
|
||||
[, $token] = $this->scaleWithComments(['comment_interval' => 20]);
|
||||
$this->assertSame(20, $this->presenterResults($token)['commentInterval']);
|
||||
|
||||
$this->get("/admin/$token");
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
||||
public function testFormShowsCommentInterval(): void
|
||||
{
|
||||
[, $token] = $this->createPoll();
|
||||
$this->get("/admin/$token/slides/add?type=scale");
|
||||
|
||||
$this->assertResponseContains('name="settings[comment_interval]"');
|
||||
$this->assertResponseContains('15 Sekunden');
|
||||
}
|
||||
|
||||
public function testParticipantsNeverSeeComments(): void
|
||||
{
|
||||
[$poll] = $this->scaleWithComments();
|
||||
|
||||
Reference in new issue
Block a user