Merge pull request 'Drop the comment interval setting' (#40) from feature/comment-auto-interval into main
CI / Deploy / test (push) Successful in 55s
CI / Deploy / deploy (push) Successful in 7s

Reviewed-on: #40
This commit was merged in pull request #40.
This commit is contained in:
gnilebein committed 2026-11-09 14:25:07 +01:00
commit c6567b5e28
7 files changed
+23 -86

No files matched your search

@@ -154,33 +154,18 @@ class ScaleCommentsTest extends TestCase
$this->assertSame([4, 3], array_column($this->presenterResults($token)['comments'], 'value'));
}
public function testCommentIntervalIsConfigurable(): void
public function testCommentIntervalIsNotConfigurable(): void
{
$auto = Slide::COMMENT_INTERVAL_AUTO;
$this->assertSame($auto, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, [])['comment_interval']);
$this->assertSame(15, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, ['comment_interval' => '15'])['comment_interval']);
$this->assertSame($auto, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, ['comment_interval' => '0'])['comment_interval']);
$this->assertSame($auto, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, ['comment_interval' => '7'])['comment_interval']);
$this->assertSame($auto, SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, ['comment_interval' => '-1'])['comment_interval']);
[, $token] = $this->scaleWithComments(['comment_interval' => 20]);
$this->assertSame(20, $this->presenterResults($token)['commentInterval']);
// The presentation times each comment by its length; there is no setting for it.
$settings = SlidesTable::sanitizeSettings(Slide::TYPE_SCALE, ['comment_interval' => '15']);
$this->assertArrayNotHasKey('comment_interval', $settings);
[, $token] = $this->scaleWithComments();
$this->assertSame($auto, $this->presenterResults($token)['commentInterval']);
$this->assertArrayNotHasKey('commentInterval', $this->presenterResults($token));
$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');
$this->assertResponseContains('automatisch (je nach Länge des Kommentars)');
$this->assertResponseOk();
$this->assertResponseNotContains('comment_interval');
}
public function testParticipantsNeverSeeComments(): void