Issue #3491351: Add schema validation tests ai.settings
2 open threads
Closes #3491351
Merge request reports
Activity
432 426 return $form['default_providers'][$operation_type]['model']; 433 427 } 434 428 429 /** 430 * Add the hardcoded selections of filtered types. 431 * 432 * @return array 433 * The operation types array. 434 */ 435 public function getOperationTypes(): array { 436 return array_merge($this->providerManager->getOperationTypes(), $this->hardcodedSelections); - tests/src/Kernel/Config/AiSettingsTest.php 0 → 100644
37 38 // Install config schema. 39 $this->installConfig(['ai']); 40 } 41 42 /** 43 * Tests AI settings using the settings form. 44 */ 45 public function testAiSettings() { 46 $ai_setting_form = AiSettingsForm::create(\Drupal::getContainer()); 47 $form_values = [ 48 'default_vdb_provider' => $this->randomString(), 49 ]; 50 foreach ($ai_setting_form->getOperationTypes() as $operation_type) { 51 $form_values['operation__' . $operation_type['id']] = 52 $form_values['model__' . $operation_type['id']] = $this->randomString(); I think we might needs to test something here, in the submit form, if the value is empty, its not set at all which could cause a test failure.
Could you make another test with some of these values empty?
Also we have the pseudo operation types from the hardcoded selection that should be in the schema.
Please register or sign in to reply