-
Notifications
You must be signed in to change notification settings - Fork 814
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7165 from surveyjs/issue/7141-expression-title-lo…
…cation-left Expression titleLocation left Fixes #7141
- Loading branch information
Showing
9 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { StylesManager } from "survey-core"; | ||
import { registerMarkupTest } from "./helper"; | ||
|
||
registerMarkupTest( | ||
{ | ||
name: "Test Expression question markup", | ||
json: { | ||
questions: [ | ||
{ | ||
name: "name", | ||
type: "expression", | ||
expression: "123", | ||
titleLocation: "hidden" | ||
} | ||
] | ||
}, | ||
snapshot: "expression", | ||
removeIds: true, | ||
before: () => StylesManager.applyTheme("defaultV2"), | ||
after: () => StylesManager.applyTheme("default"), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div class="sd-expression">123</div> |
Binary file added
BIN
+2.8 KB
visualRegressionTests/tests/defaultV2/etalons/expression-title-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.23 KB
visualRegressionTests/tests/defaultV2/etalons/expression-title-top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); | ||
|
||
}); | ||
|