diff --git a/src/defaultV2-theme/blocks/sd-paneldynamic.scss b/src/defaultV2-theme/blocks/sd-paneldynamic.scss index 5fdae4b742..c4b3df8bf7 100644 --- a/src/defaultV2-theme/blocks/sd-paneldynamic.scss +++ b/src/defaultV2-theme/blocks/sd-paneldynamic.scss @@ -40,6 +40,10 @@ border: none; } +.sd-paneldynamic__separator:only-child { + display: none; +} + .sd-paneldynamic__panel-wrapper { padding-bottom: calc(1 * var(--sd-base-padding)); } diff --git a/visualRegressionTests/tests/defaultV2/etalons/paneldynamic-without-buttons.png b/visualRegressionTests/tests/defaultV2/etalons/paneldynamic-without-buttons.png new file mode 100644 index 0000000000..bff58b9364 Binary files /dev/null and b/visualRegressionTests/tests/defaultV2/etalons/paneldynamic-without-buttons.png differ diff --git a/visualRegressionTests/tests/defaultV2/paneldynamic.ts b/visualRegressionTests/tests/defaultV2/paneldynamic.ts index 090e068cc3..a0b57f5bcb 100644 --- a/visualRegressionTests/tests/defaultV2/paneldynamic.ts +++ b/visualRegressionTests/tests/defaultV2/paneldynamic.ts @@ -285,3 +285,110 @@ frameworks.forEach(framework => { }); }); }); + +frameworks.forEach(framework => { + const json = { + "logoPosition": "right", + "pages": [ + { + "name": "page1", + "elements": [ + { + type: "paneldynamic", + name: "relatives", + title: "Panel Dynamic", + templateTitle: "Information about: {panel.relativeType}", + templateElements: [ + { + name: "relativeType", + type: "dropdown", + title: "Relative", + choices: [ + "father", + "mother", + "brother", + "sister", + "son", + "daughter" + ], + isRequired: true + }, + { + name: "isalive", + type: "radiogroup", + title: "Alive?", + startWithNewLine: false, + isRequired: true, + colCount: 0, + choices: ["Yes", "No"] + }, + { + name: "liveage", + type: "dropdown", + title: "Age", + isRequired: true, + startWithNewLine: false, + visibleIf: "{panel.isalive} = 'Yes'", + choicesMin: 1, + choicesMax: 115 + }, + { + name: "deceasedage", + type: "dropdown", + title: "Deceased Age", + isRequired: true, + startWithNewLine: false, + visibleIf: "{panel.isalive} = 'No'", + choices: [ + { + value: -1, + text: "Unknown" + } + ], + choicesMin: 1, + choicesMax: 115 + }, + { + name: "causeofdeathknown", + type: "radiogroup", + title: "Cause of Death Known?", + isRequired: true, + colCount: 0, + startWithNewLine: false, + visibleIf: "{panel.isalive} = 'No'", + choices: ["Yes", "No"] + }, + { + name: "causeofdeath", + type: "text", + title: "Cause of Death", + isRequired: true, + startWithNewLine: false, + visibleIf: + "{panel.isalive} = 'No' and {panel.causeofdeathknown} = 'Yes'" + } + ], + panelCount: 1, + maxPanelCount: 1, + minPanelCount: 1 + } + ] + } + ] + }; + fixture`${framework} ${title} ${theme}` + .page`${url_test}${theme}/${framework}`.beforeEach(async t => { + await explicitErrorHandler(); + await applyTheme(theme); + await initSurvey(framework, json); + }); + test("Paneldynamic without buttons", async (t)=>{ + await wrapVisualTest(t, async (t, comparer) => { + await t.resizeWindow(1280, 900); + await ClientFunction(() => { + document.body.focus(); + })(); + await takeElementScreenshot("paneldynamic-without-buttons", Selector(".sd-question--paneldynamic"), t, comparer); + }); + }); +});