Add background color indicating class also for custom backgrounds
[MAILPOET-2609]
This commit is contained in:
committed by
Pavel Dohnal
parent
ab1e2ef0a9
commit
6b718dfb2c
@ -29,6 +29,8 @@ class Columns {
|
||||
if (!empty($params['background_color'])) {
|
||||
$classes[] = "has-{$params['background_color']}-background-color";
|
||||
$classes[] = "mailpoet_column_has_background";
|
||||
} elseif (!empty($params['custom_background_color'])) {
|
||||
$classes[] = "mailpoet_column_has_background";
|
||||
}
|
||||
if (!empty($params['text_color'])) {
|
||||
$classes[] = "has-{$params['text_color']}-color";
|
||||
|
@ -71,9 +71,11 @@ class ColumnsTest extends \MailPoetUnitTest {
|
||||
$block = $this->block;
|
||||
$block['params']['custom_background_color'] = '#ffffff';
|
||||
$html = $this->columns->render($block, 'content');
|
||||
$columns = $this->htmlParser->getElementByXpath($html, '//div[@class="mailpoet_form_columns"]');
|
||||
$columns = $this->htmlParser->getElementByXpath($html, '//div[1]');
|
||||
$style = $this->htmlParser->getAttribute($columns, 'style');
|
||||
expect($style->textContent)->contains('background-color:#ffffff;');
|
||||
$class = $this->htmlParser->getAttribute($columns, 'class');
|
||||
expect($class->textContent)->contains('mailpoet_column_has_background');
|
||||
}
|
||||
|
||||
public function testItShouldCustomTextColor() {
|
||||
|
Reference in New Issue
Block a user