added glass scale symptoms to translations
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
2026-06-12 13:07:49 +02:00
parent fadf60b2f7
commit 63a560e803
4 changed files with 37 additions and 1 deletions

View File

@ -27,6 +27,18 @@ final class AppQuestionnairesTest extends QdbTestCase
]);
$this->assertApiOk($res);
$this->assertNotEmpty($res['data']['questions']);
$glass = null;
foreach ($res['data']['questions'] as $q) {
if (($q['layout'] ?? '') === 'glass_scale_question') {
$glass = $q;
break;
}
}
$this->assertNotNull($glass);
$this->assertIsArray($glass['glassSymptoms'] ?? null);
$symptomKeys = array_column($glass['glassSymptoms'], 'key');
$this->assertContains($this->fixture()->glassSymptomKey, $symptomKeys);
}
public function testCoachListsAssignedClients(): void

View File

@ -80,4 +80,25 @@ final class TranslationsWriteTest extends QdbTestCase
}
$this->assertSame('Oui', $fr);
}
public function testAllTranslationsIncludeGlassSymptomKeys(): void
{
$token = $this->api()->loginWebAndGetToken(
DatabaseSeeder::ADMIN_USERNAME,
DatabaseSeeder::PASSWORD
)['token'];
$f = $this->fixture();
$res = $this->api()->withToken($token, 'GET', 'translations', null, ['all' => '1']);
$this->assertApiOk($res);
$stringKeys = [];
foreach ($res['data']['entries'] as $entry) {
if (($entry['type'] ?? '') === 'string') {
$stringKeys[] = $entry['key'] ?? '';
}
}
$this->assertContains($f->glassSymptomKey, $stringKeys);
$this->assertContains('fatigue', $stringKeys);
}
}