@ui5/webcomponents-base 2.11.0-rc.1 → 2.11.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/custom-elements-internal.json +17 -17
- package/dist/custom-elements.json +17 -17
- package/dist/features/OpenUI5Support.d.ts +1 -0
- package/dist/features/OpenUI5Support.js +30 -27
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/prod/features/OpenUI5Support.js +1 -1
- package/dist/prod/features/OpenUI5Support.js.map +2 -2
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +1 -1
- package/dist/prod/util/getEffectiveScrollbarStyle.js +3 -1
- package/dist/prod/util/getEffectiveScrollbarStyle.js.map +2 -2
- package/dist/util/getEffectiveScrollbarStyle.d.ts +1 -1
- package/dist/util/getEffectiveScrollbarStyle.js +3 -1
- package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
- package/package.json +3 -3
- package/cypress/specs/Accessor.cy.tsx +0 -79
- package/cypress/specs/Boot.cy.tsx +0 -19
- package/cypress/specs/ConfigurationChange.cy.tsx +0 -41
- package/cypress/specs/ConfigurationScript.cy.tsx +0 -133
- package/cypress/specs/ConfigurationURL.cy.tsx +0 -201
- package/cypress/specs/CustomMount.cy.tsx +0 -9
- package/cypress/specs/CustomTheme.cy.tsx +0 -36
- package/cypress/specs/EventProvider.cy.tsx +0 -59
- package/cypress/specs/Events.cy.tsx +0 -28
- package/cypress/specs/SystemDOMElements.cy.tsx +0 -8
- package/cypress/specs/Theming.cy.tsx +0 -74
- package/cypress/specs/UI5ElementInvalidation.cy.tsx +0 -252
- package/cypress/specs/UI5ElementLifecycle.cy.tsx +0 -82
- package/cypress/specs/UI5ElementListenForChildPropChanges.cy.tsx +0 -83
- package/cypress/specs/UI5ElementMetadataExt.cy.tsx +0 -42
- package/cypress/specs/UI5ElementPropertyValidation.cy.tsx +0 -16
- package/cypress/specs/UI5ElementPropsAndAttrs.cy.tsx +0 -113
- package/cypress/specs/UI5ElementShadowDOM.cy.tsx +0 -30
- package/cypress/specs/UI5ElementSlots.cy.tsx +0 -136
- package/cypress/specs/WithComplexTemplate.cy.tsx +0 -32
- package/cypress/specs/i18n_texts.cy.tsx +0 -129
- package/cypress/specs/util/FocusableElements.cy.tsx +0 -48
- package/cypress/support/commands.ts +0 -39
- package/cypress/support/component-index.html +0 -12
- package/cypress/support/component.ts +0 -17
- package/cypress/tsconfig.json +0 -21
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import type UI5Element from "../../src/UI5Element.js";
|
|
2
|
-
import Generic from "../../test/test-elements/Generic.js";
|
|
3
|
-
|
|
4
|
-
describe("Invalidation works", () => {
|
|
5
|
-
it("Tests that changing a property invalidates", () => {
|
|
6
|
-
cy.mount(<Generic></Generic>);
|
|
7
|
-
|
|
8
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
9
|
-
.should($el => {
|
|
10
|
-
expect($el[0].getDomRef()).to.exist;
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
cy.get("[ui5-test-generic]")
|
|
14
|
-
.as("testGeneric")
|
|
15
|
-
.then(el => {
|
|
16
|
-
cy.spy<UI5Element>((el.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
cy.get("@testGeneric")
|
|
20
|
-
.invoke("prop", "strProp", "new value");
|
|
21
|
-
|
|
22
|
-
cy.get("@testGeneric")
|
|
23
|
-
.invoke("prop", "boolProp", true);
|
|
24
|
-
|
|
25
|
-
cy.get("@invalidations")
|
|
26
|
-
.should("have.been.calledTwice");
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("Tests that setting a property to the same value does not invalidate", () => {
|
|
30
|
-
cy.mount(<Generic></Generic>);
|
|
31
|
-
|
|
32
|
-
const text = "new value";
|
|
33
|
-
|
|
34
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
35
|
-
.should($el => {
|
|
36
|
-
expect($el[0].getDomRef()).to.exist;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
cy.get("[ui5-test-generic]")
|
|
40
|
-
.as("testGeneric")
|
|
41
|
-
.invoke("prop", "strProp", text)
|
|
42
|
-
.then(el => {
|
|
43
|
-
cy.spy<UI5Element>((el.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
cy.get("@testGeneric")
|
|
47
|
-
.invoke("prop", "strProp", text);
|
|
48
|
-
|
|
49
|
-
cy.get("@invalidations")
|
|
50
|
-
.should("have.not.been.called");
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("Tests that setting a property of type Object always invalidates", () => {
|
|
54
|
-
cy.mount(<Generic></Generic>);
|
|
55
|
-
|
|
56
|
-
const obj = {};
|
|
57
|
-
const otherObj = {};
|
|
58
|
-
|
|
59
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
60
|
-
.should($el => {
|
|
61
|
-
expect($el[0].getDomRef()).to.exist;
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
cy.get("[ui5-test-generic]")
|
|
65
|
-
.as("testGeneric")
|
|
66
|
-
.invoke("prop", "objectProp", obj)
|
|
67
|
-
.then(el => {
|
|
68
|
-
cy.spy<UI5Element>((el.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
cy.get("@testGeneric")
|
|
72
|
-
.invoke("prop", "objectProp", otherObj);
|
|
73
|
-
|
|
74
|
-
cy.get("@invalidations")
|
|
75
|
-
.should("have.been.calledOnce");
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it("Tests that setting an array property always invalidates", () => {
|
|
79
|
-
cy.mount(<Generic></Generic>);
|
|
80
|
-
|
|
81
|
-
const arr: Array<string> = [];
|
|
82
|
-
const otherArr: Array<string> = [];
|
|
83
|
-
|
|
84
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
85
|
-
.should($el => {
|
|
86
|
-
expect($el[0].getDomRef()).to.exist;
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
cy.get("[ui5-test-generic]")
|
|
90
|
-
.as("testGeneric")
|
|
91
|
-
.invoke("prop", "multiProp", arr)
|
|
92
|
-
.then(el => {
|
|
93
|
-
cy.spy<UI5Element>((el.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
cy.get("@testGeneric")
|
|
97
|
-
.invoke("prop", "multiProp", otherArr);
|
|
98
|
-
|
|
99
|
-
cy.get("@invalidations")
|
|
100
|
-
.should("have.been.calledOnce");
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it("Tests that adding a child invalidates", () => {
|
|
104
|
-
cy.mount(<Generic></Generic>);
|
|
105
|
-
|
|
106
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
107
|
-
.should($el => {
|
|
108
|
-
expect($el[0].getDomRef()).to.exist;
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
cy.get("[ui5-test-generic]")
|
|
112
|
-
.as("testGeneric")
|
|
113
|
-
.then(el => {
|
|
114
|
-
cy.spy<UI5Element>((el.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
cy.get("@testGeneric")
|
|
118
|
-
.then($testGeneric => {
|
|
119
|
-
const div = document.createElement("div");
|
|
120
|
-
$testGeneric.append(div);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
cy.get("@invalidations")
|
|
124
|
-
.should("have.been.called");
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it("Tests that removing a child invalidates", () => {
|
|
128
|
-
cy.mount(<Generic></Generic>);
|
|
129
|
-
|
|
130
|
-
const div = document.createElement("div");
|
|
131
|
-
|
|
132
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
133
|
-
.should($el => {
|
|
134
|
-
expect($el[0].getDomRef()).to.exist;
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
cy.get("[ui5-test-generic]")
|
|
138
|
-
.as("testGeneric")
|
|
139
|
-
.then($testGeneric => {
|
|
140
|
-
$testGeneric.append(div);
|
|
141
|
-
|
|
142
|
-
return $testGeneric;
|
|
143
|
-
})
|
|
144
|
-
.then($testGeneric => {
|
|
145
|
-
cy.spy<UI5Element>(($testGeneric.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
cy.get("@invalidations")
|
|
149
|
-
.should("have.not.been.called");
|
|
150
|
-
|
|
151
|
-
cy.wrap(div)
|
|
152
|
-
.then($div => {
|
|
153
|
-
$div.remove();
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
cy.get("@invalidations")
|
|
157
|
-
.should("have.been.called");
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it("Tests that modifying textContent invalidates", () => {
|
|
161
|
-
cy.mount(<Generic></Generic>);
|
|
162
|
-
|
|
163
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
164
|
-
.should($el => {
|
|
165
|
-
expect($el[0].getDomRef()).to.exist;
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
cy.get("[ui5-test-generic]")
|
|
169
|
-
.as("testGeneric")
|
|
170
|
-
.then($testGeneric => {
|
|
171
|
-
$testGeneric.text("test");
|
|
172
|
-
|
|
173
|
-
return $testGeneric;
|
|
174
|
-
})
|
|
175
|
-
.then($testGeneric => {
|
|
176
|
-
cy.spy<UI5Element>(($testGeneric.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
cy.get("@invalidations")
|
|
180
|
-
.should("have.not.been.called");
|
|
181
|
-
|
|
182
|
-
cy.get("@testGeneric")
|
|
183
|
-
.then($testGeneric => {
|
|
184
|
-
$testGeneric.text("test2");
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
cy.get("@invalidations")
|
|
188
|
-
.should("have.been.called");
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
it("Tests that modifying nodeValue invalidates", () => {
|
|
192
|
-
cy.mount(<Generic></Generic>);
|
|
193
|
-
|
|
194
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
195
|
-
.should($el => {
|
|
196
|
-
expect($el[0].getDomRef()).to.exist;
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
cy.get("[ui5-test-generic]")
|
|
200
|
-
.as("testGeneric")
|
|
201
|
-
.then($testGeneric => {
|
|
202
|
-
$testGeneric.text("test");
|
|
203
|
-
|
|
204
|
-
return $testGeneric;
|
|
205
|
-
})
|
|
206
|
-
.then($testGeneric => {
|
|
207
|
-
cy.spy<UI5Element>(($testGeneric.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
cy.get("@invalidations")
|
|
211
|
-
.should("have.not.been.called");
|
|
212
|
-
|
|
213
|
-
cy.get("@testGeneric")
|
|
214
|
-
.then($testGeneric => {
|
|
215
|
-
$testGeneric.get(0).childNodes[0].nodeValue = "test2";
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
cy.get("@invalidations")
|
|
219
|
-
.should("have.been.called");
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
it("Tests that multiple invalidations result in a single rendering", () => {
|
|
223
|
-
cy.mount(<Generic></Generic>);
|
|
224
|
-
|
|
225
|
-
cy.get<Generic>("[ui5-test-generic]")
|
|
226
|
-
.should($el => {
|
|
227
|
-
expect($el[0].getDomRef()).to.exist;
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
cy.get("[ui5-test-generic]")
|
|
231
|
-
.as("testGeneric");
|
|
232
|
-
|
|
233
|
-
cy.get("@testGeneric")
|
|
234
|
-
.then($testGeneric => {
|
|
235
|
-
cy.spy<UI5Element>(($testGeneric.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
236
|
-
|
|
237
|
-
cy.spy<UI5Element>(($testGeneric.get(0) as UI5Element), "_render").as("rendering");
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
cy.get("@testGeneric")
|
|
241
|
-
.invoke("prop", "strProp", "new");
|
|
242
|
-
|
|
243
|
-
cy.get("@testGeneric")
|
|
244
|
-
.invoke("prop", "strProp", "new2");
|
|
245
|
-
|
|
246
|
-
cy.get("@invalidations")
|
|
247
|
-
.should("have.been.calledTwice");
|
|
248
|
-
|
|
249
|
-
cy.get("@rendering")
|
|
250
|
-
.should("have.been.calledOnce");
|
|
251
|
-
});
|
|
252
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type UI5Element from "../../src/UI5Element.js";
|
|
2
|
-
import Generic from "../../test/test-elements/Generic.js";
|
|
3
|
-
|
|
4
|
-
describe("Lifecycle works", () => {
|
|
5
|
-
it("Tests that changing a property invalidates", () => {
|
|
6
|
-
const el = document.createElement("ui5-test-generic");
|
|
7
|
-
|
|
8
|
-
cy.mount(<div id="container"></div>);
|
|
9
|
-
|
|
10
|
-
cy.spy<UI5Element>((el as UI5Element), "onBeforeRendering").as("onBeforeRendering");
|
|
11
|
-
|
|
12
|
-
cy.spy<UI5Element>((el as UI5Element), "onAfterRendering").as("onAfterRendering");
|
|
13
|
-
|
|
14
|
-
cy.spy<UI5Element>((el as UI5Element), "onEnterDOM").as("onEnterDOM");
|
|
15
|
-
|
|
16
|
-
cy.get("#container")
|
|
17
|
-
.then($container => {
|
|
18
|
-
$container.append(el);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
cy.get("@onBeforeRendering")
|
|
22
|
-
.should("have.been.called")
|
|
23
|
-
.and("have.been.calledBefore", "@onAfterRendering")
|
|
24
|
-
.and("have.been.calledBefore", "@onEnterDOM");
|
|
25
|
-
|
|
26
|
-
cy.get("@onAfterRendering")
|
|
27
|
-
.should("have.been.called")
|
|
28
|
-
.and("have.been.calledBefore", "@onEnterDOM");
|
|
29
|
-
|
|
30
|
-
cy.get("@onEnterDOM")
|
|
31
|
-
.should("have.been.called");
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("Tests element invalidation callbacks", () => {
|
|
35
|
-
cy.mount(<Generic></Generic>);
|
|
36
|
-
|
|
37
|
-
cy.get("[ui5-test-generic]")
|
|
38
|
-
.as("testGeneric")
|
|
39
|
-
.then($testGeneric => {
|
|
40
|
-
cy.spy<UI5Element>(($testGeneric.get(0) as UI5Element), "onBeforeRendering").as("onBeforeRendering");
|
|
41
|
-
|
|
42
|
-
cy.spy<UI5Element>(($testGeneric.get(0) as UI5Element), "onAfterRendering").as("onAfterRendering");
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
cy.get("@testGeneric")
|
|
46
|
-
.invoke("prop", "strProp", "some string");
|
|
47
|
-
|
|
48
|
-
cy.get("@onBeforeRendering")
|
|
49
|
-
.should("have.been.called")
|
|
50
|
-
.and("have.been.calledBefore", "@onAfterRendering");
|
|
51
|
-
|
|
52
|
-
cy.get("@onAfterRendering")
|
|
53
|
-
.should("have.been.called");
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("Tests element destruction callback", () => {
|
|
57
|
-
const el = document.createElement("ui5-test-generic");
|
|
58
|
-
|
|
59
|
-
cy.mount(<div id="container"></div>);
|
|
60
|
-
|
|
61
|
-
cy.spy<UI5Element>((el as UI5Element), "onExitDOM").as("onExitDOM");
|
|
62
|
-
cy.spy<UI5Element>((el as UI5Element), "onEnterDOM").as("onEnterDOM");
|
|
63
|
-
|
|
64
|
-
cy.get("#container")
|
|
65
|
-
.then($container => {
|
|
66
|
-
$container.append(el);
|
|
67
|
-
|
|
68
|
-
return $container;
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
cy.get("@onEnterDOM")
|
|
72
|
-
.should("have.been.called");
|
|
73
|
-
|
|
74
|
-
cy.wrap(el)
|
|
75
|
-
.then($el => {
|
|
76
|
-
$el.remove();
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
cy.get("@onExitDOM")
|
|
80
|
-
.should("have.been.called");
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type UI5Element from "../../src/UI5Element.js";
|
|
2
|
-
|
|
3
|
-
import Parent from "../../test/test-elements/Parent.js";
|
|
4
|
-
import Child from "../../test/test-elements/Child.js";
|
|
5
|
-
|
|
6
|
-
describe("Invalidation works", () => {
|
|
7
|
-
it("Tests that changing a monitored property of a child invalidates the parent", () => {
|
|
8
|
-
cy.mount(
|
|
9
|
-
<Parent>
|
|
10
|
-
<Child></Child>
|
|
11
|
-
</Parent>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
cy.get<Parent>("[ui5-test-parent]")
|
|
15
|
-
.should($el => {
|
|
16
|
-
expect($el[0].getDomRef()).to.exist;
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
cy.get("[ui5-test-parent]")
|
|
20
|
-
.as("testParent")
|
|
21
|
-
.then(el => {
|
|
22
|
-
cy.spy<UI5Element>((el.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
cy.get("[ui5-test-child]")
|
|
26
|
-
.invoke("prop", "prop1", "a");
|
|
27
|
-
|
|
28
|
-
cy.get("@invalidations")
|
|
29
|
-
.should("have.been.called");
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it("Tests that changing a non-monitored property of a child does not invalidate the parent", () => {
|
|
33
|
-
cy.mount(
|
|
34
|
-
<Parent>
|
|
35
|
-
<Child></Child>
|
|
36
|
-
</Parent>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
cy.get<Parent>("[ui5-test-parent]")
|
|
40
|
-
.should($el => {
|
|
41
|
-
expect($el[0].getDomRef()).to.exist;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
cy.get("[ui5-test-parent]")
|
|
45
|
-
.as("testParent")
|
|
46
|
-
.then(el => {
|
|
47
|
-
cy.spy<UI5Element>((el.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
cy.get("[ui5-test-child]")
|
|
51
|
-
.invoke("prop", "prop2", "b");
|
|
52
|
-
|
|
53
|
-
cy.get("@invalidations")
|
|
54
|
-
.should("have.not.been.called");
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("Tests that changing a non-monitored property of a child does not invalidate the parent", () => {
|
|
58
|
-
cy.mount(
|
|
59
|
-
<Parent>
|
|
60
|
-
<Child slot="items"></Child>
|
|
61
|
-
</Parent>
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
cy.get<Parent>("[ui5-test-parent]")
|
|
65
|
-
.should($el => {
|
|
66
|
-
expect($el[0].getDomRef()).to.exist;
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
cy.get("[ui5-test-parent]")
|
|
70
|
-
.as("testParent")
|
|
71
|
-
.then(el => {
|
|
72
|
-
cy.spy<UI5Element>((el.get(0) as UI5Element), "onInvalidation").as("invalidations");
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
cy.get("[ui5-test-child]")
|
|
76
|
-
.invoke("prop", "prop1", "a")
|
|
77
|
-
.invoke("prop", "prop2", "b")
|
|
78
|
-
.invoke("prop", "prop3", "c");
|
|
79
|
-
|
|
80
|
-
cy.get("@invalidations")
|
|
81
|
-
.should("have.been.calledThrice");
|
|
82
|
-
});
|
|
83
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type UI5Element from "../../src/UI5Element.js";
|
|
2
|
-
import GenericExt from "../../test/test-elements/GenericExt.js";
|
|
3
|
-
|
|
4
|
-
describe("Invalidation works", () => {
|
|
5
|
-
it("Tests that changing a monitored property of a child invalidates the parent", () => {
|
|
6
|
-
cy.mount(<GenericExt></GenericExt>);
|
|
7
|
-
|
|
8
|
-
cy.get("[ui5-test-generic-ext]")
|
|
9
|
-
.then($el => {
|
|
10
|
-
return ($el.get(0).constructor as typeof UI5Element).getMetadata();
|
|
11
|
-
})
|
|
12
|
-
.as("metadata");
|
|
13
|
-
|
|
14
|
-
cy.get("@metadata")
|
|
15
|
-
.invoke("getProperties")
|
|
16
|
-
.its("strProp")
|
|
17
|
-
.should("exist");
|
|
18
|
-
|
|
19
|
-
cy.get("@metadata")
|
|
20
|
-
.invoke("getProperties")
|
|
21
|
-
.its("extProp")
|
|
22
|
-
.should("exist");
|
|
23
|
-
|
|
24
|
-
cy.get("@metadata")
|
|
25
|
-
.invoke("getSlots")
|
|
26
|
-
.its("default")
|
|
27
|
-
.should("exist");
|
|
28
|
-
|
|
29
|
-
cy.get("@metadata")
|
|
30
|
-
.invoke("getSlots")
|
|
31
|
-
.its("extSlot")
|
|
32
|
-
.should("exist");
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("When extending metadata, property defaultValue can be modified", () => {
|
|
36
|
-
cy.mount(<GenericExt></GenericExt>);
|
|
37
|
-
|
|
38
|
-
cy.get("[ui5-test-generic-ext]")
|
|
39
|
-
.invoke("attr", "str-prop")
|
|
40
|
-
.should("equal", "Ext");
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Generic from "../../test/test-elements/Generic.js";
|
|
2
|
-
|
|
3
|
-
describe("Properties can only have values, restricted to their types", () => {
|
|
4
|
-
it("String property enforced to string", () => {
|
|
5
|
-
cy.mount(<Generic></Generic>);
|
|
6
|
-
|
|
7
|
-
cy.get("[ui5-test-generic]")
|
|
8
|
-
.as("testGeneric");
|
|
9
|
-
|
|
10
|
-
cy.get("@testGeneric")
|
|
11
|
-
.invoke("prop", "strProp", 5);
|
|
12
|
-
|
|
13
|
-
cy.get("@testGeneric")
|
|
14
|
-
.should("have.prop", "strProp", 5);
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import Generic from "../../test/test-elements/Generic.js";
|
|
2
|
-
|
|
3
|
-
describe("Properties and attributes convert to each other", () => {
|
|
4
|
-
it("Tests that properties with default values are initialized with the default value", () => {
|
|
5
|
-
cy.mount(<Generic></Generic>);
|
|
6
|
-
|
|
7
|
-
cy.get("[ui5-test-generic]")
|
|
8
|
-
.as("testGeneric");
|
|
9
|
-
|
|
10
|
-
cy.get("@testGeneric")
|
|
11
|
-
.invoke("prop", "defaultValueProp")
|
|
12
|
-
.should("equal", "Hello");
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("Tests that prop-attr conversion works for string properties", () => {
|
|
16
|
-
cy.mount(<Generic></Generic>);
|
|
17
|
-
|
|
18
|
-
cy.get("[ui5-test-generic]")
|
|
19
|
-
.as("testGeneric");
|
|
20
|
-
|
|
21
|
-
cy.get("@testGeneric")
|
|
22
|
-
.invoke("prop", "strProp", "test1");
|
|
23
|
-
|
|
24
|
-
cy.get("@testGeneric")
|
|
25
|
-
.should("have.attr", "str-prop", "test1");
|
|
26
|
-
|
|
27
|
-
cy.get("@testGeneric")
|
|
28
|
-
.invoke("attr", "str-prop", "test2");
|
|
29
|
-
|
|
30
|
-
cy.get("@testGeneric")
|
|
31
|
-
.invoke("prop", "strProp")
|
|
32
|
-
.should("equal", "test2");
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("Tests that prop-attr conversion works for boolean properties", () => {
|
|
36
|
-
cy.mount(<Generic></Generic>);
|
|
37
|
-
|
|
38
|
-
cy.get("[ui5-test-generic]")
|
|
39
|
-
.as("testGeneric");
|
|
40
|
-
|
|
41
|
-
cy.get("@testGeneric")
|
|
42
|
-
.invoke("prop", "boolProp", true);
|
|
43
|
-
|
|
44
|
-
cy.get("@testGeneric")
|
|
45
|
-
.should("have.attr", "bool-prop");
|
|
46
|
-
|
|
47
|
-
cy.get("@testGeneric")
|
|
48
|
-
.invoke("prop", "boolProp", false);
|
|
49
|
-
|
|
50
|
-
cy.get("@testGeneric")
|
|
51
|
-
.should("not.have.attr", "bool-prop");
|
|
52
|
-
|
|
53
|
-
cy.get("@testGeneric")
|
|
54
|
-
.invoke("attr", "bool-prop", true);
|
|
55
|
-
|
|
56
|
-
cy.get("@testGeneric")
|
|
57
|
-
.invoke("prop", "boolProp")
|
|
58
|
-
.should("be.true");
|
|
59
|
-
|
|
60
|
-
cy.get("@testGeneric")
|
|
61
|
-
.invoke("removeAttr", "bool-prop");
|
|
62
|
-
|
|
63
|
-
cy.get("@testGeneric")
|
|
64
|
-
.invoke("prop", "boolProp")
|
|
65
|
-
.should("be.false");
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("Tests that object properties have no attributes", () => {
|
|
69
|
-
cy.mount(<Generic></Generic>);
|
|
70
|
-
|
|
71
|
-
cy.get("[ui5-test-generic]")
|
|
72
|
-
.as("testGeneric");
|
|
73
|
-
|
|
74
|
-
cy.get("@testGeneric")
|
|
75
|
-
.invoke("prop", "objectProp", {});
|
|
76
|
-
|
|
77
|
-
cy.get("@testGeneric")
|
|
78
|
-
.should("not.have.attr", "object-prop");
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("Tests that array properties have no attributes", () => {
|
|
82
|
-
cy.mount(<Generic></Generic>);
|
|
83
|
-
|
|
84
|
-
cy.get("[ui5-test-generic]")
|
|
85
|
-
.as("testGeneric");
|
|
86
|
-
|
|
87
|
-
cy.get("@testGeneric")
|
|
88
|
-
.invoke("prop", "multiProp", ["a", "b"]);
|
|
89
|
-
|
|
90
|
-
cy.get("@testGeneric")
|
|
91
|
-
.should("not.have.attr", "multi-prop");
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it("Tests that noAttribute properties have no attributes", () => {
|
|
95
|
-
cy.mount(<Generic></Generic>);
|
|
96
|
-
|
|
97
|
-
cy.get("[ui5-test-generic]")
|
|
98
|
-
.as("testGeneric");
|
|
99
|
-
|
|
100
|
-
cy.get("@testGeneric")
|
|
101
|
-
.invoke("prop", "noAttributeProp", "some value");
|
|
102
|
-
|
|
103
|
-
cy.get("@testGeneric")
|
|
104
|
-
.should("not.have.attr", "no-attribute-prop");
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it("Tests that properties with default values do automatically set attributes", () => {
|
|
108
|
-
cy.mount(<Generic></Generic>);
|
|
109
|
-
|
|
110
|
-
cy.get("[ui5-test-generic]")
|
|
111
|
-
.should("have.attr", "default-value-prop", "Hello");
|
|
112
|
-
});
|
|
113
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import Generic from "../../test/test-elements/Generic.js";
|
|
2
|
-
import NoShadowDOM from "../../test/test-elements/NoShadowDOM.js";
|
|
3
|
-
|
|
4
|
-
describe("The framework can define web components", () => {
|
|
5
|
-
it("Tests that element's Shadow DOM is rendered if it has a template", () => {
|
|
6
|
-
cy.mount(<Generic></Generic>);
|
|
7
|
-
|
|
8
|
-
cy.get("[ui5-test-generic]")
|
|
9
|
-
.as("testGeneric")
|
|
10
|
-
.then($element => {
|
|
11
|
-
return !!$element.get(0).shadowRoot;
|
|
12
|
-
})
|
|
13
|
-
.should("be.true");
|
|
14
|
-
|
|
15
|
-
cy.get("@testGeneric")
|
|
16
|
-
.shadow()
|
|
17
|
-
.find("div > p")
|
|
18
|
-
.should("exist");
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("Tests that element's Shadow DOM is not rendered if it has no template", () => {
|
|
22
|
-
cy.mount(<NoShadowDOM></NoShadowDOM>);
|
|
23
|
-
|
|
24
|
-
cy.get("[ui5-test-no-shadow]")
|
|
25
|
-
.then($element => {
|
|
26
|
-
return !!$element.get(0).shadowRoot;
|
|
27
|
-
})
|
|
28
|
-
.should("be.false");
|
|
29
|
-
});
|
|
30
|
-
});
|