Skip to content

Commit

Permalink
update visual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Jan 9, 2025
1 parent 01b0242 commit 9838fbf
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 120 deletions.
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.
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.
196 changes: 76 additions & 120 deletions visualRegressionTests/tests/designer/page-navigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,81 +421,59 @@ test("Page navigator has enough space to be shown", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1508, 800);
await setJSON({
title: "NPS Survey Question",
pages: [
"title": "NPS Survey Question",
"widthMode": "responsive",
"pages": [
{
name: "page1",
elements: [
"name": "page1",
"elements": [
{
type: "rating",
name: "nps_score",
title:
"On a scale of zero to ten, how likely are you to recommend our product to a friend or colleague?",
isRequired: true,
rateCount: 11,
rateMin: 0,
rateMax: 10,
minRateDescription: "(Most unlikely)",
maxRateDescription: "(Most likely)",
"type": "comment",
"name": "nps_score",
"title": "On a scale of zero to ten, how likely are you to recommend our product to a friend or colleague?",
"isRequired": true
},
{
type: "checkbox",
name: "promoter_features",
visibleIf: "{nps_score} >= 9",
title: "Which of the following features do you value the most?",
description: "Please select no more than three features.",
isRequired: true,
validators: [
{
type: "answercount",
text: "Please select no more than three features.",
maxCount: 3,
},
],
choices: [
"Performance",
"Stability",
"User interface",
"Complete functionality",
"Learning materials (documentation, demos, code examples)",
"Quality support",
],
showOtherItem: true,
otherText: "Other features:",
colCount: 2,
"type": "comment",
"name": "promoter_features",
"visibleIf": "{nps_score} >= 9",
"title": "Which of the following features do you value the most?",
"description": "Please select no more than three features.",
"isRequired": true,
"rows": 6
},
{
type: "comment",
name: "passive_experience",
visibleIf: "{nps_score} >= 7 and {nps_score} <= 8",
title: "What can we do to make your experience more satisfying?",
"type": "comment",
"name": "passive_experience",
"visibleIf": "{nps_score} >= 7 and {nps_score} <= 8",
"title": "What can we do to make your experience more satisfying?",
"rows": 6
},
{
type: "comment",
name: "disappointing_experience",
visibleIf: "{nps_score} <= 6",
title:
"Please let us know why you had such a disappointing experience with our product",
},
],
"type": "comment",
"name": "disappointing_experience",
"visibleIf": "{nps_score} <= 6",
"title": "Please let us know why you had such a disappointing experience with our product"
}
]
},
{
name: "page2",
elements: [
"name": "page2",
"elements": [
{
type: "text",
name: "question1",
"type": "text",
"name": "question1"
},
{
type: "text",
name: "question2",
"type": "text",
"name": "question2"
},
{
type: "text",
name: "question3",
},
],
},
"type": "text",
"name": "question3"
}
]
}
],
});
await ClientFunction(() => { document.body.focus(); })();
Expand All @@ -512,81 +490,59 @@ test("Page navigator in by-page mode has enough space to be shown", async (t) =>
window["creator"].pageEditMode = "bypage";
})();
await setJSON({
title: "NPS Survey Question",
pages: [
"title": "NPS Survey Question",
"widthMode": "responsive",
"pages": [
{
name: "page1",
elements: [
"name": "page1",
"elements": [
{
type: "rating",
name: "nps_score",
title:
"On a scale of zero to ten, how likely are you to recommend our product to a friend or colleague?",
isRequired: true,
rateCount: 11,
rateMin: 0,
rateMax: 10,
minRateDescription: "(Most unlikely)",
maxRateDescription: "(Most likely)",
"type": "comment",
"name": "nps_score",
"title": "On a scale of zero to ten, how likely are you to recommend our product to a friend or colleague?",
"isRequired": true
},
{
type: "checkbox",
name: "promoter_features",
visibleIf: "{nps_score} >= 9",
title: "Which of the following features do you value the most?",
description: "Please select no more than three features.",
isRequired: true,
validators: [
{
type: "answercount",
text: "Please select no more than three features.",
maxCount: 3,
},
],
choices: [
"Performance",
"Stability",
"User interface",
"Complete functionality",
"Learning materials (documentation, demos, code examples)",
"Quality support",
],
showOtherItem: true,
otherText: "Other features:",
colCount: 2,
"type": "comment",
"name": "promoter_features",
"visibleIf": "{nps_score} >= 9",
"title": "Which of the following features do you value the most?",
"description": "Please select no more than three features.",
"isRequired": true,
"rows": 6
},
{
type: "comment",
name: "passive_experience",
visibleIf: "{nps_score} >= 7 and {nps_score} <= 8",
title: "What can we do to make your experience more satisfying?",
"type": "comment",
"name": "passive_experience",
"visibleIf": "{nps_score} >= 7 and {nps_score} <= 8",
"title": "What can we do to make your experience more satisfying?",
"rows": 6
},
{
type: "comment",
name: "disappointing_experience",
visibleIf: "{nps_score} <= 6",
title:
"Please let us know why you had such a disappointing experience with our product",
},
],
"type": "comment",
"name": "disappointing_experience",
"visibleIf": "{nps_score} <= 6",
"title": "Please let us know why you had such a disappointing experience with our product"
}
]
},
{
name: "page2",
elements: [
"name": "page2",
"elements": [
{
type: "text",
name: "question1",
"type": "text",
"name": "question1"
},
{
type: "text",
name: "question2",
"type": "text",
"name": "question2"
},
{
type: "text",
name: "question3",
},
],
},
"type": "text",
"name": "question3"
}
]
}
],
});
await ClientFunction(() => { document.body.focus(); })();
Expand Down

0 comments on commit 9838fbf

Please sign in to comment.