diff --git a/core/modules/system/tests/modules/olivero_test/config/install/comment.type.comment.yml b/core/modules/system/tests/modules/olivero_test/config/install/comment.type.comment.yml deleted file mode 100644 index ddcbbc986095a6bfd062679f0990d011b956db97..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/comment.type.comment.yml +++ /dev/null @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: comment -label: 'Default comments' -target_entity_type_id: node -description: 'Allows commenting on content' diff --git a/core/modules/system/tests/modules/olivero_test/config/install/contact.form.olivero_test_contact_form.yml b/core/modules/system/tests/modules/olivero_test/config/install/contact.form.olivero_test_contact_form.yml deleted file mode 100644 index 5b12a0d6a9f24945ac4970f262990b69cc11a852..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/contact.form.olivero_test_contact_form.yml +++ /dev/null @@ -1,11 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: olivero_test_contact_form -label: 'Olivero Test Contact Form' -recipients: - - webmaster@example.com -reply: '' -weight: 0 -message: '' -redirect: '' diff --git a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.comment.comment.default.yml b/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.comment.comment.default.yml deleted file mode 100644 index 1010be292488569234b654548ba3234bf8d9ae1e..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.comment.comment.default.yml +++ /dev/null @@ -1,33 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.comment - - field.field.comment.comment.comment_body - module: - - text -id: comment.comment.default -targetEntityType: comment -bundle: comment -mode: default -content: - author: - weight: -2 - region: content - comment_body: - type: text_textarea - weight: 11 - region: content - settings: - rows: 5 - placeholder: '' - third_party_settings: { } - subject: - type: string_textfield - weight: 10 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.contact_message.olivero_test_contact_form.default.yml b/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.contact_message.olivero_test_contact_form.default.yml deleted file mode 100644 index 94ea7ba27532f2f4f3d4e22c1545b355888cb0d4..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.contact_message.olivero_test_contact_form.default.yml +++ /dev/null @@ -1,56 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - contact.form.olivero_test_contact_form - - field.field.contact_message.olivero_test_contact_form.field_multiple_value_form_field -id: contact_message.olivero_test_contact_form.default -targetEntityType: contact_message -bundle: olivero_test_contact_form -mode: default -content: - copy: - weight: 50 - settings: { } - third_party_settings: { } - region: content - field_multiple_value_form_field: - weight: 51 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - mail: - weight: -40 - settings: { } - third_party_settings: { } - region: content - message: - type: string_textarea - weight: 0 - settings: - rows: 12 - placeholder: '' - region: content - third_party_settings: { } - name: - weight: -50 - settings: { } - third_party_settings: { } - region: content - preview: - weight: 40 - settings: { } - third_party_settings: { } - region: content - subject: - type: string_textfield - weight: -10 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.node.article.default.yml b/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.node.article.default.yml deleted file mode 100644 index 1f7102dd49ed5e223d5f5664d0682b6c88f40f73..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_form_display.node.article.default.yml +++ /dev/null @@ -1,106 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.article.body - - field.field.node.article.comment - - field.field.node.article.field_image - - field.field.node.article.field_tags - - image.style.thumbnail - - node.type.article - module: - - comment - - image - - path - - text -id: node.article.default -targetEntityType: node -bundle: article -mode: default -content: - body: - type: text_textarea_with_summary - weight: 1 - region: content - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - show_summary: false - third_party_settings: { } - comment: - type: comment_default - weight: 20 - region: content - settings: { } - third_party_settings: { } - created: - type: datetime_timestamp - weight: 10 - region: content - settings: { } - third_party_settings: { } - field_image: - type: image_image - weight: 4 - region: content - settings: - progress_indicator: throbber - preview_image_style: thumbnail - third_party_settings: { } - field_tags: - type: entity_reference_autocomplete_tags - weight: 3 - region: content - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } - path: - type: path - weight: 30 - region: content - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 15 - region: content - third_party_settings: { } - status: - type: boolean_checkbox - settings: - display_label: true - weight: 120 - region: content - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 16 - region: content - third_party_settings: { } - title: - type: string_textfield - weight: 0 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 5 - region: content - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.comment.comment.default.yml b/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.comment.comment.default.yml deleted file mode 100644 index 6ae213d3ee0d356970eb84dffb2ace80b6a79c93..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.comment.comment.default.yml +++ /dev/null @@ -1,24 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.comment - - field.field.comment.comment.comment_body - module: - - text -id: comment.comment.default -targetEntityType: comment -bundle: comment -mode: default -content: - comment_body: - label: hidden - type: text_default - weight: 0 - region: content - settings: { } - third_party_settings: { } - links: - weight: 100 - region: content -hidden: { } diff --git a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.default.yml b/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.default.yml deleted file mode 100644 index 5019b6503d79308a2673fcf681445d885cd056a4..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.default.yml +++ /dev/null @@ -1,60 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_display.comment.comment.default - - field.field.node.article.body - - field.field.node.article.comment - - field.field.node.article.field_image - - field.field.node.article.field_tags - - image.style.large - - node.type.article - module: - - comment - - image - - text - - user -id: node.article.default -targetEntityType: node -bundle: article -mode: default -content: - body: - type: text_default - weight: 0 - region: content - settings: { } - third_party_settings: { } - label: hidden - comment: - type: comment_default - weight: 110 - region: content - label: above - settings: - view_mode: default - pager_id: 0 - third_party_settings: { } - field_image: - type: image - weight: -1 - region: content - settings: - image_style: large - image_link: '' - third_party_settings: { } - label: hidden - field_tags: - type: entity_reference_label - weight: 10 - region: content - label: above - settings: - link: true - third_party_settings: { } - links: - weight: 100 - region: content - settings: { } - third_party_settings: { } -hidden: { } diff --git a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.rss.yml b/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.rss.yml deleted file mode 100644 index 84660b6d2bd2b6ba734139b2472b1c54124652df..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.rss.yml +++ /dev/null @@ -1,25 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.rss - - field.field.node.article.body - - field.field.node.article.comment - - field.field.node.article.field_image - - field.field.node.article.field_tags - - node.type.article - module: - - user -id: node.article.rss -targetEntityType: node -bundle: article -mode: rss -content: - links: - weight: 100 - region: content -hidden: - body: true - comment: true - field_image: true - field_tags: true diff --git a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.teaser.yml b/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.teaser.yml deleted file mode 100644 index 7b96908bed1c460a0525aadebde8847400954d00..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/core.entity_view_display.node.article.teaser.yml +++ /dev/null @@ -1,52 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.article.body - - field.field.node.article.comment - - field.field.node.article.field_image - - field.field.node.article.field_tags - - image.style.medium - - node.type.article - module: - - image - - text - - user -id: node.article.teaser -targetEntityType: node -bundle: article -mode: teaser -content: - body: - type: text_summary_or_trimmed - weight: 0 - region: content - settings: - trim_length: 600 - third_party_settings: { } - label: hidden - field_image: - type: image - weight: -1 - region: content - settings: - image_style: medium - image_link: content - third_party_settings: { } - label: hidden - field_tags: - type: entity_reference_label - weight: 10 - region: content - settings: - link: true - third_party_settings: { } - label: above - links: - weight: 100 - region: content -hidden: - comment: true - field_image: true - field_tags: true diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.field.comment.comment.comment_body.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.field.comment.comment.comment_body.yml deleted file mode 100644 index 1337070d16b859309099244a0e475bc7b6be2d77..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.field.comment.comment.comment_body.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.comment - - field.storage.comment.comment_body - module: - - text -id: comment.comment.comment_body -field_name: comment_body -entity_type: comment -bundle: comment -label: Comment -description: '' -required: true -translatable: true -default_value: { } -default_value_callback: '' -settings: { } -field_type: text_long diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.field.contact_message.olivero_test_contact_form.field_multiple_value_form_field.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.field.contact_message.olivero_test_contact_form.field_multiple_value_form_field.yml deleted file mode 100644 index 48586444177ff68e47aaa276605307006b4ebc1f..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.field.contact_message.olivero_test_contact_form.field_multiple_value_form_field.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - contact.form.olivero_test_contact_form - - field.storage.contact_message.field_multiple_value_form_field -id: contact_message.olivero_test_contact_form.field_multiple_value_form_field -field_name: field_multiple_value_form_field -entity_type: contact_message -bundle: olivero_test_contact_form -label: 'Multiple Value Form Field' -description: '' -required: true -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.body.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.body.yml deleted file mode 100644 index b36fbd584493fcbd6c7d5a813b458845cdd67dd7..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.body.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.body - - node.type.article - module: - - text -id: node.article.body -field_name: body -entity_type: node -bundle: article -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: true - required_summary: false -field_type: text_with_summary diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.comment.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.comment.yml deleted file mode 100644 index 922015ed9666552f9ca5cf68c06b1d9340917ff9..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.comment.yml +++ /dev/null @@ -1,32 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.comment - - node.type.article - module: - - comment -id: node.article.comment -field_name: comment -entity_type: node -bundle: article -label: Comments -description: '' -required: false -translatable: true -default_value: - - - status: 2 - cid: 0 - last_comment_name: null - last_comment_timestamp: 0 - last_comment_uid: 0 - comment_count: 0 -default_value_callback: '' -settings: - default_mode: 1 - per_page: 50 - form_location: true - anonymous: 0 - preview: 1 -field_type: comment diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.field_image.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.field_image.yml deleted file mode 100644 index b4b1c1466b7dcf3e37f29dee9494a6d36796a359..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.field_image.yml +++ /dev/null @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_image - - node.type.article - module: - - image -id: node.article.field_image -field_name: field_image -entity_type: node -bundle: article -label: Image -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - file_directory: '[date:custom:Y]-[date:custom:m]' - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: true - title_field: false - alt_field_required: true - title_field_required: false - default_image: - uuid: null - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.field_tags.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.field_tags.yml deleted file mode 100644 index 1b9c4cc4ee1e1143722aeac9ef20e9aaaf27199d..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.field.node.article.field_tags.yml +++ /dev/null @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_tags - - node.type.article - - taxonomy.vocabulary.tags -id: node.article.field_tags -field_name: field_tags -entity_type: node -bundle: article -label: Tags -description: 'Enter a comma-separated list. For example: Amsterdam, Mexico City, "Cleveland, Ohio"' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - tags: tags - sort: - field: _none - auto_create: true -field_type: entity_reference diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.storage.contact_message.field_multiple_value_form_field.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.storage.contact_message.field_multiple_value_form_field.yml deleted file mode 100644 index faef295203403e2755005d96489eec6584f33365..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.storage.contact_message.field_multiple_value_form_field.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - contact -id: contact_message.field_multiple_value_form_field -field_name: field_multiple_value_form_field -entity_type: contact_message -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.comment.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.comment.yml deleted file mode 100644 index c5eee2c2841d49ca883d3254094e95962b2cd78c..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.comment.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - comment - - node -id: node.comment -field_name: comment -entity_type: node -type: comment -settings: - comment_type: comment -module: comment -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.field_image.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.field_image.yml deleted file mode 100644 index e4da7085460c4a63141b904e0b2c2a676f78ae75..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.field_image.yml +++ /dev/null @@ -1,31 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - file - - image - - node -id: node.field_image -field_name: field_image -entity_type: node -type: image -settings: - uri_scheme: public - default_image: - uuid: null - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: 1 -translatable: true -indexes: - target_id: - - target_id -persist_with_no_fields: false -custom_storage: false diff --git a/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.field_tags.yml b/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.field_tags.yml deleted file mode 100644 index 73f821f2c0dea6f2e8cfbd7ddc14795dcda91acd..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/field.storage.node.field_tags.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_tags -field_name: field_tags -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/core/modules/system/tests/modules/olivero_test/config/install/node.type.article.yml b/core/modules/system/tests/modules/olivero_test/config/install/node.type.article.yml deleted file mode 100644 index 1fd439ce71bf22657ff5b7e15805eb6f9b93ae05..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/node.type.article.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: Article -type: article -description: 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.' -help: '' -new_revision: true -preview_mode: 1 -display_submitted: true diff --git a/core/modules/system/tests/modules/olivero_test/config/install/taxonomy.vocabulary.tags.yml b/core/modules/system/tests/modules/olivero_test/config/install/taxonomy.vocabulary.tags.yml deleted file mode 100644 index 4c754e86c71598ec2002718b7568e91d413557ea..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/config/install/taxonomy.vocabulary.tags.yml +++ /dev/null @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: Tags -vid: tags -description: 'Use tags to group articles on similar topics into categories.' -weight: 0 diff --git a/core/modules/system/tests/modules/olivero_test/olivero_test.info.yml b/core/modules/system/tests/modules/olivero_test/olivero_test.info.yml index 30e430d57c409ba4531a1b91f4035783798410ad..53451469da3e153cac82b69712cafed2e8d3505f 100644 --- a/core/modules/system/tests/modules/olivero_test/olivero_test.info.yml +++ b/core/modules/system/tests/modules/olivero_test/olivero_test.info.yml @@ -3,12 +3,3 @@ type: module description: 'Support module for testing the Olivero theme.' package: Testing version: VERSION -dependencies: - - drupal:comment - - drupal:contact - - drupal:form_test - - drupal:image - - drupal:path - - drupal:search - - drupal:taxonomy - - drupal:views diff --git a/core/modules/system/tests/modules/olivero_test/olivero_test.module b/core/modules/system/tests/modules/olivero_test/olivero_test.module deleted file mode 100644 index 6be87370e6ebe090e8d346ac5eb716ec1b9136e2..0000000000000000000000000000000000000000 --- a/core/modules/system/tests/modules/olivero_test/olivero_test.module +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -/** - * @file - * Functions to support testing the Olivero theme. - */ - -/** - * Implements hook_preprocess_field_multiple_value_form(). - */ -function olivero_test_preprocess_field_multiple_value_form(&$variables) { - // Set test multiple value form field to disabled - if ($variables["element"]["#field_name"] === "field_multiple_value_form_field") { - $variables['element']['#disabled'] = TRUE; - } -} diff --git a/core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php b/core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php index ddae798c6fff5b4d34e8b4ac0dcf4f40d5b4aca9..1668bf253131d452a1b16cbe8ed24e52a5fbb9be 100644 --- a/core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php +++ b/core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php @@ -3,7 +3,6 @@ namespace Drupal\FunctionalTests\Theme; use Drupal\Tests\BrowserTestBase; -use Drupal\menu_link_content\Entity\MenuLinkContent; /** * Tests the Olivero theme. @@ -15,18 +14,30 @@ class OliveroTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected $profile = 'minimal'; + protected static $modules = ['system', 'block']; /** * {@inheritdoc} + * + * It should eventually be possible to set this to 'olivero' once the theme + * is in core. */ - protected $defaultTheme = 'olivero'; + protected $defaultTheme = 'stark'; /** * {@inheritdoc} */ protected function setUp(): void { parent::setUp(); + + // Install & set Olivero as default the theme. + // Note: it should be possible to remove this once Olivero can be set as + // the default theme above. + $this->container->get('theme_installer')->install(['olivero'], TRUE); + $system_theme_config = $this->container->get('config.factory')->getEditable('system.theme'); + $system_theme_config + ->set('default', 'olivero') + ->save(); } /** @@ -64,67 +75,11 @@ public function testConfigSchema() { $this->assertSession()->elementExists('css', '#block-olivero-search-form-wide'); } - /** - * Tests that olivero_preprocess_block is functioning as expected. - * - * @see olivero.libraries.yml - */ - public function testPreprocessBlock() { - $this->drupalGet(''); - $this->assertSession()->statusCodeEquals(200); - - // Confirm that search narrow and search wide libraries haven't yet been - // added. - $this->assertSession()->responseNotContains('olivero/css/components/header-search-wide.css'); - $this->assertSession()->responseNotContains('olivero/css/components/header-search-narrow.css'); - - // Enable modules that will exercise preprocess block logic. - \Drupal::service('module_installer')->install( - ['search', 'menu_link_content'] - ); - - // Add at least one link to the main menu. - $parent_menu_link_content = MenuLinkContent::create([ - 'title' => 'Home', - 'menu_name' => 'main', - 'link' => ['uri' => 'route:<front>'], - ]); - $parent_menu_link_content->save(); - - // Set branding color. - $system_theme_config = $this->container->get('config.factory')->getEditable('olivero.settings'); - $system_theme_config - ->set('site_branding_bg_color', 'gray') - ->save(); - - $this->rebuildAll(); - $this->drupalLogin( - $this->drupalCreateUser(['search content']) - ); - - // Ensure region attribute was added for primary menu. - $this->assertSession()->elementExists('css', 'ul[region="primary_menu"]'); - - // Confirm that search narrow and search wide libraries were added by - // preprocess. - $this->assertSession()->responseContains('olivero/css/components/header-search-wide.css'); - $this->assertSession()->responseContains('olivero/css/components/header-search-narrow.css'); - - // Confirm primary-nav class was added to main menu navigation block. - $this->assertSession()->elementExists('css', '#block-olivero-main-menu.primary-nav'); - - // Ensure branding background color class was added. - $this->assertSession()->elementExists('css', '#block-olivero-site-branding.site-branding--bg-gray'); - } - /** * Tests that the Olivero theme can be uninstalled. */ public function testIsUninstallable() { - $this->drupalLogin($this->drupalCreateUser([ - 'access administration pages', - 'administer themes', - ])); + $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer themes'])); $this->drupalGet('admin/appearance'); $this->cssSelect('a[title="Install Bartik as default theme"]')[0]->click(); diff --git a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroCommentTest.js b/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroCommentTest.js deleted file mode 100644 index 6b7195ca454741461c447616935328a5b9085351..0000000000000000000000000000000000000000 --- a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroCommentTest.js +++ /dev/null @@ -1,41 +0,0 @@ -const commentTitleSelector = 'h2.comments__title'; -const commentCountSelector = 'h2.comments__title .comments__count'; - -module.exports = { - '@tags': ['core', 'olivero'], - before(browser) { - browser - .drupalInstall({ - setupFile: - 'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php', - installProfile: 'minimal', - }) - .drupalCreateUser({ - name: 'user', - password: '123', - permissions: [ - 'access comments', - 'post comments', - 'skip comment approval', - ], - }) - .drupalLogin({ name: 'user', password: '123' }); - }, - after(browser) { - browser.drupalUninstall(); - }, - 'Article without comments should not display count': (browser) => { - browser - .drupalRelativeURL('/node/1') - .assert.containsText('body', 'Article without comments') - .assert.not.elementPresent(commentTitleSelector); - }, - 'Article with comments should display count': (browser) => { - browser - .drupalRelativeURL('/node/2') - .assert.containsText('body', 'Article with comments') - .assert.elementPresent(commentTitleSelector) - .assert.elementPresent(commentCountSelector) - .assert.containsText(commentCountSelector, '2'); - }, -}; diff --git a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroDesktopMenuTest.js b/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroDesktopMenuTest.js deleted file mode 100644 index faca431341d6ca001a653c367a4950399afb012f..0000000000000000000000000000000000000000 --- a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroDesktopMenuTest.js +++ /dev/null @@ -1,71 +0,0 @@ -const headerNavSelector = '#header-nav'; -const linkSubMenuId = 'home-submenu-1'; -const buttonSubMenuId = 'button-submenu-2'; - -module.exports = { - '@tags': ['core', 'olivero'], - before(browser) { - browser.drupalInstall({ - setupFile: - 'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php', - installProfile: 'minimal', - }); - browser.resizeWindow(1600, 800); - }, - after(browser) { - browser.drupalUninstall(); - }, - 'Verify Olivero desktop menu click functionality': (browser) => { - browser - .drupalRelativeURL('/node') - .waitForElementVisible(headerNavSelector) - .assert.not.visible(`#${linkSubMenuId}`) - .assert.attributeEquals( - `[aria-controls="${linkSubMenuId}"]`, - 'aria-expanded', - 'false', - ) - .click(`[aria-controls="${linkSubMenuId}"]`) - .assert.visible(`#${linkSubMenuId}`) - .assert.attributeEquals( - `[aria-controls="${linkSubMenuId}"]`, - 'aria-expanded', - 'true', - ) - - // Test interactions for route:<button> menu links. - .assert.not.visible(`#${buttonSubMenuId}`) - .assert.attributeEquals( - `[aria-controls="${buttonSubMenuId}"]`, - 'aria-expanded', - 'false', - ) - .click(`[aria-controls="${buttonSubMenuId}"]`) - .assert.visible(`#${buttonSubMenuId}`) - .assert.attributeEquals( - `[aria-controls="${buttonSubMenuId}"]`, - 'aria-expanded', - 'true', - ); - }, - 'Verify Olivero desktop menu hover functionality': (browser) => { - browser - .drupalRelativeURL('/node') - .waitForElementVisible(headerNavSelector) - .assert.visible(headerNavSelector) - .moveToElement('link text', 'home') - .assert.visible(`#${linkSubMenuId}`) - .assert.attributeEquals( - `[aria-controls="${linkSubMenuId}"]`, - 'aria-expanded', - 'true', - ) - .moveToElement('link text', 'button') - .assert.visible(`#${buttonSubMenuId}`) - .assert.attributeEquals( - `[aria-controls="${buttonSubMenuId}"]`, - 'aria-expanded', - 'true', - ); - }, -}; diff --git a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroPreprocessFieldMultipleValueFormTest.js b/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroPreprocessFieldMultipleValueFormTest.js deleted file mode 100644 index 3bbdc7259073e959e97873816be0b018211c26ce..0000000000000000000000000000000000000000 --- a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroPreprocessFieldMultipleValueFormTest.js +++ /dev/null @@ -1,41 +0,0 @@ -const tableSelector = '#edit-field-multiple-value-form-field-wrapper table'; -const tableHeaderSelector = '#edit-field-multiple-value-form-field-wrapper th'; -const headerSelector = '#edit-field-multiple-value-form-field-wrapper h4'; - -module.exports = { - '@tags': ['core', 'olivero'], - before(browser) { - browser - .drupalInstall({ - setupFile: - 'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php', - installProfile: 'minimal', - }) - .drupalCreateUser({ - name: 'user', - password: '123', - permissions: ['access site-wide contact form'], - }) - .drupalLogin({ name: 'user', password: '123' }); - }, - after(browser) { - browser.drupalUninstall(); - }, - 'correct classes added to table and header': (browser) => { - browser - .resizeWindow(1400, 800) - .drupalRelativeURL('/contact/olivero_test_contact_form') - .waitForElementVisible(tableSelector, 1000) - .assert.cssClassPresent(tableSelector, [ - 'tabledrag-disabled', - 'js-tabledrag-disabled', - ]) - .assert.cssClassPresent(tableHeaderSelector, 'is-disabled') - .assert.cssClassPresent(headerSelector, [ - 'form-item__label', - 'form-item__label--multiple-value-form', - 'js-form-required', - 'form-required', - ]); - }, -}; diff --git a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroPreprocessInputTest.js b/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroPreprocessInputTest.js deleted file mode 100644 index 368b207d2d7cc7f966289931036fb10b4816c0ea..0000000000000000000000000000000000000000 --- a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroPreprocessInputTest.js +++ /dev/null @@ -1,112 +0,0 @@ -const checkboxSelector = '#edit-form-checkboxes-title-attribute'; - -const inputTypes = [ - { - selector: '#edit-form-textfield-test-title-and-required', - type: 'text', - api: 'textfield', - }, - { - selector: '#edit-form-email-title-no-xss', - type: 'email', - api: 'email', - }, - { - selector: '#edit-form-tel-title-no-xss', - type: 'tel', - api: 'tel', - }, - { - selector: '#edit-form-number-title-no-xss', - type: 'number', - api: 'number', - }, - { - selector: '#edit-form-search-title-no-xss', - type: 'search', - api: 'search', - }, - { - selector: '#edit-form-password-title-no-xss', - type: 'password', - api: 'password', - }, - { - selector: '#edit-form-date-title-no-xss', - type: 'date', - api: 'date', - }, - { - selector: '#edit-form-datetime-title-no-xss-time', - type: 'time', - api: 'date', - }, - { - selector: '#edit-form-file-title-no-xss', - type: 'file', - api: 'file', - }, - { - selector: '#edit-form-color-title-no-xss', - type: 'color', - api: 'color', - }, - { - selector: '#edit-form-url-title-no-xss', - type: 'url', - api: 'url', - }, - // TODO - Cover datetime-local, month, week - no test form input examples are easily available -]; - -const booleanInputTypes = [ - { - selector: '#edit-form-checkboxes-test-first-checkbox', - type: 'checkbox', - }, - { - selector: '#edit-form-radios-title-attribute-first-radio', - type: 'radio', - }, -]; - -module.exports = { - '@tags': ['core', 'olivero'], - before(browser) { - browser.drupalInstall({ - setupFile: - 'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php', - installProfile: 'minimal', - }); - }, - after(browser) { - browser.drupalUninstall(); - }, - 'Confirm that title attribute exists if set to display': (browser) => { - browser - .resizeWindow(1400, 800) - .drupalRelativeURL('/form_test/form-labels') - .waitForElementVisible(checkboxSelector, 1000) - .assert.attributeEquals( - checkboxSelector, - 'title', - 'Checkboxes test (Required)', - ); - }, - 'Check form element classes by type': (browser) => { - browser.drupalRelativeURL('/form_test/form-labels'); - inputTypes.forEach((inputType) => { - browser.assert.cssClassPresent(inputType.selector, [ - 'form-element', - `form-element--type-${inputType.type}`, - `form-element--api-${inputType.api}`, - ]); - }); - booleanInputTypes.forEach((booleanInputType) => { - browser.assert.cssClassPresent(booleanInputType.selector, [ - 'form-boolean', - `form-boolean--type-${booleanInputType.type}`, - ]); - }); - }, -}; diff --git a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroSearchFormTest.js b/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroSearchFormTest.js deleted file mode 100644 index 0632b20a05340edbc9d3f78595e7328252ba5cb2..0000000000000000000000000000000000000000 --- a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroSearchFormTest.js +++ /dev/null @@ -1,82 +0,0 @@ -const mobileNavButtonSelector = 'button.mobile-nav-button'; -const headerNavSelector = '#header-nav'; -const searchButtonSelector = 'button.block-search-wide__button'; -const searchFormSelector = '.search-form.search-block-form'; -const searchWideSelector = '.block-search-wide__wrapper'; -const searchNarrowSelector = '.block-search-narrow'; - -module.exports = { - '@tags': ['core', 'olivero'], - before(browser) { - browser - .drupalInstall({ - setupFile: - 'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php', - installProfile: 'minimal', - }) - // Create user that can search. - .drupalCreateUser({ - name: 'user', - password: '123', - permissions: ['search content', 'use advanced search'], - }) - .drupalLogin({ name: 'user', password: '123' }); - }, - after(browser) { - browser.drupalUninstall(); - }, - 'search wide form is accessible and altered': (browser) => { - browser - .resizeWindow(1400, 800) - .drupalRelativeURL('/') - .click(searchButtonSelector) - .waitForElementVisible(`${searchWideSelector}`) - .waitForElementVisible(`${searchWideSelector} ${searchFormSelector}`) - .assert.attributeContains( - `${searchWideSelector} ${searchFormSelector} input[name=keys]`, - 'placeholder', - 'Search by keyword or phrase.', - ) - .assert.attributeContains( - `${searchWideSelector} ${searchFormSelector} input[name=keys]`, - 'title', - 'Enter the terms you wish to search for.', - ) - .assert.elementPresent('button.search-form__submit'); - }, - 'search narrow form is accessible': (browser) => { - browser - .resizeWindow(1000, 800) - .drupalRelativeURL('/') - .click(mobileNavButtonSelector) - .waitForElementVisible(headerNavSelector) - .waitForElementVisible(`${searchNarrowSelector} ${searchFormSelector}`); - }, - 'submit button styled as primary on forms with <= 2 actions': (browser) => { - browser - .resizeWindow(1400, 800) - .drupalRelativeURL('/form-test/object-controller-builder') - .assert.elementPresent( - '#edit-actions input[type=submit].button--primary', - ); - }, - 'search page is altered': (browser) => { - browser - .resizeWindow(1400, 800) - .drupalRelativeURL('/search') - .assert.attributeContains( - '.search-form input[name=keys]', - 'placeholder', - 'Search by keyword or phrase.', - ) - .assert.attributeContains( - '.search-form input[name=keys]', - 'title', - 'Enter the terms you wish to search for.', - ) - .assert.elementPresent('#edit-basic input[type=submit].button--primary') - .assert.elementPresent( - '#edit-advanced input[type=submit].button--primary', - ); - }, -}; diff --git a/core/tests/Drupal/Nightwatch/Tests/oliveroDesktopMenuTest.js b/core/tests/Drupal/Nightwatch/Tests/oliveroDesktopMenuTest.js new file mode 100644 index 0000000000000000000000000000000000000000..f581ef57344b062dbbc54f04e7d662dfb155c5d4 --- /dev/null +++ b/core/tests/Drupal/Nightwatch/Tests/oliveroDesktopMenuTest.js @@ -0,0 +1,159 @@ +const headerNavSelector = '#header-nav'; +const linkSubMenuId = 'home-submenu-1'; +const buttonSubMenuId = 'button-submenu-2'; + +module.exports = { + '@tags': ['core', 'olivero'], + before(browser) { + browser.drupalInstall({ + setupFile: + 'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php', + installProfile: 'minimal', + }); + browser.resizeWindow(1600, 800); + }, + after(browser) { + browser.drupalUninstall(); + }, + 'Verify Olivero desktop menu click functionality': (browser) => { + browser + .drupalRelativeURL('/node') + .waitForElementVisible(headerNavSelector) + .assert.not.visible(`#${linkSubMenuId}`) + .assert.attributeEquals( + `[aria-controls="${linkSubMenuId}"]`, + 'aria-expanded', + 'false', + ) + .click(`[aria-controls="${linkSubMenuId}"]`) + .assert.visible(`#${linkSubMenuId}`) + .assert.attributeEquals( + `[aria-controls="${linkSubMenuId}"]`, + 'aria-expanded', + 'true', + ) + + // Test interactions for route:<button> menu links. + .assert.not.visible(`#${buttonSubMenuId}`) + .assert.attributeEquals( + `[aria-controls="${buttonSubMenuId}"]`, + 'aria-expanded', + 'false', + ) + .click(`[aria-controls="${buttonSubMenuId}"]`) + .assert.visible(`#${buttonSubMenuId}`) + .assert.attributeEquals( + `[aria-controls="${buttonSubMenuId}"]`, + 'aria-expanded', + 'true', + ); + }, + 'Verify Olivero desktop menu hover functionality': (browser) => { + browser + .drupalRelativeURL('/node') + .waitForElementVisible(headerNavSelector) + .assert.visible(headerNavSelector) + .moveToElement('link text', 'home') + .assert.visible(`#${linkSubMenuId}`) + .assert.attributeEquals( + `[aria-controls="${linkSubMenuId}"]`, + 'aria-expanded', + 'true', + ) + .moveToElement('link text', 'button') + .assert.visible(`#${buttonSubMenuId}`) + .assert.attributeEquals( + `[aria-controls="${buttonSubMenuId}"]`, + 'aria-expanded', + 'true', + ); + }, + 'Verify secondary navigation close on blur': (browser) => { + browser + .drupalRelativeURL('/node') + .waitForElementVisible(headerNavSelector) + .click(`[aria-controls="${linkSubMenuId}"]`) + .assert.attributeEquals( + `[aria-controls="${linkSubMenuId}"]`, + 'aria-expanded', + 'true', + ); + browser + .execute( + // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow + function () { + document.querySelector('.site-branding__name a').focus(); + }, + [], + ) + .pause(400) + .assert.attributeEquals( + `[aria-controls="${linkSubMenuId}"]`, + 'aria-expanded', + 'false', + ); + }, + 'Verify parent <button> focus on ESC in wide navigation': (browser) => { + browser + // Verify functionality on regular link's button. + .drupalRelativeURL('/node') + .waitForElementVisible(headerNavSelector) + .click(`[aria-controls="${linkSubMenuId}"]`) + .waitForElementVisible(`#${linkSubMenuId}`) + .keys(browser.Keys.TAB) + .pause(50) + .execute( + // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow + function (linkSubMenuId) { + return document.activeElement.matches(`#${linkSubMenuId} *`); + }, + [linkSubMenuId], + (result) => { + browser.assert.ok(result.value); + }, + ) + .keys(browser.Keys.ESCAPE) + .pause(50) + .execute( + // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow + function (linkSubMenuId) { + return document.activeElement.matches( + `[aria-controls="${linkSubMenuId}"]`, + ); + }, + [linkSubMenuId], + (result) => { + browser.assert.ok(result.value); + }, + ) + // Verify functionality on route:<button> button. + .click(`[aria-controls="${buttonSubMenuId}"]`) + .waitForElementVisible(`#${buttonSubMenuId}`) + .keys(browser.Keys.TAB) + .pause(50) + .execute( + // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow + function (buttonSubMenuId) { + return document.activeElement.matches(`#${buttonSubMenuId} *`); + }, + [buttonSubMenuId], + (result) => { + browser.assert.ok(result.value); + }, + ) + .keys(browser.Keys.ESCAPE) + .pause(50) + .execute( + // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow + function (buttonSubMenuId) { + return document.activeElement.matches( + `[aria-controls="${buttonSubMenuId}"]`, + ); + }, + [buttonSubMenuId], + (result) => { + browser.assert.ok(result.value); + }, + ); + }, +}; diff --git a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js b/core/tests/Drupal/Nightwatch/Tests/oliveroMobileMenuTest.js similarity index 100% rename from core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroMobileMenuTest.js rename to core/tests/Drupal/Nightwatch/Tests/oliveroMobileMenuTest.js diff --git a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroStickyHeaderToggleTest.js b/core/tests/Drupal/Nightwatch/Tests/oliveroStickyHeaderToggleTest.js similarity index 90% rename from core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroStickyHeaderToggleTest.js rename to core/tests/Drupal/Nightwatch/Tests/oliveroStickyHeaderToggleTest.js index edb169b821d6e88319883027844ee2faf78beafb..5d238e30a5a7badfed3d1bd940a880499117f69f 100644 --- a/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroStickyHeaderToggleTest.js +++ b/core/tests/Drupal/Nightwatch/Tests/oliveroStickyHeaderToggleTest.js @@ -17,6 +17,10 @@ module.exports = { 'On scroll, menu collapses to burger 🔠menu': (browser) => { browser .drupalRelativeURL('/node') + .assert.containsText( + '#block-olivero-content h2', + 'Congratulations and welcome to the Drupal community!', + ) .assert.not.visible(buttonSelector) .assert.attributeEquals(buttonSelector, 'aria-checked', 'false') .getLocationInView('footer.site-footer', () => { diff --git a/core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php b/core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php index a02c8d3a0430553edf88217ca154e22c38a5b13b..d1080d66f824e8bf80ddf9b97a2593de398bbbeb 100644 --- a/core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php +++ b/core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php @@ -4,8 +4,6 @@ use Drupal\Core\Extension\ModuleInstallerInterface; use Drupal\Core\Extension\ThemeInstallerInterface; -use Drupal\node\Entity\Node; -use Drupal\comment\Entity\Comment; /** * Setup file used by TestSiteInstallTestScript. @@ -21,7 +19,7 @@ public function setup() { // Install required module for the Olivero front page. $module_installer = \Drupal::service('module_installer'); assert($module_installer instanceof ModuleInstallerInterface); - $module_installer->install(['olivero_test']); + $module_installer->install(['views', 'olivero_test']); // Install Olivero and set it as the default theme. $theme_installer = \Drupal::service('theme_installer'); @@ -29,40 +27,6 @@ public function setup() { $theme_installer->install(['olivero'], TRUE); $system_theme_config = \Drupal::configFactory()->getEditable('system.theme'); $system_theme_config->set('default', 'olivero')->save(); - - // Create an article that will have no comments - $article_no_comments = Node::create(['type' => 'article']); - $article_no_comments->set('title', 'Article without comments'); - // Enable comments - $article_no_comments->set('comment', 2); - $article_no_comments->save(); - - // Create an article that will have comments - $article_with_comments = Node::create(['type' => 'article']); - $article_with_comments->set('title', 'Article with comments'); - // Enable comments - $article_with_comments->set('comment', 2); - $article_with_comments->save(); - - $values = [ - // These values are for the entity that you're creating the comment for, not the comment itself. - 'entity_type' => 'node', - 'entity_id' => 2, - 'field_name' => 'comment', - 'uid' => 1, - // These values are for the comment itself. - 'comment_type' => 'comment', - 'subject' => 'A comment', - 'comment_body' => 'Body of comment', - // Whether the comment is 'approved' or not. - 'status' => 1, - ]; - // Create comment entities out of our field values - $comment1 = Comment::create($values); - $comment1->save(); - - $comment2 = Comment::create($values); - $comment2->save(); } } diff --git a/core/themes/olivero/olivero.theme b/core/themes/olivero/olivero.theme index 500ac751ff7a2aa7c4dc2f1c8fb1df67664b34ba..d0617dee55f402e412abc7ef788005d08fb4386b 100644 --- a/core/themes/olivero/olivero.theme +++ b/core/themes/olivero/olivero.theme @@ -188,7 +188,7 @@ function olivero_theme_suggestions_form_alter(array &$suggestions, array $variab * Implements hook_form_alter() for adding classes and placeholder text to the search forms. */ function olivero_form_alter(&$form, FormStateInterface $form_state, $form_id) { - if (isset($form['actions']['submit']) && (count($form['actions'])) <= 2) { + if (isset($form['actions']) && (count($form['actions'])) <= 2) { $form['actions']['submit']['#attributes']['class'][] = 'button--primary'; } @@ -304,8 +304,6 @@ function olivero_preprocess_input(&$variables) { $variables['attributes']['class'][] = Html::getClass('form-element--type-' . $type_html); $variables['attributes']['class'][] = Html::getClass('form-element--api-' . $type_api); - // This logic is functioning as expected, but there is nothing in the theme that renders the result. - // As a result it can't currently be covered by a functional test. if (!empty($variables['element']['#autocomplete_route_name'])) { $variables['autocomplete_message'] = t('Loading…'); } @@ -372,7 +370,7 @@ function olivero_preprocess_field_multiple_value_form(&$variables) { // Make disabled available for the template. $variables['disabled'] = !empty($variables['element']['#disabled']); - if (!empty($variables['multiple'])) { + if ($variables['multiple']) { // Add an additional CSS class for the field label table cell. // This repeats the logic of template_preprocess_field_multiple_value_form() // without using '#prefix' and '#suffix' for the wrapper element.