diff --git a/functionalTests/designer/add-new-question.ts b/functionalTests/designer/add-new-question.ts index 252a468b3c..068e8b6f73 100644 --- a/functionalTests/designer/add-new-question.ts +++ b/functionalTests/designer/add-new-question.ts @@ -141,7 +141,6 @@ test("Add New Question with sub type", async t => { .expect(getVisibleElement(".svc-question__content-actions .svc-survey-element-toolbar-item__title").nth(1).textContent).eql("Stars"); let expectedJson = { - "logoPosition": "right", "pages": [ { "name": "page1", @@ -168,7 +167,6 @@ test("Add New Question with sub type", async t => { .expect(getVisibleElement(".svc-question__content-actions .svc-survey-element-toolbar-item__title").nth(1).textContent).eql("Password"); expectedJson = { - "logoPosition": "right", "pages": [ { "name": "page1", @@ -195,7 +193,6 @@ test("Add New Question with sub type", async t => { .expect(getVisibleElement(".svc-question__content-actions .svc-survey-element-toolbar-item__title").nth(1).textContent).eql("Labels"); expectedJson = { - "logoPosition": "right", "pages": [ { "name": "page1", diff --git a/functionalTests/designer/logo-image.ts b/functionalTests/designer/logo-image.ts index 9e7201fd23..f50c4c7337 100644 --- a/functionalTests/designer/logo-image.ts +++ b/functionalTests/designer/logo-image.ts @@ -21,7 +21,7 @@ test("Set logo in property grid and remove it in designer", async (t) => { }); test("Set logo in designer, change it and check it in test tab", async (t) => { - await setJSON({ pages: [{ name: "page1" }] }); + await setJSON({ pages: [{ name: "page1", "elements": [{ "type": "text", "name": "question1" }] }] }); await t .setFilesToUpload(Selector(".svc-logo-image input[type=file]"), "./image.jpg") .click(Selector(".svc-logo-image-placeholder svg")); diff --git a/functionalTests/designer/toolbox.ts b/functionalTests/designer/toolbox.ts index 95ece9a353..e7524c0013 100644 --- a/functionalTests/designer/toolbox.ts +++ b/functionalTests/designer/toolbox.ts @@ -373,7 +373,6 @@ test("toolbox subTypes: add items by drag-n-drop", async (t) => { .expect(toolboxSubTypesPopup.visible).notOk(); const expectedJson = { - "logoPosition": "right", "pages": [ { "name": "page1", @@ -418,7 +417,6 @@ test("toolbox subTypes: add items by click", async (t) => { .expect(toolboxSubTypesPopup.visible).ok(); const expectedJson = { - "logoPosition": "right", "pages": [ { "name": "page1", diff --git a/functionalTests/preview/toolbar.ts b/functionalTests/preview/toolbar.ts index b064f72150..16d562d444 100644 --- a/functionalTests/preview/toolbar.ts +++ b/functionalTests/preview/toolbar.ts @@ -23,6 +23,7 @@ const json = { }; const json2 = { + headerView: "basic", title: { default: "My Survey", de: "Meine Umfrage" diff --git a/packages/survey-creator-core/src/components/tabs/header-model.ts b/packages/survey-creator-core/src/components/tabs/header-model.ts index 73a189450f..07e5430ba4 100644 --- a/packages/survey-creator-core/src/components/tabs/header-model.ts +++ b/packages/survey-creator-core/src/components/tabs/header-model.ts @@ -4,6 +4,8 @@ import { fontsettingsFromCssVariable, fontsettingsToCssVariable } from "./theme- import { assign } from "../../utils/utils"; export class HeaderModel extends Base implements IHeader { + static primaryColorStr = "var(--sjs-primary-backcolor)"; + height: number; mobileHeight: number; inheritWidthFrom: "survey" | "container"; @@ -85,17 +87,17 @@ export class HeaderModel extends Base implements IHeader { private setHeaderBackgroundColorCssVariable(cssVariables: any) { if (this["backgroundColorSwitch"] === "none") { - cssVariables["--sjs-header-backcolor"] = "transparent"; + cssVariables["--sjs-header-backcolor"] = undefined; } else if (this["backgroundColorSwitch"] === "custom") { cssVariables["--sjs-header-backcolor"] = this["backgroundColor"] ?? "transparent"; } else { - cssVariables["--sjs-header-backcolor"] = undefined; + cssVariables["--sjs-header-backcolor"] = HeaderModel.primaryColorStr; } } private getBackgroundColorSwitchByValue(backgroundColor: string) { - if (!backgroundColor) return "accentColor"; - if (backgroundColor === "transparent") return "none"; + if (backgroundColor === HeaderModel.primaryColorStr) return "accentColor"; + if (!backgroundColor || backgroundColor === "transparent") return "none"; return "custom"; } @@ -112,7 +114,7 @@ function getDefaultTitleSetting() { function getDefaultDescriptionSetting(isAdvanced?: boolean) { const result = { family: settings.themeEditor.defaultFontFamily, weight: "400", size: 16 }; if (isAdvanced) { - result["weight"] = "600"; + result["size"] = 20; } return result; } @@ -151,7 +153,7 @@ Serializer.addClass( { type: "buttongroup", name: "headerView", - default: "basic", + default: "advanced", choices: [ { value: "basic" }, { value: "advanced" } @@ -171,7 +173,7 @@ Serializer.addClass( type: "spinedit", name: "height", visibleIf: (obj) => obj.headerView === "advanced", - default: 256, + default: 0, onPropertyEditorUpdate: function (obj: any, editor: any) { if (!!editor) { editor.unit = "px"; @@ -195,7 +197,7 @@ Serializer.addClass( type: "buttongroup", name: "inheritWidthFrom", visibleIf: (obj) => obj.headerView === "advanced", - default: "container", + default: "survey", choices: [ { value: "survey" }, { value: "container" } @@ -205,7 +207,7 @@ Serializer.addClass( type: "spinedit", name: "textAreaWidth", visibleIf: (obj) => obj.headerView === "advanced", - default: 512, + default: 0, onPropertyEditorUpdate: function (obj: any, editor: any) { if (!!editor) { editor.unit = "px"; @@ -218,7 +220,7 @@ Serializer.addClass( name: "backgroundColorSwitch", visibleIf: (obj) => obj.headerView === "advanced", isSerializable: false, - default: "accentColor", + default: "none", choices: [ { value: "none" }, { value: "accentColor" }, @@ -294,8 +296,8 @@ Serializer.addClass( } }, - getHorizontalAlignment("logoPositionX", "right"), - getVerticalAlignment("logoPositionY", "top"), + getHorizontalAlignment("logoPositionX", "left"), + getVerticalAlignment("logoPositionY", "bottom"), getHorizontalAlignment("titlePositionX", "left"), getVerticalAlignment("titlePositionY", "bottom"), getHorizontalAlignment("descriptionPositionX", "left"), diff --git a/packages/survey-creator-core/src/creator-base.ts b/packages/survey-creator-core/src/creator-base.ts index bcffa9b527..d2e3621b0c 100644 --- a/packages/survey-creator-core/src/creator-base.ts +++ b/packages/survey-creator-core/src/creator-base.ts @@ -2063,9 +2063,6 @@ export class SurveyCreatorModel extends Base * @returns true if initial survey doesn't have any elements or properties */ protected initSurveyWithJSON(json: any, clearState: boolean): void { - if (!json) { - json = { "logoPosition": "right" }; - } this.existingPages = {}; const survey = this.createSurvey({}, "designer", undefined, (survey: SurveyModel) => { survey.skeletonHeight = 188; diff --git a/packages/survey-creator-core/tests/creator-base-1.tests.ts b/packages/survey-creator-core/tests/creator-base-1.tests.ts index 489095bd94..2173b015c4 100644 --- a/packages/survey-creator-core/tests/creator-base-1.tests.ts +++ b/packages/survey-creator-core/tests/creator-base-1.tests.ts @@ -3170,44 +3170,6 @@ test("doClickQuestionCore", () => { expect(creator.survey.getAllQuestions()[3].startWithNewLine).toEqual(false); }); -test("logoPosition set right for emtpy survey only", () => { - const creator = new CreatorTester(); - expect(creator.survey.logoPosition).toEqual("right"); - creator.JSON = { - "pages": [ - { - "name": "page1", - "elements": [ - { - "type": "text", - "name": "question1" - } - ] - } - ] - }; - expect(creator.survey.logoPosition).toEqual("left"); - creator.JSON = { - "logoPosition": "top", - "pages": [ - { - "name": "page1", - "elements": [ - { - "type": "text", - "name": "question1" - } - ] - } - ] - }; - expect(creator.survey.logoPosition).toEqual("top"); - creator.text = ""; - expect(creator.survey.logoPosition).toEqual("right"); - creator.JSON = undefined; - expect(creator.survey.logoPosition).toEqual("right"); -}); - test("Add new question to Panel and Page", (): any => { surveySettings.animationEnabled = false; const creator = new CreatorTester(); @@ -3585,7 +3547,7 @@ test("get survey JSON with pageEditModeValue=single #2711", (): any => { try { let creator = new CreatorTester({ pageEditMode: "single" }); creator.text = ""; - expect(creator.JSON).toStrictEqual({ "logoPosition": "right" }); + expect(creator.JSON).toStrictEqual({ }); } finally { surveySettings.allowShowEmptyTitleInDesignMode = true; surveySettings.allowShowEmptyDescriptionInDesignMode = true; diff --git a/packages/survey-creator-core/tests/creator-base-2.tests.ts b/packages/survey-creator-core/tests/creator-base-2.tests.ts index 81aaad077c..438616eb1c 100644 --- a/packages/survey-creator-core/tests/creator-base-2.tests.ts +++ b/packages/survey-creator-core/tests/creator-base-2.tests.ts @@ -91,7 +91,7 @@ test("onModified is raised for mask settings", (): any => { test("json editor default indent", (): any => { const creator = new CreatorTester(); expect(settings.jsonEditor.indentation).toBe(2); - expect(creator.text).toBe("{\n \"logoPosition\": \"right\",\n \"pages\": [\n {\n \"name\": \"page1\"\n }\n ]\n}"); + expect(creator.text).toBe("{\n \"pages\": [\n {\n \"name\": \"page1\"\n }\n ]\n}"); }); test("onSetPropertyEditorOptions -> onConfigureTablePropertyEditor", (): any => { const creator = new CreatorTester(); diff --git a/packages/survey-creator-core/tests/tabs/theme-header-model.tests.ts b/packages/survey-creator-core/tests/tabs/theme-header-model.tests.ts index a9d2b5818a..9f196e0e49 100644 --- a/packages/survey-creator-core/tests/tabs/theme-header-model.tests.ts +++ b/packages/survey-creator-core/tests/tabs/theme-header-model.tests.ts @@ -26,7 +26,7 @@ test("IHeader de/serialization", (): any => { headerView: "advanced", header: { "height": 300, - "inheritWidthFrom": "survey", + "inheritWidthFrom": "container", "textAreaWidth": 600, "overlapEnabled": true, "backgroundImage": "https://t4.ftcdn.net/jpg/02/83/13/61/360_F_283136113_b3VRHNiOPFMOluzYJPpfuoH8Czh9c743.jpg", @@ -95,7 +95,7 @@ test("set headerViewContainer advanced", (): any => { header["headerView"] = "advanced"; header.height = 300; - header.inheritWidthFrom = "survey"; + header.inheritWidthFrom = "container"; header.textAreaWidth = 600; header["backgroundColorSwitch"] = "custom"; header["backgroundColor"] = "#5094ed"; @@ -116,7 +116,7 @@ test("set headerViewContainer advanced", (): any => { const result = themeModel.toJSON(); expect(result.header).toStrictEqual({ "height": 300, - "inheritWidthFrom": "survey", + "inheritWidthFrom": "container", "textAreaWidth": 600, "overlapEnabled": true, "backgroundImage": "https://t4.ftcdn.net/jpg/02/83/13/61/360_F_283136113_b3VRHNiOPFMOluzYJPpfuoH8Czh9c743.jpg", @@ -203,20 +203,19 @@ test("headerViewContainer: restore backgroundColorSwitch", (): any => { let themeModel = themePlugin.themeModel as ThemeModel; let header = themeModel.header as HeaderModel; - header["headerView"] = "advanced"; - expect(header["backgroundColorSwitch"]).toEqual("accentColor"); + expect(header["backgroundColorSwitch"]).toEqual("none"); expect(header["backgroundColor"]).toBeUndefined(); - header["backgroundColorSwitch"] = "none"; + header["backgroundColorSwitch"] = "accentColor"; expect(header["backgroundColor"]).toBeUndefined(); creator.activeTab = "designer"; - expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBe("transparent"); + expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBe(HeaderModel.primaryColorStr); creator.activeTab = "theme"; header = themeModel.header as HeaderModel; - expect(header["backgroundColorSwitch"]).toEqual("none"); + expect(header["backgroundColorSwitch"]).toEqual("accentColor"); expect(header["backgroundColor"]).toBeUndefined(); header["backgroundColorSwitch"] = "custom"; @@ -242,12 +241,11 @@ test("headerViewContainer: background color", (): any => { let themeModel = themePlugin.themeModel as ThemeModel; let header = themeModel.header as HeaderModel; - header["headerView"] = "advanced"; - expect(header["backgroundColorSwitch"]).toBe("accentColor"); + expect(header["backgroundColorSwitch"]).toBe("none"); expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBeUndefined(); - header["backgroundColorSwitch"] = "none"; - expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBe("transparent"); + header["backgroundColorSwitch"] = "accentColor"; + expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBe(HeaderModel.primaryColorStr); header["backgroundColorSwitch"] = "custom"; expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBe("transparent"); @@ -255,7 +253,7 @@ test("headerViewContainer: background color", (): any => { header["backgroundColor"] = "#5094ed"; expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBe("#5094ed"); - header["backgroundColorSwitch"] = "accentColor"; + header["backgroundColorSwitch"] = "none"; expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBeUndefined(); }); @@ -268,16 +266,15 @@ test("headerViewContainer: background color reset #5940", (): any => { let themeModel = themePlugin.themeModel as ThemeModel; let header = themeModel.header as HeaderModel; - header["headerView"] = "advanced"; - expect(header["backgroundColorSwitch"]).toBe("accentColor"); + expect(header["backgroundColorSwitch"]).toBe("none"); expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBeUndefined(); expect(themeModel.cssVariables["--sjs-header-backcolor"]).toBeUndefined(); - header["backgroundColorSwitch"] = "none"; - expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBe("transparent"); - expect(themeModel.cssVariables["--sjs-header-backcolor"]).toBe("transparent"); - header["backgroundColorSwitch"] = "accentColor"; + expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBe(HeaderModel.primaryColorStr); + expect(themeModel.cssVariables["--sjs-header-backcolor"]).toBe(HeaderModel.primaryColorStr); + + header["backgroundColorSwitch"] = "none"; expect(creator.theme.cssVariables["--sjs-header-backcolor"]).toBeUndefined(); expect(themeModel.cssVariables["--sjs-header-backcolor"]).toBeUndefined(); @@ -301,8 +298,7 @@ test("header custom background color and theme changes", (): any => { expect(themeChooser.value).toEqual("default"); expect(primaryBackColor.value).toEqual("rgba(25, 179, 148, 1)"); - header["headerView"] = "advanced"; - expect(header["backgroundColorSwitch"]).toEqual("accentColor"); + expect(header["backgroundColorSwitch"]).toEqual("none"); expect(header["backgroundColor"]).toBeUndefined(); header["backgroundColorSwitch"] = "custom"; @@ -346,7 +342,6 @@ test("set backgroundImage into header", (): any => { const themeModel = new ThemeModel(); const header = themeModel.header as HeaderModel; - header["headerView"] = "advanced"; header.backgroundImage = "https://t4.ftcdn.net/jpg/02/83/13/61/360_F_283136113_b3VRHNiOPFMOluzYJPpfuoH8Czh9c743.jpg"; header.backgroundImageFit = "contain"; header.backgroundImageOpacity = 50; diff --git a/packages/survey-creator-core/tests/tabs/theme-model-property-grid.tests.ts b/packages/survey-creator-core/tests/tabs/theme-model-property-grid.tests.ts index 4da9228237..5abc688653 100644 --- a/packages/survey-creator-core/tests/tabs/theme-model-property-grid.tests.ts +++ b/packages/survey-creator-core/tests/tabs/theme-model-property-grid.tests.ts @@ -737,26 +737,26 @@ test("headerViewContainer init state", (): any => { const headerViewContainer = groupHeader.elements[0].contentPanel; expect(headerViewContainer.getValue()).toStrictEqual({ - "headerView": "basic", + "headerView": "advanced", "logoPosition": "left", - "inheritWidthFrom": "container", + "inheritWidthFrom": "survey", "overlapEnabled": false, - "backgroundColorSwitch": "accentColor", + "backgroundColorSwitch": "none", "backgroundImageFit": "cover", "backgroundImageOpacity": 100, - "logoPositionX": "right", - "logoPositionY": "top", + "logoPositionX": "left", + "logoPositionY": "bottom", "titlePositionX": "left", "titlePositionY": "bottom", "descriptionPositionX": "left", "descriptionPositionY": "bottom", - "textAreaWidth": 512, - "height": 256, + "textAreaWidth": 0, + "height": 0, "mobileHeight": 0, "headerDescription": { "family": "Open Sans", - "size": 16, - "weight": "600", + "size": 20, + "weight": "400", }, "headerTitle": { "family": "Open Sans", @@ -849,7 +849,7 @@ test("set headerViewContainer advanced", (): any => { headerViewContainer.getElementByName("logoPosition").value = "right"; headerViewContainer.getElementByName("headerView").value = "advanced"; headerViewContainer.getElementByName("height").value = 300; - headerViewContainer.getElementByName("inheritWidthFrom").value = "survey"; + headerViewContainer.getElementByName("inheritWidthFrom").value = "container"; headerViewContainer.getElementByName("textAreaWidth").value = 600; headerViewContainer.getElementByName("backgroundColorSwitch").value = "custom"; headerViewContainer.getElementByName("backgroundColor").value = "#5094ed"; @@ -874,7 +874,7 @@ test("set headerViewContainer advanced", (): any => { expect(creator.theme.header).toStrictEqual({ "height": 300, - "inheritWidthFrom": "survey", + "inheritWidthFrom": "container", "textAreaWidth": 600, "overlapEnabled": true, "backgroundImage": "https://t4.ftcdn.net/jpg/02/83/13/61/360_F_283136113_b3VRHNiOPFMOluzYJPpfuoH8Czh9c743.jpg", @@ -946,7 +946,7 @@ test("restore basic headerViewContainer values", (): any => { const headerViewContainer = groupHeader.elements[0].contentPanel; headerViewContainer.getQuestionByName(""); - expect(headerViewContainer.getQuestionByName("headerView").value).toBe("basic"); + expect(headerViewContainer.getQuestionByName("headerView").value).toBe("advanced"); expect(headerViewContainer.getQuestionByName("logoPosition").value).toBe("left"); expect(headerViewContainer.getQuestionByName("inheritWidthFrom").value).toBe("container"); expect(headerViewContainer.getQuestionByName("backgroundColor").value).toBe("#5094ed"); @@ -1162,10 +1162,10 @@ test("header editable after theme changed", (): any => { const themeChooser = themePlugin.propertyGrid.survey.getQuestionByName("themeName") as QuestionDropdownModel; themeChooser.value = "flat"; - expect(headerTitleQuestion.isVisible).toBe(false); - - headerViewContainer.getElementByName("headerView").value = "advanced"; expect(headerTitleQuestion.isVisible).toBe(true); + + headerViewContainer.getElementByName("headerView").value = "basic"; + expect(headerTitleQuestion.isVisible).toBe(false); }); test("advanced header disable inheritWidthFrom and reset it to 'container' if showTOC is true", (): any => { @@ -1178,13 +1178,8 @@ test("advanced header disable inheritWidthFrom and reset it to 'container' if sh const headerViewContainer = groupHeader.elements[0].contentPanel; const inheritWidthFromQuestion = headerViewContainer.getElementByName("inheritWidthFrom"); - expect(inheritWidthFromQuestion.isVisible).toBe(false); - - headerViewContainer.getElementByName("headerView").value = "advanced"; expect(inheritWidthFromQuestion.isVisible).toBe(true); - expect(inheritWidthFromQuestion.value).toBe("container"); - - inheritWidthFromQuestion.value = "survey"; + expect(inheritWidthFromQuestion.value).toBe("survey"); themePlugin.deactivate(); creator.survey.showTOC = true; diff --git a/packages/survey-creator-core/tests/tabs/theme-model.tests.ts b/packages/survey-creator-core/tests/tabs/theme-model.tests.ts index 985ba586cf..efb50c9c1b 100644 --- a/packages/survey-creator-core/tests/tabs/theme-model.tests.ts +++ b/packages/survey-creator-core/tests/tabs/theme-model.tests.ts @@ -176,7 +176,7 @@ test("Theme model load custom theme", (): any => { themeModel.fromJSON(customeTheme); const json = themeModel.toJSON(); - customeTheme.headerView = "basic"; + customeTheme.headerView = "advanced"; expect(json).toStrictEqual(customeTheme); Serializer.removeProperty("theme", "--a-var"); diff --git a/packages/survey-creator-core/tests/tabs/theme-tab-plugin.tests.ts b/packages/survey-creator-core/tests/tabs/theme-tab-plugin.tests.ts index d9562068ed..71674beb12 100644 --- a/packages/survey-creator-core/tests/tabs/theme-tab-plugin.tests.ts +++ b/packages/survey-creator-core/tests/tabs/theme-tab-plugin.tests.ts @@ -336,7 +336,7 @@ test("Theme onModified and saveThemeFunc", (): any => { expect(creator.hasPendingThemeChanges).toBeFalsy(); expect(themePlugin.isModified).toBeTruthy(); - themeModel.header["headerView"] = "advanced"; + themeModel.header["headerView"] = "basic"; expect(modificationsLog).toBe("->THEME_MODIFIED->THEME_SELECTED->THEME_MODIFIED->THEME_MODIFIED->THEME_MODIFIED"); expect(saveCount).toBe(0); expect(saveThemeCount).toBe(5); @@ -880,33 +880,33 @@ test("Theme undo redo header settings", (): any => { const headerViewContainer = groupHeader.elements[0].contentPanel; const inheritWidthFromQuestion = headerViewContainer.getElementByName("inheritWidthFrom"); - expect(header.inheritWidthFrom).toBe("container"); + expect(header.inheritWidthFrom).toBe("survey"); expect(themeModel.undoRedoManager.canUndo()).toBe(false); expect(themeModel.undoRedoManager.canRedo()).toBe(false); expect(themeModel["blockThemeChangedNotifications"]).toBe(0); - expect(inheritWidthFromQuestion.value).toBe("container"); + expect(inheritWidthFromQuestion.value).toBe("survey"); - inheritWidthFromQuestion.value = "survey"; + inheritWidthFromQuestion.value = "container"; - expect(header.inheritWidthFrom).toBe("survey"); + expect(header.inheritWidthFrom).toBe("container"); expect(themeModel.undoRedoManager.canUndo()).toBe(true); expect(themeModel.undoRedoManager.canRedo()).toBe(false); expect(themeModel["blockThemeChangedNotifications"]).toBe(0); - expect(inheritWidthFromQuestion.value).toBe("survey"); + expect(inheritWidthFromQuestion.value).toBe("container"); themePlugin.undo(); - expect(header.inheritWidthFrom).toBe("container"); + expect(header.inheritWidthFrom).toBe("survey"); expect(themeModel.undoRedoManager.canUndo()).toBe(false); expect(themeModel.undoRedoManager.canRedo()).toBe(true); expect(themeModel["blockThemeChangedNotifications"]).toBe(0); - expect(inheritWidthFromQuestion.value).toBe("container"); + expect(inheritWidthFromQuestion.value).toBe("survey"); themePlugin.redo(); - expect(header.inheritWidthFrom).toBe("survey"); + expect(header.inheritWidthFrom).toBe("container"); expect(themeModel.undoRedoManager.canUndo()).toBe(true); expect(themeModel.undoRedoManager.canRedo()).toBe(false); expect(themeModel["blockThemeChangedNotifications"]).toBe(0); - expect(inheritWidthFromQuestion.value).toBe("survey"); + expect(inheritWidthFromQuestion.value).toBe("container"); }); test("Set header settings properties, binding with a property grid", (): any => { const creator: CreatorTester = new CreatorTester({ showThemeTab: true }); @@ -919,13 +919,13 @@ test("Set header settings properties, binding with a property grid", (): any => const headerViewContainer = groupHeader.elements[0].contentPanel; const inheritWidthFromQuestion = headerViewContainer.getElementByName("inheritWidthFrom"); - expect(header.inheritWidthFrom).toBe("container"); - expect(inheritWidthFromQuestion.value).toBe("container"); - - header.inheritWidthFrom = "survey"; - expect(header.inheritWidthFrom).toBe("survey"); expect(inheritWidthFromQuestion.value).toBe("survey"); + + header.inheritWidthFrom = "container"; + + expect(header.inheritWidthFrom).toBe("container"); + expect(inheritWidthFromQuestion.value).toBe("container"); }); test("Theme builder: trigger responsiveness", (): any => { diff --git a/visualRegressionTests-V2/tests/designer/etalons/theme-editor-property-grid-header-group-advanced.png b/visualRegressionTests-V2/tests/designer/etalons/theme-editor-property-grid-header-group-advanced.png index 9703a0f536..a1397a2c76 100644 Binary files a/visualRegressionTests-V2/tests/designer/etalons/theme-editor-property-grid-header-group-advanced.png and b/visualRegressionTests-V2/tests/designer/etalons/theme-editor-property-grid-header-group-advanced.png differ diff --git a/visualRegressionTests/tests/designer/etalons/theme-editor-property-grid-header-group-advanced.png b/visualRegressionTests/tests/designer/etalons/theme-editor-property-grid-header-group-advanced.png index 480b77d6f7..30d02c8474 100644 Binary files a/visualRegressionTests/tests/designer/etalons/theme-editor-property-grid-header-group-advanced.png and b/visualRegressionTests/tests/designer/etalons/theme-editor-property-grid-header-group-advanced.png differ diff --git a/visualRegressionTests/tests/designer/test-tab.ts b/visualRegressionTests/tests/designer/test-tab.ts index e00c372602..52fda1c9d4 100644 --- a/visualRegressionTests/tests/designer/test-tab.ts +++ b/visualRegressionTests/tests/designer/test-tab.ts @@ -248,6 +248,7 @@ test("Check survey timer", async (t) => { await t.resizeWindow(1920, 1080); const json = { showQuestionNumbers: "on", + headerView: "basic", "autoFocusFirstQuestion": true, "title": "American History", "showTimerPanel": "bottom", diff --git a/visualRegressionTests/tests/designer/theme-tab.ts b/visualRegressionTests/tests/designer/theme-tab.ts index ba5016122c..8a16eb2037 100644 --- a/visualRegressionTests/tests/designer/theme-tab.ts +++ b/visualRegressionTests/tests/designer/theme-tab.ts @@ -78,6 +78,7 @@ test("theme setting property grid", async (t) => { await t.click(getPropertyGridCategory("General")); await t.click(getPropertyGridCategory("Header")); + await t.click(expandedGroup.find(".spg-button-group__item-caption").withText("Basic")); await ClientFunction(() => document.body.focus())(); await takeElementScreenshot("theme-editor-property-grid-header-group.png", expandedGroup, t, comparer);