Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-wtt committed Dec 18, 2023
1 parent a077429 commit c400a5b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3537,6 +3537,20 @@ QUnit.test(
assert.deepEqual(survey.data, {}, "The value should be cleaned");
}
);
QUnit.test(
"clearInvisibleValues is onComplete (default value), visible and invisible questions with the same name and valueName",
function (assert) {
const survey = new SurveyModel();
const page = survey.addNewPage("page");
const q1 = <QuestionTextModel>page.addNewQuestion("text", "q1");
const q2 = <QuestionTextModel>page.addNewQuestion("text", "q2");
q2.valueName = "q1";
q2.value = 1;
q1.visible = false;
survey.doComplete();
assert.deepEqual(survey.data, { q1: 1 }, "The value should be kept");
}
);
QUnit.test("clearInvisibleValues - comments and other values, #309", function (
assert
) {
Expand Down

0 comments on commit c400a5b

Please sign in to comment.