Skip to content

Commit bbba280

Browse files
committed
test: Add fixtures for Core APIs
1 parent 36d7ccb commit bbba280

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
sap.ui.define(["sap/ui/core/Core",
2+
"sap/ui/core/Theming",
3+
"sap/ui/core/IntervalTrigger",
4+
"sap/base/i18n/Localization",
5+
"sap/ui/core/Control",
6+
"sap/ui/core/Element",
7+
"sap/ui/core/Component"
8+
], function(Core, Theming, IntervalTrigger, Localization, Control, Element, Component) {
9+
Theming.applyTheme("themeName");
10+
Core.applyTheme("custom_theme", "find/my/theme/here");
11+
12+
Core.ready(function() {console.log();});
13+
14+
Core.ready(function() {console.log();});
15+
16+
IntervalTrigger.addListener(function() {console.log();});
17+
Core.attachIntervalTimer(function() {console.log();}, {});
18+
19+
Localization.attachChange(function() {console.log();});
20+
Core.attachLocalizationChanged(function() {console.log();}, {});
21+
22+
Theming.attachApplied(function() {console.log();});
23+
Core.attachThemeChanged(function() {console.log();}, {});
24+
25+
Control.getControlsByFieldGroupId("id");
26+
Control.getControlsByFieldGroupId(["id", "id2"]);
27+
28+
Element.getElementById("id");
29+
30+
Component.create({name: "componentName", url: "find/my/comp/here", id: "id", settings: {"settingsKey": "..."}});
31+
Component.create({name: "componentName", url: "find/my/comp/here", id: "id", settings: {"settingsKey": "..."}, component: {}});
32+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
sap.ui.define(["sap/ui/core/Core",], function(Core) {
2+
Core.applyTheme("themeName");
3+
Core.applyTheme("custom_theme", "find/my/theme/here"); // Should not be autofixed if 2nd argument != undefined
4+
5+
Core.attachInit(function() {console.log();});
6+
7+
Core.attachInitEvent(function() {console.log();});
8+
9+
Core.attachIntervalTimer(function() {console.log();});
10+
Core.attachIntervalTimer(function() {}, {}); // Should not be autofixed if the 2nd argument != undefined
11+
12+
Core.attachLocalizationChanged(function() {console.log();});
13+
Core.attachLocalizationChanged(function() {console.log();}, {}); // Should not be autofixed if the 2nd argument != undefined
14+
15+
Core.attachThemeChanged(function() {console.log();});
16+
Core.attachThemeChanged(function() {console.log();}, {}); // Should not be autofixed if the 2nd argument != undefined
17+
18+
Core.byFieldGroupId("id");
19+
Core.byFieldGroupId(["id", "id2"]);
20+
21+
Core.byId("id");
22+
23+
Core.createComponent("componentName", "find/my/comp/here", "id", {"settingsKey": "..."}); // First argument is a string
24+
Core.createComponent({name: "componentName", url: "find/my/comp/here", id: "id", settings: {"settingsKey": "..."}, component: {}}); // First argument is an object
25+
26+
//TODO:
27+
28+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//TODO:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sap.ui.define([], function() {
2+
sap.ui.getCore().applyTheme("sap_horizon");
3+
sap.ui.getCore().applyTheme("custom_theme", "https://example.com/"); // Should not be autofixed due to the 2nd parameter
4+
sap.ui.getCore().attachInit(function() {});
5+
sap.ui.getCore().attachInitEvent(function() {});
6+
sap.ui.getCore().attachIntervalTimer(function() {});
7+
sap.ui.getCore().attachIntervalTimer(function() {}, {}); // Should not be autofixed if the 2nd parameter != undefined
8+
//TODO: ...
9+
});
10+

0 commit comments

Comments
 (0)