Skip to content

Commit

Permalink
resolve #7097 Martix column and row title should be affected with fon…
Browse files Browse the repository at this point in the history
…t-width property. (#7123)

Co-authored-by: OlgaLarina <olga.larina.dev@gmail.com>
  • Loading branch information
OlgaLarina and OlgaLarina committed Oct 12, 2023
1 parent 582f078 commit 9fa6ee1
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/defaultV2-theme/blocks/sd-action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
appearance: none;
border: none;
display: flex;
align-items: center;
gap: calcSize(1);
background: transparent;
padding: calcSize(1) calcSize(3);
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-matrix.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
padding: calcSize(2);
}
.sd-matrix__cell:first-of-type {
font-weight: 600;
font-weight: $font-questiontitle-weight;
text-align: left;
}
3 changes: 2 additions & 1 deletion src/defaultV2-theme/blocks/sd-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
span {
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
font-weight: $font-questiontitle-weight;
}
}

Expand Down Expand Up @@ -276,7 +277,7 @@
}

.sd-table__cell--row-text {
font-weight: 600;
font-weight: $font-questiontitle-weight;
color: $font-questiontitle-color;
text-align: left;
min-width: calcSize(12);
Expand Down
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.
156 changes: 156 additions & 0 deletions visualRegressionTests/tests/defaultV2/themes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import { Selector, ClientFunction } from "testcafe";
import { url, frameworks, initSurvey, url_test, takeElementScreenshot, wrapVisualTest } from "../../helper";

const title = "Survey themes Screenshot";

fixture`${title}`.page`${url}`;

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 question title font size", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 1600);
await initSurvey(framework, {
"logoPosition": "right",
"showQuestionNumbers": "off",
"pages": [
{
"name": "page1",
"elements": [
{
"type": "file",
"name": "question5"
},
{
"type": "matrixdynamic",
"name": "question1",
"columns": [
{
"name": "Column 1"
},
{
"name": "Column 2"
},
{
"name": "Column 3"
}
],
"choices": [
1,
2,
3,
4,
5
]
},
{
"type": "paneldynamic",
"name": "question2",
"templateElements": [
{
"type": "text",
"name": "question3"
}
],
"panelCount": 3,
"minPanelCount": 3,
"renderMode": "tab"
}
]
},
{
"name": "page2",
"elements": [
{
"type": "text",
"name": "question4"
}
]
}
]
});
await ClientFunction(() => {
(<any>window).survey.applyTheme({
"cssVariables": {
"--sjs-font-questiontitle-size": "24px"
}
});
})();
await takeElementScreenshot("survey-theme-questiontitle-font-size.png", Selector(".sd-root-modern"), t, comparer);
});
});
test("Check question title font size", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 1600);
await initSurvey(framework, {
"logoPosition": "right",
"showQuestionNumbers": "off",
"elements": [{
type: "matrix",
name: "Quality",
title: "Matrix",
columns: [
{
value: 1,
text: "Strongly Disagree"
},
{
value: 2,
text: "Disagree"
},
{
value: 3,
text: "Neutral"
},
{
value: 4,
text: "Agree"
},
{
value: 5,
text: "Strongly Agree"
}
],
rows: [
{
value: "affordable",
text: "Product is affordable"
},
{
value: "does what it claims",
text: "Product does what it claims"
},
{
value: "better than others",
text: "Product is better than other products on the market"
},
{
value: "easy to use",
text: "Product is easy to use"
}
]
}]
});
await ClientFunction(() => {
(<any>window).survey.applyTheme({
"cssVariables": {
"--sjs-font-editorfont-size": "24px",
"--sjs-font-questiontitle-weight": "400"
}
});
})();
await takeElementScreenshot("survey-theme-questiontitle-font-weight.png", Selector(".sd-root-modern"), t, comparer);
});
});
});

0 comments on commit 9fa6ee1

Please sign in to comment.