From cd25893245778f1848654c84ec6ccbdef9ca4039 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Fri, 6 Oct 2023 13:53:41 -0700 Subject: [PATCH] D8CORE-6977 Switch to use CSHS instead of simple heiracry select --- ...entity_form_display.media.file.default.yml | 13 ++++--- ..._form_display.media.file.media_library.yml | 13 ++++--- ...ntity_form_display.media.image.default.yml | 13 ++++--- ...form_display.media.image.media_library.yml | 13 ++++--- ....media.stanford_gallery_images.default.yml | 13 ++++--- ....stanford_gallery_images.media_library.yml | 13 ++++--- ...ntity_form_display.media.video.default.yml | 13 ++++--- ...form_display.media.video.media_library.yml | 13 ++++--- ...m_display.node.stanford_course.default.yml | 13 ++++--- ...rm_display.node.stanford_event.default.yml | 24 +++++++----- ...lay.node.stanford_event_series.default.yml | 24 +++++++----- ...orm_display.node.stanford_news.default.yml | 24 +++++++----- ...orm_display.node.stanford_page.default.yml | 24 +++++++----- ...m_display.node.stanford_person.default.yml | 24 +++++++----- ...play.node.stanford_publication.default.yml | 24 +++++++----- config/sync/google_analytics.settings.yml | 4 ++ .../acceptance/Content/BasicPageCest.php | 2 +- .../acceptance/Content/EventsCest.php | 2 - .../acceptance/Content/PersonCest.php | 26 +++++++++++++ .../acceptance/Content/PublicationsCest.php | 4 +- .../acceptance/Contrib/ViewsBulkEditCest.php | 18 ++++----- .../acceptance/Paragraphs/ListsCest.php | 10 ++--- .../functional/Content/StanfordNewsCest.php | 37 ++++++++++--------- 23 files changed, 228 insertions(+), 136 deletions(-) diff --git a/config/sync/core.entity_form_display.media.file.default.yml b/config/sync/core.entity_form_display.media.file.default.yml index b5c2ca483..7df6d762f 100644 --- a/config/sync/core.entity_form_display.media.file.default.yml +++ b/config/sync/core.entity_form_display.media.file.default.yml @@ -7,8 +7,8 @@ dependencies: - field.field.media.file.su_media_category - media.type.file module: + - cshs - file - - shs _core: default_config_hash: IZZZH3ZmZ5xpeUW2scF9RPSnKb3qnEKu-cBMQQOuHQk id: media.file.default @@ -32,14 +32,17 @@ content: placeholder: '' third_party_settings: { } su_media_category: - type: options_shs + type: cshs weight: 27 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } hidden: created: true diff --git a/config/sync/core.entity_form_display.media.file.media_library.yml b/config/sync/core.entity_form_display.media.file.media_library.yml index 428ad6b8b..4e4ba5244 100644 --- a/config/sync/core.entity_form_display.media.file.media_library.yml +++ b/config/sync/core.entity_form_display.media.file.media_library.yml @@ -8,8 +8,8 @@ dependencies: - field.field.media.file.su_media_category - media.type.file module: + - cshs - file - - shs id: media.file.media_library targetEntityType: media bundle: file @@ -31,14 +31,17 @@ content: placeholder: '' third_party_settings: { } su_media_category: - type: options_shs + type: cshs weight: 1 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } hidden: created: true diff --git a/config/sync/core.entity_form_display.media.image.default.yml b/config/sync/core.entity_form_display.media.image.default.yml index a2e4a26dc..fd3c81d4f 100644 --- a/config/sync/core.entity_form_display.media.image.default.yml +++ b/config/sync/core.entity_form_display.media.image.default.yml @@ -8,8 +8,8 @@ dependencies: - image.style.thumbnail - media.type.image module: + - cshs - focal_point - - shs _core: default_config_hash: VlvGpKQnaptFys0SJOZOeTnEs8B561SwPjIy-uFSiJE id: media.image.default @@ -36,14 +36,17 @@ content: placeholder: '' third_party_settings: { } su_media_category: - type: options_shs + type: cshs weight: 27 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } hidden: created: true diff --git a/config/sync/core.entity_form_display.media.image.media_library.yml b/config/sync/core.entity_form_display.media.image.media_library.yml index c22091bf8..3b17e4857 100644 --- a/config/sync/core.entity_form_display.media.image.media_library.yml +++ b/config/sync/core.entity_form_display.media.image.media_library.yml @@ -9,8 +9,8 @@ dependencies: - image.style.thumbnail - media.type.image module: + - cshs - focal_point - - shs _core: default_config_hash: BMLrK4zKp8-FFnMseBdT_6h6YipUsKRfbDf_3WUB5HA id: media.image.media_library @@ -37,14 +37,17 @@ content: placeholder: '' third_party_settings: { } su_media_category: - type: options_shs + type: cshs weight: 2 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } hidden: created: true diff --git a/config/sync/core.entity_form_display.media.stanford_gallery_images.default.yml b/config/sync/core.entity_form_display.media.stanford_gallery_images.default.yml index 2f593b7ab..777961314 100644 --- a/config/sync/core.entity_form_display.media.stanford_gallery_images.default.yml +++ b/config/sync/core.entity_form_display.media.stanford_gallery_images.default.yml @@ -9,8 +9,8 @@ dependencies: - image.style.thumbnail - media.type.stanford_gallery_images module: + - cshs - focal_point - - shs id: media.stanford_gallery_images.default targetEntityType: media bundle: stanford_gallery_images @@ -43,14 +43,17 @@ content: offsets: '50,50' third_party_settings: { } su_media_category: - type: options_shs + type: cshs weight: 27 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } hidden: created: true diff --git a/config/sync/core.entity_form_display.media.stanford_gallery_images.media_library.yml b/config/sync/core.entity_form_display.media.stanford_gallery_images.media_library.yml index f4adfb0ef..d5d13da0c 100644 --- a/config/sync/core.entity_form_display.media.stanford_gallery_images.media_library.yml +++ b/config/sync/core.entity_form_display.media.stanford_gallery_images.media_library.yml @@ -10,8 +10,8 @@ dependencies: - image.style.thumbnail - media.type.stanford_gallery_images module: + - cshs - focal_point - - shs id: media.stanford_gallery_images.media_library targetEntityType: media bundle: stanford_gallery_images @@ -44,14 +44,17 @@ content: offsets: '50,50' third_party_settings: { } su_media_category: - type: options_shs + type: cshs weight: 3 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } hidden: created: true diff --git a/config/sync/core.entity_form_display.media.video.default.yml b/config/sync/core.entity_form_display.media.video.default.yml index 9cafeba99..63aeb09af 100644 --- a/config/sync/core.entity_form_display.media.video.default.yml +++ b/config/sync/core.entity_form_display.media.video.default.yml @@ -7,7 +7,7 @@ dependencies: - field.field.media.video.su_media_category - media.type.video module: - - shs + - cshs _core: default_config_hash: 7asQaGZMyJ5EtC9GHpp-bYEGCmfCKgCZhEcDl4wsU6w id: media.video.default @@ -32,14 +32,17 @@ content: placeholder: '' third_party_settings: { } su_media_category: - type: options_shs + type: cshs weight: 26 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } hidden: created: true diff --git a/config/sync/core.entity_form_display.media.video.media_library.yml b/config/sync/core.entity_form_display.media.video.media_library.yml index 2b7e5637b..a5c0c0407 100644 --- a/config/sync/core.entity_form_display.media.video.media_library.yml +++ b/config/sync/core.entity_form_display.media.video.media_library.yml @@ -8,7 +8,7 @@ dependencies: - field.field.media.video.su_media_category - media.type.video module: - - shs + - cshs id: media.video.media_library targetEntityType: media bundle: video @@ -31,14 +31,17 @@ content: placeholder: '' third_party_settings: { } su_media_category: - type: options_shs + type: cshs weight: 2 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } hidden: created: true diff --git a/config/sync/core.entity_form_display.node.stanford_course.default.yml b/config/sync/core.entity_form_display.node.stanford_course.default.yml index 3e94a5084..95f0b960f 100644 --- a/config/sync/core.entity_form_display.node.stanford_course.default.yml +++ b/config/sync/core.entity_form_display.node.stanford_course.default.yml @@ -17,10 +17,10 @@ dependencies: - field.field.node.stanford_course.su_shared_tags - node.type.stanford_course module: + - cshs - link - metatag - path - - shs - text _core: default_config_hash: QDRdEfbaTCodBKx86SPI4kztwbpL9XOi2KleL66-Oqc @@ -137,14 +137,17 @@ content: use_details: true third_party_settings: { } su_shared_tags: - type: options_shs + type: cshs weight: 29 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } title: type: string_textfield diff --git a/config/sync/core.entity_form_display.node.stanford_event.default.yml b/config/sync/core.entity_form_display.node.stanford_event.default.yml index 17f7e4373..043509d26 100644 --- a/config/sync/core.entity_form_display.node.stanford_event.default.yml +++ b/config/sync/core.entity_form_display.node.stanford_event.default.yml @@ -31,6 +31,7 @@ dependencies: module: - address - change_labels + - cshs - field_group - layout_paragraphs - link @@ -38,7 +39,6 @@ dependencies: - paragraphs - readonly_field_widget - scheduler - - shs - smart_date - stanford_intranet - telephone @@ -335,14 +335,17 @@ content: placeholder: '' third_party_settings: { } su_event_type: - type: options_shs + type: cshs weight: 0 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } su_metatags: type: metatag_firehose @@ -353,14 +356,17 @@ content: use_details: true third_party_settings: { } su_shared_tags: - type: options_shs + type: cshs weight: 10 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } title: type: string_textfield diff --git a/config/sync/core.entity_form_display.node.stanford_event_series.default.yml b/config/sync/core.entity_form_display.node.stanford_event_series.default.yml index 52d418d0a..108e70275 100644 --- a/config/sync/core.entity_form_display.node.stanford_event_series.default.yml +++ b/config/sync/core.entity_form_display.node.stanford_event_series.default.yml @@ -17,12 +17,12 @@ dependencies: - node.type.stanford_event_series module: - change_labels + - cshs - field_group - layout_paragraphs - menu_link - metatag - scheduler - - shs - stanford_intranet third_party_settings: field_group: @@ -154,14 +154,17 @@ content: placeholder: '' third_party_settings: { } su_event_series_type: - type: options_shs + type: cshs weight: 4 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } su_event_series_weight: type: number @@ -179,14 +182,17 @@ content: use_details: true third_party_settings: { } su_shared_tags: - type: options_shs + type: cshs weight: 31 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } title: type: string_textfield diff --git a/config/sync/core.entity_form_display.node.stanford_news.default.yml b/config/sync/core.entity_form_display.node.stanford_news.default.yml index d87fd7545..189d3778b 100644 --- a/config/sync/core.entity_form_display.node.stanford_news.default.yml +++ b/config/sync/core.entity_form_display.node.stanford_news.default.yml @@ -20,6 +20,7 @@ dependencies: - node.type.stanford_news module: - change_labels + - cshs - datetime - field_group - layout_paragraphs @@ -28,7 +29,6 @@ dependencies: - metatag - path - scheduler - - shs - stanford_intranet third_party_settings: field_group: @@ -191,24 +191,30 @@ content: placeholder_title: '' third_party_settings: { } su_news_topics: - type: options_shs + type: cshs weight: 3 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } su_shared_tags: - type: options_shs + type: cshs weight: 9 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } title: type: string_textfield diff --git a/config/sync/core.entity_form_display.node.stanford_page.default.yml b/config/sync/core.entity_form_display.node.stanford_page.default.yml index 77152ce69..7a9b29855 100644 --- a/config/sync/core.entity_form_display.node.stanford_page.default.yml +++ b/config/sync/core.entity_form_display.node.stanford_page.default.yml @@ -17,6 +17,7 @@ dependencies: - node.type.stanford_page module: - change_labels + - cshs - field_group - layout_paragraphs - media_library @@ -25,7 +26,6 @@ dependencies: - paragraphs - path - scheduler - - shs - stanford_intranet third_party_settings: field_group: @@ -101,14 +101,17 @@ content: display_label: true third_party_settings: { } su_basic_page_type: - type: options_shs + type: cshs weight: 2 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } su_metatags: type: metatag_firehose @@ -167,14 +170,17 @@ content: media_types: { } third_party_settings: { } su_shared_tags: - type: options_shs + type: cshs weight: 3 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } title: type: string_textfield diff --git a/config/sync/core.entity_form_display.node.stanford_person.default.yml b/config/sync/core.entity_form_display.node.stanford_person.default.yml index d846d2d2b..63c9b0dc2 100644 --- a/config/sync/core.entity_form_display.node.stanford_person.default.yml +++ b/config/sync/core.entity_form_display.node.stanford_person.default.yml @@ -38,6 +38,7 @@ dependencies: module: - allowed_formats - change_labels + - cshs - field_group - layout_paragraphs - link @@ -45,7 +46,6 @@ dependencies: - menu_link - metatag - scheduler - - shs - stanford_intranet - text third_party_settings: @@ -352,24 +352,30 @@ content: placeholder: '' third_party_settings: { } su_person_type_group: - type: options_shs + type: cshs weight: 17 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } su_shared_tags: - type: options_shs + type: cshs weight: 31 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } title: type: string_textfield diff --git a/config/sync/core.entity_form_display.node.stanford_publication.default.yml b/config/sync/core.entity_form_display.node.stanford_publication.default.yml index de7e3ca32..800aa5fde 100644 --- a/config/sync/core.entity_form_display.node.stanford_publication.default.yml +++ b/config/sync/core.entity_form_display.node.stanford_publication.default.yml @@ -16,13 +16,13 @@ dependencies: - node.type.stanford_publication module: - change_labels + - cshs - inline_entity_form - layout_paragraphs - link - media_library - metatag - scheduler - - shs - stanford_intranet id: node.stanford_publication.default targetEntityType: node @@ -116,24 +116,30 @@ content: media_types: { } third_party_settings: { } su_publication_topics: - type: options_shs + type: cshs weight: 2 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } su_shared_tags: - type: options_shs + type: cshs weight: 11 region: content settings: - display_node_count: false - create_new_items: false - create_new_levels: false + save_lineage: false force_deepest: false + parent: '' + level_labels: '' + hierarchy_depth: 0 + required_depth: 0 + none_label: '- Please select -' third_party_settings: { } title: type: string_textfield diff --git a/config/sync/google_analytics.settings.yml b/config/sync/google_analytics.settings.yml index 16b005cb3..18b798780 100644 --- a/config/sync/google_analytics.settings.yml +++ b/config/sync/google_analytics.settings.yml @@ -8,11 +8,15 @@ visibility: request_path_pages: "/admin\r\n/admin/*\r\n/batch\r\n/node/add*\r\n/node/*/*\r\n/user/*/*" user_role_mode: 1 user_role_roles: + administrator: administrator contributor: contributor site_manager: site_manager site_editor: site_editor site_builder: site_builder site_developer: site_developer + layout_builder_user: layout_builder_user + su_site_embedder: su_site_embedder + decoupled_site_users: decoupled_site_users user_account_mode: 0 track: outbound: true diff --git a/tests/codeception/acceptance/Content/BasicPageCest.php b/tests/codeception/acceptance/Content/BasicPageCest.php index 217ea16e8..791fb6579 100644 --- a/tests/codeception/acceptance/Content/BasicPageCest.php +++ b/tests/codeception/acceptance/Content/BasicPageCest.php @@ -136,7 +136,7 @@ public function testPageDescription(AcceptanceTester $I) { $I->see('Basic Page Type'); $I->fillField('Title', $title); $I->fillField('Page Description', $description); - $I->fillField('Basic Page Type', $type_term->id()); + $I->selectOption('Basic Page Type (value 1)', $type_term->id()); $I->click('Save'); $I->seeInSource(''); } diff --git a/tests/codeception/acceptance/Content/EventsCest.php b/tests/codeception/acceptance/Content/EventsCest.php index 504953388..805e6d843 100644 --- a/tests/codeception/acceptance/Content/EventsCest.php +++ b/tests/codeception/acceptance/Content/EventsCest.php @@ -106,8 +106,6 @@ public function testXMLSiteMap(AcceptanceTester $I) { /** * Test Page Title Conditions. - * - * @group foobar */ public function testPageTitleIgnoreCondition(AcceptanceTester $I) { $I->logInWithRole('administrator'); diff --git a/tests/codeception/acceptance/Content/PersonCest.php b/tests/codeception/acceptance/Content/PersonCest.php index 9f25e59de..815d380a3 100644 --- a/tests/codeception/acceptance/Content/PersonCest.php +++ b/tests/codeception/acceptance/Content/PersonCest.php @@ -340,4 +340,30 @@ public function testMetaData(AcceptanceTester $I) { $I->assertEquals($values['profile_link'], $I->grabAttributeFrom('link[rel="canonical"]', 'href'), 'Metadata "canonical" should match.'); } + /** + * Deleting the taxonomy term doesn't break the form. + */ + public function testDeletedTerm(AcceptanceTester $I){ + $term = $I->createEntity([ + 'name' => $this->faker->words(2, TRUE), + 'vid' => 'stanford_person_types', + ], 'taxonomy_term'); + /** @var \Drupal\node\NodeInterface $node */ + $node = $I->createEntity([ + 'type' => 'stanford_person', + 'su_person_short_title' => $this->faker->title, + 'su_person_first_name' => $this->faker->firstName, + 'su_person_last_name' => $this->faker->lastName, + 'su_person_type_group' => $term->id(), + ]); + $term->delete(); + + $I->logInWithRole('site_manager'); + $I->amOnPage($node->toUrl('edit-form')->toString()); + $I->click('Save'); + + $I->canSeeInCurrentUrl($node->toUrl()->toString()); + $I->canSee($node->label(), 'h1'); + } + } diff --git a/tests/codeception/acceptance/Content/PublicationsCest.php b/tests/codeception/acceptance/Content/PublicationsCest.php index 777cd58e8..ca2a42a11 100644 --- a/tests/codeception/acceptance/Content/PublicationsCest.php +++ b/tests/codeception/acceptance/Content/PublicationsCest.php @@ -44,7 +44,7 @@ public function testBookCitation(AcceptanceTester $I) { $I->logInWithRole('site_manager'); $I->amOnPage('/node/add/stanford_publication'); $I->fillField('Title', $this->values['node_title']); - $I->fillField('Publication Types', $term->id()); + $I->selectOption('Publication Types (value 1)', $term->id()); $I->selectOption('su_publication_citation[actions][bundle]', 'Book'); $I->click('Add new Citation'); $I->fillField('First Name', $this->faker->firstName); @@ -230,7 +230,7 @@ public function testJournalPublisher(AcceptanceTester $I) { $I->logInWithRole('site_manager'); $I->amOnPage('/node/add/stanford_publication'); $I->fillField('Title', $this->values['node_title']); - $I->fillField('Publication Types', $term->id()); + $I->selectOption('Publication Types (value 1)', $term->id()); $I->selectOption('su_publication_citation[actions][bundle]', 'Journal Article'); $I->click('Add new Citation'); $I->fillField('First Name', $this->faker->firstName); diff --git a/tests/codeception/acceptance/Contrib/ViewsBulkEditCest.php b/tests/codeception/acceptance/Contrib/ViewsBulkEditCest.php index 55ed8ed63..28bd6fab2 100644 --- a/tests/codeception/acceptance/Contrib/ViewsBulkEditCest.php +++ b/tests/codeception/acceptance/Contrib/ViewsBulkEditCest.php @@ -60,17 +60,17 @@ public function testBulkEdits(AcceptanceTester $I) { foreach ($this->nodes as $node) { $I->canSee($node->label()); } - $I->checkOption('News Types'); - $I->fillField('node[stanford_news][su_news_topics]', $news_foo_bar_baz->id()); - $I->checkOption('Event Types'); - $I->fillField('node[stanford_event][su_event_type]', $event_foo_bar_baz->id()); + $I->checkOption('News Types (value 1)'); + $I->selectOption('node[stanford_news][su_news_topics][0][target_id]', $news_foo_bar_baz->id()); + $I->checkOption('Event Types (value 1)'); + $I->selectOption('node[stanford_event][su_event_type][0][target_id]', $event_foo_bar_baz->id()); $I->fillField('node[stanford_event][su_event_date_time][0][time_wrapper][value][date]', date('Y-m-d')); $I->fillField('node[stanford_event][su_event_date_time][0][time_wrapper][value][time]', '12:00:00'); $I->fillField('node[stanford_event][su_event_date_time][0][time_wrapper][end_value][date]', date('Y-m-d')); $I->fillField('node[stanford_event][su_event_date_time][0][time_wrapper][end_value][time]', '12:00:00'); - $I->checkOption('Publication Types'); - $I->fillField('node[stanford_publication][su_publication_topics]', $pubs_foo_bar_baz->id()); + $I->checkOption('Publication Types (value 1)'); + $I->selectOption('node[stanford_publication][su_publication_topics][0][target_id]', $pubs_foo_bar_baz->id()); $I->click('Apply'); $I->canSee('Action processing results'); @@ -79,15 +79,15 @@ public function testBulkEdits(AcceptanceTester $I) { switch ($node->bundle()) { case 'stanford_event': - $I->canSeeInField('Event Types', $event_foo_bar_baz->id()); + $I->canSeeOptionIsSelected('Event Types (value 1)', $event_foo_bar_baz->label()); break; case 'stanford_news': - $I->canSeeInField('News Types', $news_foo_bar_baz->id()); + $I->canSeeOptionIsSelected('News Types (value 1)', $news_foo_bar_baz->label()); break; case 'stanford_publication': - $I->canSeeInField('Publication Types', $pubs_foo_bar_baz->id()); + $I->canSeeOptionIsSelected('Publication Types (value 1)', $pubs_foo_bar_baz->label()); break; } } diff --git a/tests/codeception/acceptance/Paragraphs/ListsCest.php b/tests/codeception/acceptance/Paragraphs/ListsCest.php index 388470bec..7226fabfd 100644 --- a/tests/codeception/acceptance/Paragraphs/ListsCest.php +++ b/tests/codeception/acceptance/Paragraphs/ListsCest.php @@ -103,15 +103,15 @@ public function testSharedTags(AcceptanceTester $I) { $I->logInWithRole('contributor'); $I->amOnPage($basic_page->toUrl('edit-form')->toString()); - $I->canSeeInField('Shared Tags', $shared_tag->id()); + $I->canSeeOptionIsSelected('Shared Tags (value 1)', $shared_tag->label()); $I->amOnPage($news->toUrl('edit-form')->toString()); - $I->canSeeInField('Shared Tags', $shared_tag->id()); + $I->canSeeOptionIsSelected('Shared Tags (value 1)', $shared_tag->label()); $I->amOnPage($event->toUrl('edit-form')->toString()); - $I->canSeeInField('Shared Tags', $shared_tag->id()); + $I->canSeeOptionIsSelected('Shared Tags (value 1)', $shared_tag->label()); $I->amOnPage($person->toUrl('edit-form')->toString()); - $I->canSeeInField('Shared Tags', $shared_tag->id()); + $I->canSeeOptionIsSelected('Shared Tags (value 1)', $shared_tag->label()); $I->amOnPage($publication->toUrl('edit-form')->toString()); - $I->canSeeInField('Shared Tags', $shared_tag->id()); + $I->canSeeOptionIsSelected('Shared Tags (value 1)', $shared_tag->label()); } /** diff --git a/tests/codeception/functional/Content/StanfordNewsCest.php b/tests/codeception/functional/Content/StanfordNewsCest.php index f0291d35d..242ac7476 100644 --- a/tests/codeception/functional/Content/StanfordNewsCest.php +++ b/tests/codeception/functional/Content/StanfordNewsCest.php @@ -48,44 +48,45 @@ public function testTermOrder(FunctionalTester $I) { $I->amOnPage($node->toUrl('edit-form')->toString()); $I->canSeeInField('Headline', $node->label()); - $I->waitForElementVisible('.field--name-su-news-topics [data-shs-delta="0"] select'); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="0"] select', $first_term->label()); + + $I->waitForElementVisible('.form-item--su-news-topics-0-target-id select.simpler-select'); + $I->selectOption('.form-item--su-news-topics-0-target-id select.simpler-select', $first_term->id()); $I->click('Add another item', '.field--name-su-news-topics'); - $I->waitForElementVisible('.field--name-su-news-topics [data-shs-delta="1"] select'); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="1"] select', $second_term->label()); + $I->waitForElementVisible('.form-item--su-news-topics-1-target-id select.simpler-select'); + $I->selectOption('.form-item--su-news-topics-1-target-id select.simpler-select', $second_term->id()); $I->click('Add another item', '.field--name-su-news-topics'); - $I->waitForElementVisible('.field--name-su-news-topics [data-shs-delta="2"] select'); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="2"] select', $third_term->label()); + $I->waitForElementVisible('.form-item--su-news-topics-2-target-id select.simpler-select'); + $I->selectOption('.form-item--su-news-topics-2-target-id select.simpler-select', $third_term->id()); $I->click('Save'); $I->canSee($node->label(), 'h1'); $I->canSee($first_term->label() . ', ' . $second_term->label() . ', '. $third_term->label()); $I->amOnPage($node->toUrl('edit-form')->toString()); - $I->waitForElementVisible('.field--name-su-news-topics [data-shs-delta="2"] select'); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="0"] select', $second_term->label()); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="1"] select', $first_term->label()); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="2"] select', $third_term->label()); + $I->waitForElementVisible('.form-item--su-news-topics-2-target-id select.simpler-select'); + $I->selectOption('.form-item--su-news-topics-0-target-id select.simpler-select', $second_term->id()); + $I->selectOption('.form-item--su-news-topics-1-target-id select.simpler-select', $first_term->id()); + $I->selectOption('.form-item--su-news-topics-2-target-id select.simpler-select', $third_term->id()); $I->click('Save'); $I->canSee($node->label(), 'h1'); $I->canSee($second_term->label() . ', ' . $first_term->label() . ', '. $third_term->label()); $I->amOnPage($node->toUrl('edit-form')->toString()); - $I->waitForElementVisible('.field--name-su-news-topics [data-shs-delta="2"] select'); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="0"] select', $third_term->label()); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="1"] select', $second_term->label()); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="2"] select', $first_term->label()); + $I->waitForElementVisible('.form-item--su-news-topics-2-target-id select.simpler-select'); + $I->selectOption('.form-item--su-news-topics-0-target-id select.simpler-select', $third_term->id()); + $I->selectOption('.form-item--su-news-topics-1-target-id select.simpler-select', $second_term->id()); + $I->selectOption('.form-item--su-news-topics-2-target-id select.simpler-select', $first_term->id()); $I->click('Save'); $I->canSee($node->label(), 'h1'); $I->canSee($third_term->label() . ', ' . $second_term->label() . ', '. $first_term->label()); $I->amOnPage($node->toUrl('edit-form')->toString()); - $I->waitForElementVisible('.field--name-su-news-topics [data-shs-delta="2"] select'); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="0"] select', $third_term->label()); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="1"] select', $first_term->label()); - $I->selectOption('.field--name-su-news-topics [data-shs-delta="2"] select', $second_term->label()); + $I->waitForElementVisible('.form-item--su-news-topics-2-target-id select.simpler-select'); + $I->selectOption('.form-item--su-news-topics-0-target-id select.simpler-select', $third_term->id()); + $I->selectOption('.form-item--su-news-topics-1-target-id select.simpler-select', $first_term->id()); + $I->selectOption('.form-item--su-news-topics-2-target-id select.simpler-select', $second_term->id()); $I->click('Save'); $I->canSee($node->label(), 'h1');