From 58ca138da90fffea493d3e487560e44e9ee79e3b Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Wed, 25 Mar 2020 14:22:49 +0100 Subject: [PATCH] Add unit test for handling empty paragraphs within text block [MAILPOET-2821] --- .../Newsletter/Renderer/Blocks/TextTest.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/unit/Newsletter/Renderer/Blocks/TextTest.php b/tests/unit/Newsletter/Renderer/Blocks/TextTest.php index d20b7c6932..88e6a44568 100644 --- a/tests/unit/Newsletter/Renderer/Blocks/TextTest.php +++ b/tests/unit/Newsletter/Renderer/Blocks/TextTest.php @@ -80,6 +80,28 @@ class TextTest extends \MailPoetUnitTest { expect($blockquoteTable)->equals($expectedResult); } + public function testItShouldRemoveEmptyParagraphs() { + $this->block['text'] = '

Text

Text2

'; + $output = Text::render($this->block); + $expectedResult = ' + + +
+ + +
+ Text

+
+ + +
+ Text2

+
+ + '; + expect($output)->equals($expectedResult); + } + public function testItStylesHeadings() { $this->block['text'] = '

Heading

Heading 2

'; $output = Text::render($this->block);