From 57ddafee339a43e1a7f766659274a67589d6ebea Mon Sep 17 00:00:00 2001 From: Ian Monroe Date: Tue, 3 Oct 2023 13:03:17 -0600 Subject: [PATCH] Updated test --- .../Plugin/paragraphs/Behavior/ListParagraphBehavior.php | 3 +-- .../paragraphs/Behavior/ListParagraphBehaviorTest.php | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/jumpstart_ui/src/Plugin/paragraphs/Behavior/ListParagraphBehavior.php b/modules/jumpstart_ui/src/Plugin/paragraphs/Behavior/ListParagraphBehavior.php index 099d68fc..1db1fa98 100644 --- a/modules/jumpstart_ui/src/Plugin/paragraphs/Behavior/ListParagraphBehavior.php +++ b/modules/jumpstart_ui/src/Plugin/paragraphs/Behavior/ListParagraphBehavior.php @@ -51,12 +51,11 @@ public function buildBehaviorForm(ParagraphInterface $paragraph, array &$form, F * {@inheritDoc} */ public function view(array &$build, ParagraphInterface $paragraph, EntityViewDisplayInterface $display, $view_mode) { - if (!isset($build['su_list_view']) || !empty(Element::children($build['su_list_view']))) { return; } - // If there is no empty message set, it will be null. + // If there is no empty message set, this will be null. $build['su_list_view']['#markup'] = $paragraph->getBehaviorSetting('list_paragraph', 'empty_message'); if ($paragraph->getBehaviorSetting('list_paragraph', 'hide_empty')) { diff --git a/modules/jumpstart_ui/tests/src/Unit/Plugin/paragraphs/Behavior/ListParagraphBehaviorTest.php b/modules/jumpstart_ui/tests/src/Unit/Plugin/paragraphs/Behavior/ListParagraphBehaviorTest.php index 286b77cb..b97ab8e5 100644 --- a/modules/jumpstart_ui/tests/src/Unit/Plugin/paragraphs/Behavior/ListParagraphBehaviorTest.php +++ b/modules/jumpstart_ui/tests/src/Unit/Plugin/paragraphs/Behavior/ListParagraphBehaviorTest.php @@ -72,7 +72,13 @@ public function testBehavior() { $plugin->view($build, $paragraph, $display, 'default'); $this->assertEquals(['su_list_view' => [], '#cache' => []], $build); - $build = ['su_list_view' => [], '#cache' => []]; + $build = [ + 'su_list_view' => [], + 'su_list_button' => [], + 'su_list_description' => [], + 'su_list_headline' => [], + '#cache' => [] + ]; $this->paragraphBehavior['hide_empty'] = TRUE; $plugin->view($build, $paragraph, $display, 'default'); $this->assertEquals(['#cache' => []], $build);