Skip to content

Commit c1dfa42

Browse files
author
tsv2013
committed
Fixed some u-tests
1 parent f4c64ee commit c1dfa42

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

packages/survey-creator-core/tests/tabs/theme-tab-plugin.tests.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ test("Theme onModified and saveThemeFunc", (): any => {
289289
saveThemeCount++;
290290
callback(saveNo, "success");
291291
};
292-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
292+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
293293
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
294294
let modificationsLog = "";
295295
themePlugin.onThemeSelected.add((s, o) => {
@@ -367,7 +367,7 @@ test("loadTheme fill all theme parameters: name, mode and compactness", (): any
367367

368368
test("Get theme changes only", (): any => {
369369
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
370-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
370+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
371371
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
372372
themePlugin.activate();
373373
const themeModel = themePlugin.themeModel as ThemeModel;
@@ -432,6 +432,7 @@ test("Pass background image from survey to theme editor and back", (): any => {
432432
const lionImage = "https://surveyjs.io/Content/Images/examples/image-picker/lion.jpg";
433433
const camelImage = "https://surveyjs.io/Content/Images/examples/image-picker/camel.jpg";
434434
creator.JSON = {
435+
headerView: "advanced",
435436
backgroundImage: lionImage,
436437
questions: [{ type: "text", name: "q1" }]
437438
};
@@ -476,6 +477,7 @@ test("Keep background image in theme modifications", (): any => {
476477
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
477478
const lionImage = "https://surveyjs.io/Content/Images/examples/image-picker/lion.jpg";
478479
creator.JSON = {
480+
headerView: "advanced",
479481
questions: [{ type: "text", name: "q1" }]
480482
};
481483
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
@@ -550,7 +552,7 @@ test("Set and use custom default theme", (): any => {
550552
Serializer.addProperty("theme", { name: "--a-var", visible: false });
551553

552554
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
553-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
555+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
554556
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
555557
expect(ThemeModel.DefaultTheme).toEqual(Themes["default-light"]);
556558

@@ -697,7 +699,7 @@ test("Reset theme to default one", (): any => {
697699

698700
test("Theme undo redo changes", (): any => {
699701
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
700-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
702+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
701703
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
702704
themePlugin.activate();
703705
const themeModel = themePlugin.themeModel as ThemeModel;
@@ -734,7 +736,7 @@ test("Theme undo redo changes", (): any => {
734736

735737
test("Theme undo redo general settings", (): any => {
736738
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
737-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
739+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
738740
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
739741
themePlugin.activate();
740742
const themeModel = themePlugin.themeModel as ThemeModel;
@@ -768,7 +770,7 @@ test("Theme undo redo general settings", (): any => {
768770

769771
test("Theme undo redo calculated questions", (): any => {
770772
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
771-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
773+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
772774
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
773775
themePlugin.activate();
774776
const themeModel = themePlugin.themeModel as ThemeModel;
@@ -836,7 +838,7 @@ test("Theme undo redo calculated questions", (): any => {
836838

837839
test("Theme undo redo expression questions", (): any => {
838840
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
839-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
841+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
840842
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
841843
themePlugin.activate();
842844
const themeModel = themePlugin.themeModel as ThemeModel;
@@ -874,7 +876,7 @@ test("Theme undo redo expression questions", (): any => {
874876

875877
test("Theme undo redo header settings", (): any => {
876878
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
877-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
879+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
878880
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
879881
themePlugin.activate();
880882
const themeModel = themePlugin.themeModel as ThemeModel;
@@ -1007,7 +1009,7 @@ test("saveTheme action", (): any => {
10071009
saveThemeCount++;
10081010
callback(saveNo, "success");
10091011
};
1010-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
1012+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
10111013
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
10121014
expect(saveCount).toBe(0);
10131015
expect(saveThemeCount).toBe(0);
@@ -1063,7 +1065,7 @@ test("Reset theme action availability", (): any => {
10631065
return true;
10641066
};
10651067
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
1066-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
1068+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
10671069
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
10681070
const resetThemeAction = themePlugin["resetTheme"];
10691071
themePlugin.activate();
@@ -1435,7 +1437,7 @@ test("Theme tab: default device and save current device", (): any => {
14351437

14361438
test("Theme tab: use theme palatte corresponding cretor theme palette if theme is not selected", (): any => {
14371439
const creator: CreatorTester = new CreatorTester({ showThemeTab: true });
1438-
creator.JSON = { questions: [{ type: "text", name: "q1" }] };
1440+
creator.JSON = { headerView: "advanced", questions: [{ type: "text", name: "q1" }] };
14391441
const themePlugin: ThemeTabPlugin = <ThemeTabPlugin>creator.getPlugin("theme");
14401442

14411443
expect(creator.preferredColorPalette).toBe("light");

0 commit comments

Comments
 (0)