Walk through Q&A stages with "next" before leaving the slide
CI / Deploy / PHP 8.5 (push) Successful in 1m14s
CI / Deploy / PHP 8.4 (push) Successful in 1m19s
CI / Deploy / test (push) Successful in 2s
CI / Deploy / deploy (push) Skipped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-21 13:47:27 +01:00
1 parent 7475f096ea
commit d1d748f760
3 files changed
+28 -9

No files matched your search

@@ -172,6 +172,24 @@ class AdminControllerTest extends TestCase
$this->assertSame(Slide::QUIZ_READY, $slide->quizPhase());
}
public function testForwardOnQaWalksThroughStagesBeforeNextSlide(): void
{
[$poll, $token] = $this->createPoll();
$qa = $this->createSlide($poll, Slide::TYPE_QA, [], []);
$this->createSlide($poll);
$this->goLive($poll, $qa);
$this->post("/admin/$token/control", ['action' => 'next']);
$this->assertSame(Slide::QA_VOTE, $this->slidesTable()->get($qa->id)->qaStage());
$this->post("/admin/$token/control", ['action' => 'next']);
$this->assertSame(Slide::QA_DISCUSS, $this->slidesTable()->get($qa->id)->qaStage());
$this->assertSame($qa->id, $this->pollsTable()->get($poll->id)->current_slide_id);
// No questions to step through: now it goes to the next slide.
$this->post("/admin/$token/control", ['action' => 'next']);
$this->assertNotSame($qa->id, $this->pollsTable()->get($poll->id)->current_slide_id);
}
public function testEditKeepsVotesOfUnchangedOptions(): void
{
[$poll, $token] = $this->createPoll();