From efd5169e10d9d4561885bb680ba0816848b98d6c Mon Sep 17 00:00:00 2001 From: Aleksey Novikov Date: Thu, 17 Aug 2023 15:18:36 +0300 Subject: [PATCH] #6741 Empty title should have non-zero height Fixes #6741 --- src/defaultV2-theme/blocks/sd-element.scss | 3 +++ .../etalons/question-empty-title.png | Bin 0 -> 1258 bytes .../tests/defaultV2/question.ts | 20 ++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 visualRegressionTests/tests/defaultV2/etalons/question-empty-title.png diff --git a/src/defaultV2-theme/blocks/sd-element.scss b/src/defaultV2-theme/blocks/sd-element.scss index 8a22bcc20b..5d64868970 100644 --- a/src/defaultV2-theme/blocks/sd-element.scss +++ b/src/defaultV2-theme/blocks/sd-element.scss @@ -58,6 +58,9 @@ .sv-string-viewer { white-space: normal; + &::before { + content: "\200B"; + } } } diff --git a/visualRegressionTests/tests/defaultV2/etalons/question-empty-title.png b/visualRegressionTests/tests/defaultV2/etalons/question-empty-title.png new file mode 100644 index 0000000000000000000000000000000000000000..807da65e530b3b20b9ecdebb9962dcc7b4999a2b GIT binary patch literal 1258 zcmeAS@N?(olHy`uVBq!ia0y~yU^)V1FW_JUlHBX7o&hN)PZ!6K3dT25b(a_zSQdkL zZx8Oxjp>wRz3}_pnF5Bw1cSmSd?Ck}ZXXPLz!uUi74YK3%wp4x4PF6G37%dl3R!hJ zt><)K1m3qy|M}(R<)yjn)~(xgH*d3!Hv_|i@Y0^8^X@^7yY*T|MPSH&%bBi z|8!?yNSM3rXW+ko(f@v`-LE;(4%A|03iNLTGXq02nDN>8&c5@zx4-}N4;T&~f=%rY zzm5Mn=lsvtU~cZ`!+X!k=f^#--}6s7KaQP&p>7v2HrcX)CU2k}BR8($`0?X+?%#j@ z`uh5vF?x&)345odp3K{R`s`U>zINwpd9$Zh*VLT3dpGvm@7lP%Ra3Wtl$?8B+;=?r z-Me?6?mjFyF)Md-k-xvcr3~NBUAs=DZ3af~>vF5Pn{L1T^ySNx!w)Bz-cEaZ>)ESU zTEH}LdJ_vn!`J9(s`q94kFSZ{Tr~Tv8W4enrzb{E%Q2e`L?DS=W`+Z&ub5?DAGB!% z(_w4wY|>$5c#s-3O*Q*E8mDgm`IjZ9o)!UvNB{8CqLV-lQ0Nvg@P7Zb%PqE%1Lv%W z{imN!TD^KTFgLBaYo>ny7!`TjxfvM#>_<&b@N_ju80ViC1C#0^U}0cqZx2kqYE^Z0 ze)4j1ObiUdwl+2?)mC#qeSCcU&Ye3c`|qc3zR3bi;i1bfYsT-ZIr;Z*?Y`go9g{on VHf`A304%&1JYD@<);T3K0RZl*!g~M! literal 0 HcmV?d00001 diff --git a/visualRegressionTests/tests/defaultV2/question.ts b/visualRegressionTests/tests/defaultV2/question.ts index a6c554128a..0385c9b165 100644 --- a/visualRegressionTests/tests/defaultV2/question.ts +++ b/visualRegressionTests/tests/defaultV2/question.ts @@ -41,6 +41,26 @@ frameworks.forEach(framework => { }); }); + test("Check question with empty title", async (t) => { + await wrapVisualTest(t, async (t, comparer) => { + await t.resizeWindow(1920, 1080); + await initSurvey(framework, { + questions: [ + { + type: "text", + title: " ", + name: "question", + minWidth: "708px", + maxWidth: "708px", + width: "708px", + }, + ] + }); + const questionRoot = Selector(".sd-question"); + await resetFocusToBody(); + await takeElementScreenshot("question-empty-title.png", questionRoot, t, comparer); + }); + }); test("Check question num", async (t) => { await wrapVisualTest(t, async (t, comparer) => { await t.resizeWindow(1920, 1080);