Skip to content

Commit

Permalink
Add unit test for bug #7355
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed Nov 16, 2023
1 parent 5f610a5 commit 59e388c
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18081,4 +18081,35 @@ QUnit.test("clearInvisibleValues onHiddenContainer breaks defaultValueExpression
q1.value = "B";
assert.equal(q2.value, 24, "q1.value = B");
});

QUnit.test("Bug on loading json with collapsed panel. It was fixed in v1.9.117, #7355", function (assert) {
const survey = new SurveyModel({
elements: [
{
type: "panel",
name: "panel1",
elements: [
{
type: "matrixdropdown",
name: "q1",
columns: [
{
name: "Column 1",
cellType: "radiogroup",
showInMultipleColumns: true,
choices: ["item1", "item2", "item3"]
}
],
rows: ["Row 1", "Row 2"]
}
],
state: "collapsed"
}
]
});
const question = survey.getQuestionByName("q1");
const panel = survey.getPanelByName("panel1");
assert.equal(question.name, "q1", "Loaded correctly");
assert.equal(panel.isCollapsed, true, "panel is collapsed");
panel.expand();
assert.equal(panel.isCollapsed, false, "panel is not collapsed");
});

0 comments on commit 59e388c

Please sign in to comment.