Add acceptance test for text input styles settings in form editor

[MAILPOET-2599]
This commit is contained in:
Rostislav Wolny
2020-03-05 17:51:37 +01:00
committed by Veljko V
parent 126f988e8c
commit 4726b285c5
5 changed files with 79 additions and 3 deletions

View File

@ -96,11 +96,16 @@ class BlockRendererHelper {
) {
return $html;
}
$automationId = null;
if (in_array($block['id'], ['email', 'last_name', 'first_name'], true)) {
$automationId = 'data-automation-id="form_' . $block['id'] . '_label" ';
}
if (isset($block['params']['label'])
&& strlen(trim($block['params']['label'])) > 0) {
$html .= '<label '
. 'class="mailpoet_' . $block['type'] . '_label" '
. $this->renderFontStyle($formSettings, $block['styles'] ?? [])
. ($automationId ?? '')
. '>';
$html .= htmlspecialchars($block['params']['label']);