Skip to content

Commit

Permalink
Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
imonroe committed Oct 3, 2023
1 parent 7b8e8b6 commit 57ddafe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 57ddafe

Please sign in to comment.