feat: calmer questionnaire form with selects and clickable answer rows

This commit is contained in:
fromme committed 2026-10-27 17:32:41 +01:00
1 parent af97468b2d
commit 0b736b51fb
5 files changed
+65 -5

No files matched your search

+21
View File
@@ -59,6 +59,27 @@ class QuestionnaireTemplateTest extends KernelTestCase
$this->assertSame([$this->definition()->title, $this->busDefinition()->title], $headings);
}
/**
* Long scales are selects, starting empty; Ja/Nein stays radios, each answer a clickable row.
*/
public function testLongScalesAreSelectsAndYesNoAreClickableRows(): void
{
$crawler = $this->renderForm();
$seminar = $crawler->filter('[data-question-key="teamer_feedback.team_week_seminar"] select');
$this->assertCount(1, $seminar);
$this->assertSame('', $seminar->filter('option')->first()->attr('value'));
$this->assertCount(1, $crawler->filter('[data-question-key="bus_feedback.wc"] select'));
// the labels wrapping a radio: the whole row is the click target
$rows = $crawler
->filter('[data-question-key="teamer_feedback.had_organisational_problems"] label')
->reduce(static fn (Crawler $label): bool => 1 === $label->filter('input[type="radio"]')->count())
;
$this->assertCount(2, $rows);
$this->assertStringContainsString('hover:', $rows->first()->attr('class'));
}
public function testRatingIsFiveRadiosInARadioGroup(): void
{
$group = $this->renderForm()->filter('[data-question-key="teamer_feedback.office_briefing_rating"] [role="radiogroup"]');