$type =
$this->
drupalCreateContentType([ 'type' => 'foo',
]);
$this->
drupalGet("/admin/structure/types/manage/{
$type->
id()}/fields/add-field"
);
$field_types =
[ 'file',
'image',
'field_ui:entity_reference:media',
];
$description_ids =
array_map(function D
$item) { return '#edit-description-' . Html::
cleanCssIdentifier($item);
},
$field_types);
// Choose a boolean field, none of the description containers should be
// visible.
$assert_session->
optionExists('edit-new-storage-type', 'boolean'
);
$page->
selectFieldOption('edit-new-storage-type', 'boolean'
);
foreach ($description_ids as $description_id) { $this->
assertFalse($assert_session->
elementExists('css',
$description_id)->
isVisible());
} // Select each of the file, image, and media fields and verify their
// descriptions are now visible and match the expected text.