Drop the image description field
CI / Deploy / PHP 8.4 (push) Successful in 1m36s
CI / Deploy / PHP 8.5 (push) Successful in 1m36s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped

Slide images are shown on the presenter's screen, so a description for
screen readers is not asked for any more. The column stays (always empty).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-21 13:35:48 +01:00
1 parent ebaf6fbe53
commit 7a80794ded
12 files changed
+110 -35

No files matched your search

@@ -107,7 +107,7 @@ class AdminControllerTest extends TestCase
$slide = $this->slidesTable()->find()->contain(['SlideOptions'])->firstOrFail();
$this->assertSame($poll->id, $slide->poll_id);
$this->assertSame(['Pizza', 'Pasta'], array_map(fn($o) => $o->label, $slide->slide_options));
$this->assertSame(['multiple' => true, 'comments' => false, 'time_limit' => 0], $slide->settings);
$this->assertSame(['multiple' => true, 'comments' => false, 'comment_only' => false, 'time_limit' => 0], $slide->settings);
$this->assertSame(1, $slide->position);
}
@@ -60,7 +60,7 @@ class ChoiceCommentsTest extends TestCase
{
[, $token] = $this->createPoll();
$this->get("/admin/$token/slides/add?type=choice");
$this->assertResponseContains('name="settings[comments]"');
$this->assertResponseContains('name="settings[comment_mode]"');
$this->post("/admin/$token/slides/add?type=choice", [
'type' => 'choice',
@@ -127,6 +127,37 @@ class VoteServiceTest extends TestCase
$service->editText($poll, $slide, 'p1', ['comment' => '']);
}
public function testChoiceCommentOnlyIsNotCountedAsVote(): void
{
[$poll] = $this->createPoll();
$slide = $this->createSlide($poll, Slide::TYPE_CHOICE, ['settings' => ['comments' => true, 'comment_only' => true]], ['A', 'B']);
$poll = $this->goLive($poll, $slide);
$service = new VoteService();
$service->submit($poll, $slide, 'p1', ['option_id' => $slide->slide_options[0]->id]);
$service->submit($poll, $slide, 'p2', ['comment' => 'Keine passt']);
$results = (new ResultsService())->forSlide($slide);
$this->assertSame(2, $results['participants']);
$this->assertSame(1, $results['votes']);
$this->assertSame(1, $results['commentOnly']);
$this->assertEquals([100, 0], array_column($results['options'], 'percent'));
$this->assertSame(['Keine passt'], array_column($results['comments'], 'text'));
$service->editText($poll, $slide, 'p2', ['comment' => 'Keine passt wirklich']);
$this->expectExceptionMessage('nicht leer sein');
$service->editText($poll, $slide, 'p2', ['comment' => '']);
}
public function testChoiceWithoutSelectionNeedsCommentOnlySetting(): void
{
[$poll] = $this->createPoll();
$slide = $this->createSlide($poll, Slide::TYPE_CHOICE, ['settings' => ['comments' => true]], ['A', 'B']);
$poll = $this->goLive($poll, $slide);
$this->expectExceptionMessage('Bitte wähle eine Antwort aus.');
(new VoteService())->submit($poll, $slide, 'p1', ['comment' => 'Nur Kommentar']);
}
public function testMultipleChoiceResults(): void
{
[$poll] = $this->createPoll();