Skip to content

Commit

Permalink
fix tests for Drupal 11.0 since changes on field creation UI
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed May 31, 2024
1 parent aa18481 commit 26c70cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- fix tests for Drupal 10.3 since changes on field creation experience
- fix tests for Drupal 10.3 since changes on taxonomy form supporting vertical tabs
- fix deprecation by passing @dataprovider as static function
- fix tests for Drupal 11.0 since changes on field creation UI

## [4.0.1] - 2024-03-01
### Changed
Expand Down
7 changes: 6 additions & 1 deletion tests/src/Functional/UiFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,15 @@ public function testAddField() {

// Add the Template Whisperer field.
// Since Drupal 10.2 the field type has been changed from select to radio.
if (version_compare(\Drupal::VERSION, '10.2', '>=')) {
if (version_compare(\Drupal::VERSION, '10.2', '>=') && version_compare(\Drupal::VERSION, '11', '<')) {
$this->assertSession()->elementExists('css', "[name='new_storage_type'][value='template_whisperer']");
$this->getSession()->getPage()->selectFieldOption('new_storage_type', 'template_whisperer');
}
// Since Drupal 11.0 the field type has been changed from radio to select.
elseif (version_compare(\Drupal::VERSION, '11.0', '>=')) {
$this->assertSession()->elementExists('css', "[name='new_storage_type'] option[value='template_whisperer']");
$this->getSession()->getPage()->selectFieldOption('new_storage_type', 'template_whisperer');
}
else {
$this->fillField('Add a new field', 'template_whisperer');
}
Expand Down

0 comments on commit 26c70cf

Please sign in to comment.