Add polls seed command for demo and load test polls
Every run creates a new poll with one slide per interactive type and shows the first (choice) slide live with voting open. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a9b14af8bf
commit
ebfab0ef20
3 files changed
+153
-2
No files matched your search
@@ -51,6 +51,24 @@ class PollsCommandsTest extends TestCase
|
||||
$this->assertTrue($this->pollsTable()->get($poll->id)->isExpired());
|
||||
}
|
||||
|
||||
public function testSeedCreatesNewPollWithLiveFirstSlideEveryTime(): void
|
||||
{
|
||||
$this->exec('polls seed --json');
|
||||
$this->assertExitSuccess();
|
||||
$first = json_decode(implode('', $this->_out->messages()), true);
|
||||
$this->exec('polls seed --json');
|
||||
$second = json_decode(implode('', $this->_out->messages()), true);
|
||||
|
||||
$this->assertNotSame($first['id'], $second['id']);
|
||||
$this->assertNotSame($first['joinCode'], $second['joinCode']);
|
||||
$this->assertSame(7, $second['slides']);
|
||||
|
||||
$poll = $this->pollsTable()->get($second['id']);
|
||||
$slide = $this->slidesTable()->get($poll->current_slide_id);
|
||||
$this->assertSame('choice', $slide->type);
|
||||
$this->assertTrue($slide->isVotingOpen());
|
||||
}
|
||||
|
||||
public function testSettingsAreRespected(): void
|
||||
{
|
||||
[$poll] = $this->createPoll();
|
||||
|
||||
Reference in new issue
Block a user