From 0a5dc3d2be1f570830bdc2063be305baa9969809 Mon Sep 17 00:00:00 2001 From: OlgaLarina Date: Thu, 6 Jun 2024 12:40:34 +0300 Subject: [PATCH] layout improvements - add unit test --- tests/surveytests.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/surveytests.ts b/tests/surveytests.ts index 8a05005647..35178160b7 100644 --- a/tests/surveytests.ts +++ b/tests/surveytests.ts @@ -6887,6 +6887,25 @@ QUnit.test("Define questionTitleLocation on Panel/Page level", function ( assert.equal(q.getTitleLocation(), "top", "get from survey again"); }); +QUnit.test("Define questionTitleWidth on Panel/Page level", function (assert) { + const survey = new SurveyModel(); + const page = survey.addNewPage("page"); + const panel = page.addNewPanel("panel"); + const panel2 = panel.addNewPanel("panel2"); + const q = panel2.addNewQuestion("text"); + page.questionTitleLocation = "left"; + + assert.equal(q.titleWidth, undefined, "init"); + page.questionTitleWidth = "500px"; + assert.equal(q.titleWidth, "500px", "get from page"); + + panel.questionTitleWidth = "50%"; + assert.equal(q.titleWidth, "50%", "get from panel"); + + panel2.questionTitleWidth = "200px"; + assert.equal(q.titleWidth, "200px", "get from panel2"); +}); + QUnit.test("Question property.page getChoices", function (assert) { var property = Serializer.findProperty("questionbase", "page"); assert.ok(property, "page property is here");