From 526e3035b3f8aecea7860c63c88b03f5c91e66f2 Mon Sep 17 00:00:00 2001 From: tsv2013 Date: Thu, 30 May 2024 11:53:46 +0300 Subject: [PATCH] Fixed https://github.com/surveyjs/service/issues/2226 - In Expression question, when currentDate() is used, the data overlaps the question box --- src/defaultV2-theme/blocks/sd-expression.scss | 2 ++ .../etalons/expression-word-breaks.png | Bin 0 -> 10421 bytes .../tests/defaultV2/expression.ts | 33 ++++++++++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 visualRegressionTests/tests/defaultV2/etalons/expression-word-breaks.png 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 0000000000000000000000000000000000000000..5995dc193f8d3581e3de5f16f0266606b49c301c GIT binary patch literal 10421 zcmdVAWl&sA7$r<_2o_v}yAAHHgF|o#?hbUt*LDTD=EW?a-_HrqGT={BpW8miIB5%F?aU&5lM z*?FW-<_PMsHh8SiZ5Xnrb3X2wCxcSZcrdImW$_Qh$Fn!~IR>3GIY4`3Vyf637cq_i z%L(FO3~~K0mJ^v^!aXvzZQ4c{N55~{{ zL#jz?{6A966>d9JxMYs$GpPK~j@`{)2@`ht^7*=BMrN-BETJK!kQh{9|4s3Q+N5GVcBr$v6ToVgY{rmogD75~2L{k3bs0A3{8 z#0Qz_b`4`^!dgq2~ z|DmOJbZ5hRk=b*9^ZVI(|L&kyc;1yDk8Z>BM1dC=|L3!#rml4&aEHtbX~)IB|9BpM zh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literal 0 HcmV?d00001 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); + }); + }); + });