Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… question, when currentDate() is used, the data overlaps the question box
  • Loading branch information
tsv2013 committed May 30, 2024
1 parent d7934ca commit 526e303
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/defaultV2-theme/blocks/sd-expression.scss
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 31 additions & 2 deletions visualRegressionTests/tests/defaultV2/expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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);
});
});

});

0 comments on commit 526e303

Please sign in to comment.