diff --git a/src/defaultV2-theme/blocks/sd-expression.scss b/src/defaultV2-theme/blocks/sd-expression.scss index 792fe5405d..02b4c816ca 100644 --- a/src/defaultV2-theme/blocks/sd-expression.scss +++ b/src/defaultV2-theme/blocks/sd-expression.scss @@ -1,7 +1,9 @@ .sd-expression { color: $font-questiontitle-color; font-size: calcFontSize(1); + white-space: break-spaces; } + .sd-question__content--left .sd-expression { line-height: calcSize(3); padding: calcSize(1.5) 0; diff --git a/visualRegressionTests/tests/defaultV2/etalons/expression-word-breaks.png b/visualRegressionTests/tests/defaultV2/etalons/expression-word-breaks.png new file mode 100644 index 0000000000..5995dc193f Binary files /dev/null and b/visualRegressionTests/tests/defaultV2/etalons/expression-word-breaks.png differ diff --git a/visualRegressionTests/tests/defaultV2/expression.ts b/visualRegressionTests/tests/defaultV2/expression.ts index 3af8a41fbf..0799cef80e 100644 --- a/visualRegressionTests/tests/defaultV2/expression.ts +++ b/visualRegressionTests/tests/defaultV2/expression.ts @@ -16,8 +16,8 @@ const theme = "defaultV2"; frameworks.forEach(framework => { fixture`${framework} ${title} ${theme}` .page`${url_test}${theme}/${framework}`.beforeEach(async t => { - await applyTheme(theme); - }); + await applyTheme(theme); + }); test("Check expression question", async (t) => { await wrapVisualTest(t, async (t, comparer) => { @@ -45,5 +45,34 @@ frameworks.forEach(framework => { }); }); + test("Expression text breaks into lines", async (t) => { + await wrapVisualTest(t, async (t, comparer) => { + await t.resizeWindow(1920, 1080); + await initSurvey(framework, { + "logoPosition": "right", + "pages": [ + { + "name": "page1", + "elements": [ + { + "type": "text", + "name": "question1" + }, + { + "type": "expression", + "name": "question2", + "startWithNewLine": false, + "expression": "currentDate()" + } + ] + } + ], + "widthMode": "static", + "width": "800px" + }); + await takeElementScreenshot("expression-word-breaks.png", Selector(".sd-question[data-name=question2]"), t, comparer); + }); + }); + });