Skip to content

Commit

Permalink
#6776 - colored rating
Browse files Browse the repository at this point in the history
  • Loading branch information
novikov82 committed Apr 4, 2024
1 parent d244b7a commit 3438507
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/defaultV2-theme/blocks/sd-rating.scss
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ legend+sv-ng-rating-item+.sd-rating__item-smiley {
opacity: 1;
}

.sd-rating__item-smiley--scale-colored {

&.sd-rating__item-smiley--selected,
&.sd-rating__item-smiley--readonly,
&.sd-rating__item-smiley--preview {
opacity: 1;
}
}
.sd-rating__item-star {
position: relative;
width: calcSize(6);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions visualRegressionTests/tests/defaultV2/readonly-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,35 @@ frameworks.forEach(framework => {
await takeElementScreenshot("preview-rating-smileys.png", Selector(".sd-question__content"), t, comparer);
});
});
test("Rating Smileys colored ReadOnly and Preview", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 600);
await initSurvey(framework, {
showPreviewBeforeComplete: "showAnsweredQuestions",
showQuestionNumbers: "off",
questions: [
{
"type": "rating",
"name": "nps-score",
"title": "Rating",
"rateType": "smileys",
"rateMin": 1,
"rateMax": 5,
"minRateDescription": "Not Satisfied",
"maxRateDescription": "Completely Satisfied",
"defaultValue": 4,
"readOnly": true,
"scaleColorMode": "colored",
}
]
});
await takeElementScreenshot("readonly-rating-smileys-colored.png", Selector(".sd-question__content"), t, comparer);
await ClientFunction(() => {
(<any>window).survey.showPreview();
})();
await takeElementScreenshot("preview-rating-smileys-colored.png", Selector(".sd-question__content"), t, comparer);
});
});
test("Rating Smileys and Stars in matrix ReadOnly and Preview", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 600);
Expand Down

0 comments on commit 3438507

Please sign in to comment.