Skip to content

Commit

Permalink
Fixes #7141
Browse files Browse the repository at this point in the history
  • Loading branch information
novikov82 committed Oct 17, 2023
1 parent 01d21e1 commit 0492e34
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/defaultV2-theme/blocks/sd-expression.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
color: $font-questiontitle-color;
font-size: calcFontSize(1);
}
.sd-question__content--left .sd-expression {
line-height: calcSize(3);
margin-top: calcSize(1.5);
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions visualRegressionTests/tests/defaultV2/expression.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Selector, ClientFunction } from "testcafe";
import { url, frameworks, initSurvey, setOptions, url_test, takeElementScreenshot, wrapVisualTest, resetFocusToBody } from "../../helper";

const title = "Expression Screenshot";

fixture`${title}`.page`${url}`.beforeEach(async (t) => {

});

const applyTheme = ClientFunction(theme => {
(<any>window).Survey.StylesManager.applyTheme(theme);
});

const theme = "defaultV2";

frameworks.forEach(framework => {
fixture`${framework} ${title} ${theme}`
.page`${url_test}${theme}/${framework}`.beforeEach(async t => {
await applyTheme(theme);
});

test("Check expression question", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 1080);
await initSurvey(framework, {
questions: [
{
"type": "expression",
"name": "q1",
"title": "Question1",
"titleLocation": "left",
"expression": "123"
},
{
"type": "expression",
"name": "q2",
"title": "Question2",
"expression": "123"
},
],
"focusFirstQuestionAutomatic": true
});
await takeElementScreenshot("expression-title-left.png", Selector(".sd-question[data-name=q1]"), t, comparer);
await takeElementScreenshot("expression-title-top.png", Selector(".sd-question[data-name=q2]"), t, comparer);
});
});

});

0 comments on commit 0492e34

Please sign in to comment.