@ui5/webcomponents-base 0.0.0-b132dd7b9 → 0.0.0-b3a4f8020
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/AGENTS.md +195 -0
- package/CHANGELOG.md +563 -0
- package/CLAUDE.md +1 -0
- package/LICENSE.txt +201 -0
- package/README.md +7 -7
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/Assets-fetch.d.ts +1 -0
- package/dist/Assets-fetch.js +3 -0
- package/dist/Assets-fetch.js.map +1 -0
- package/dist/Assets-node.d.ts +12 -0
- package/dist/Assets-node.js +14 -0
- package/dist/Assets-node.js.map +1 -0
- package/dist/Assets.d.ts +1 -0
- package/dist/Assets.js +3 -0
- package/dist/Assets.js.map +1 -0
- package/dist/Boot.d.ts +2 -1
- package/dist/Boot.js +44 -14
- package/dist/Boot.js.map +1 -1
- package/dist/CustomElementsRegistry.js +1 -1
- package/dist/CustomElementsRegistry.js.map +1 -1
- package/dist/CustomElementsScopeUtils.d.ts +10 -3
- package/dist/CustomElementsScopeUtils.js +13 -3
- package/dist/CustomElementsScopeUtils.js.map +1 -1
- package/dist/DragAndDrop.d.ts +2 -0
- package/dist/DragAndDrop.js +5 -0
- package/dist/DragAndDrop.js.map +1 -0
- package/dist/FontFace.css +36 -0
- package/dist/FontFace.js +0 -8
- package/dist/FontFace.js.map +1 -1
- package/dist/InitialConfiguration.js +7 -0
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/Keys.d.ts +4 -1
- package/dist/Keys.js +4 -1
- package/dist/Keys.js.map +1 -1
- package/dist/ManagedStyles.js +1 -1
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/ScrollbarStyles.d.ts +2 -0
- package/dist/ScrollbarStyles.js +9 -0
- package/dist/ScrollbarStyles.js.map +1 -0
- package/dist/SystemCSSVars.js +2 -4
- package/dist/SystemCSSVars.js.map +1 -1
- package/dist/UI5Element.d.ts +35 -9
- package/dist/UI5Element.js +59 -27
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +1 -1
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/asset-registries/Icons.d.ts +42 -8
- package/dist/asset-registries/Icons.js +51 -8
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +133 -8
- package/dist/asset-registries/Illustrations.js +82 -1
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/asset-registries/LocaleData.js +2 -1
- package/dist/asset-registries/LocaleData.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +5 -2
- package/dist/asset-registries/Themes.js +3 -3
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/config/Language.d.ts +2 -1
- package/dist/config/Language.js +12 -1
- package/dist/config/Language.js.map +1 -1
- package/dist/config/Theme.d.ts +13 -1
- package/dist/config/Theme.js +18 -1
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoot.d.ts +3 -1
- package/dist/config/ThemeRoot.js +3 -1
- package/dist/config/ThemeRoot.js.map +1 -1
- package/dist/css/MultipleDragGhost.css +17 -0
- package/dist/css/OpenUI5PopupStyles.css +10 -0
- package/dist/css/ScrollbarStyles.css +3 -0
- package/dist/css/SystemCSSVars.css +28 -3
- package/dist/custom-elements-internal.json +1855 -1738
- package/dist/custom-elements.json +1462 -1345
- package/dist/decorators/slot-strict.d.ts +27 -0
- package/dist/decorators/slot-strict.js +54 -0
- package/dist/decorators/slot-strict.js.map +1 -0
- package/dist/decorators/slot.d.ts +18 -0
- package/dist/decorators/slot.js +18 -0
- package/dist/decorators/slot.js.map +1 -1
- package/dist/decorators.d.ts +2 -1
- package/dist/decorators.js +2 -1
- package/dist/decorators.js.map +1 -1
- package/dist/features/F6Navigation.d.ts +1 -0
- package/dist/features/F6Navigation.js +23 -14
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/InputElementsFormSupport.d.ts +1 -1
- package/dist/features/InputElementsFormSupport.js +6 -2
- package/dist/features/InputElementsFormSupport.js.map +1 -1
- package/dist/features/OpenUI5Support.d.ts +15 -4
- package/dist/features/OpenUI5Support.js +83 -42
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/insertOpenUI5PopupStyles.d.ts +2 -0
- package/dist/features/insertOpenUI5PopupStyles.js +9 -0
- package/dist/features/insertOpenUI5PopupStyles.js.map +1 -0
- package/dist/features/patchPatcher.d.ts +7 -6
- package/dist/features/patchPatcher.js +14 -4
- package/dist/features/patchPatcher.js.map +1 -1
- package/dist/features/patchPopup.d.ts +26 -8
- package/dist/features/patchPopup.js +118 -25
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/VersionInfo.js +6 -6
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
- package/dist/generated/css/FontFace.css.d.ts +1 -1
- package/dist/generated/css/FontFace.css.js +36 -1
- package/dist/generated/css/FontFace.css.js.map +1 -1
- package/dist/generated/css/MultipleDragGhost.css.d.ts +2 -0
- package/dist/generated/css/MultipleDragGhost.css.js +2 -0
- package/dist/generated/css/MultipleDragGhost.css.js.map +1 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.d.ts +2 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.js +2 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -0
- package/dist/generated/css/ScrollbarStyles.css.d.ts +2 -0
- package/dist/generated/css/ScrollbarStyles.css.js +2 -0
- package/dist/generated/css/ScrollbarStyles.css.js.map +1 -0
- package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +3 -0
- package/dist/generated/i18n/i18n-defaults.js +3 -0
- package/dist/generated/i18n/i18n-defaults.js.map +1 -0
- package/dist/generated/json-imports/i18n-fetch.d.ts +1 -0
- package/dist/generated/json-imports/i18n-fetch.js +2 -0
- package/dist/generated/json-imports/i18n-fetch.js.map +1 -0
- package/dist/generated/json-imports/i18n-node.d.ts +1 -0
- package/dist/generated/json-imports/i18n-node.js +2 -0
- package/dist/generated/json-imports/i18n-node.js.map +1 -0
- package/dist/generated/json-imports/i18n.d.ts +1 -0
- package/dist/generated/json-imports/i18n.js +2 -0
- package/dist/generated/json-imports/i18n.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime.d.ts +1 -0
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/prod/Assets-fetch.js +2 -0
- package/dist/prod/Assets-fetch.js.map +7 -0
- package/dist/prod/Assets-node.js +2 -0
- package/dist/prod/Assets-node.js.map +7 -0
- package/dist/prod/Assets.js +2 -0
- package/dist/prod/Assets.js.map +7 -0
- package/dist/prod/Boot.js +1 -1
- package/dist/prod/Boot.js.map +3 -3
- package/dist/prod/CustomElementsRegistry.js +5 -5
- package/dist/prod/CustomElementsRegistry.js.map +2 -2
- package/dist/prod/CustomElementsScopeUtils.js +1 -1
- package/dist/prod/CustomElementsScopeUtils.js.map +3 -3
- package/dist/prod/DragAndDrop.js +2 -0
- package/dist/prod/DragAndDrop.js.map +7 -0
- package/dist/prod/FontFace.js +1 -1
- package/dist/prod/FontFace.js.map +3 -3
- package/dist/prod/InitialConfiguration.js +1 -1
- package/dist/prod/InitialConfiguration.js.map +2 -2
- package/dist/prod/Keys.js +1 -1
- package/dist/prod/Keys.js.map +3 -3
- package/dist/prod/ManagedStyles.js +1 -1
- package/dist/prod/ManagedStyles.js.map +2 -2
- package/dist/prod/ScrollbarStyles.js +2 -0
- package/dist/prod/ScrollbarStyles.js.map +7 -0
- package/dist/prod/SystemCSSVars.js +1 -1
- package/dist/prod/SystemCSSVars.js.map +3 -3
- package/dist/prod/UI5Element.js +1 -1
- package/dist/prod/UI5Element.js.map +3 -3
- package/dist/prod/UI5ElementMetadata.js +1 -1
- package/dist/prod/UI5ElementMetadata.js.map +1 -1
- package/dist/prod/asset-registries/Icons.js +1 -1
- package/dist/prod/asset-registries/Icons.js.map +3 -3
- package/dist/prod/asset-registries/Illustrations.js +1 -1
- package/dist/prod/asset-registries/Illustrations.js.map +3 -3
- package/dist/prod/asset-registries/LocaleData.js +1 -1
- package/dist/prod/asset-registries/LocaleData.js.map +2 -2
- package/dist/prod/asset-registries/Themes.js +1 -1
- package/dist/prod/asset-registries/Themes.js.map +3 -3
- package/dist/prod/config/Language.js +1 -1
- package/dist/prod/config/Language.js.map +3 -3
- package/dist/prod/config/Theme.js +1 -1
- package/dist/prod/config/Theme.js.map +3 -3
- package/dist/prod/config/ThemeRoot.js.map +2 -2
- package/dist/prod/decorators/slot-strict.js +2 -0
- package/dist/prod/decorators/slot-strict.js.map +7 -0
- package/dist/prod/decorators/slot.js.map +2 -2
- package/dist/prod/decorators.js +1 -1
- package/dist/prod/decorators.js.map +3 -3
- package/dist/prod/features/F6Navigation.js +1 -1
- package/dist/prod/features/F6Navigation.js.map +3 -3
- package/dist/prod/features/InputElementsFormSupport.js +1 -1
- package/dist/prod/features/InputElementsFormSupport.js.map +3 -3
- package/dist/prod/features/OpenUI5Support.js +1 -1
- package/dist/prod/features/OpenUI5Support.js.map +3 -3
- package/dist/prod/features/insertOpenUI5PopupStyles.js +2 -0
- package/dist/prod/features/insertOpenUI5PopupStyles.js.map +7 -0
- package/dist/prod/features/patchPatcher.js +1 -1
- package/dist/prod/features/patchPatcher.js.map +3 -3
- package/dist/prod/features/patchPopup.js +1 -1
- package/dist/prod/features/patchPopup.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/dist/prod/generated/assets/i18n/messagebundle_en.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
- package/dist/prod/generated/css/FontFace.css.js +36 -1
- package/dist/prod/generated/css/FontFace.css.js.map +2 -2
- package/dist/prod/generated/css/MultipleDragGhost.css.js +2 -0
- package/dist/prod/generated/css/MultipleDragGhost.css.js.map +7 -0
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js +2 -0
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +7 -0
- package/dist/prod/generated/css/ScrollbarStyles.css.js +2 -0
- package/dist/prod/generated/css/ScrollbarStyles.css.js.map +7 -0
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/generated/i18n/i18n-defaults.js +2 -0
- package/dist/prod/generated/i18n/i18n-defaults.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n-fetch.js +2 -0
- package/dist/prod/generated/json-imports/i18n-fetch.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n-node.js +2 -0
- package/dist/prod/generated/json-imports/i18n-node.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n.js +2 -0
- package/dist/prod/generated/json-imports/i18n.js.map +7 -0
- package/dist/prod/index.js +1 -1
- package/dist/prod/index.js.map +3 -3
- package/dist/prod/jsx-runtime.js.map +2 -2
- package/dist/prod/ssr-dom-shim.js +1 -1
- package/dist/prod/ssr-dom-shim.js.map +2 -2
- package/dist/prod/theming/applyTheme.js +1 -1
- package/dist/prod/theming/applyTheme.js.map +3 -3
- package/dist/prod/theming/componentStyles.js +3 -0
- package/dist/prod/theming/componentStyles.js.map +7 -0
- package/dist/prod/thirdparty/preact/preact.module.js +1 -1
- package/dist/prod/updateShadowRoot.js +1 -1
- package/dist/prod/updateShadowRoot.js.map +3 -3
- package/dist/prod/util/FocusableElements.js +1 -1
- package/dist/prod/util/FocusableElements.js.map +2 -2
- package/dist/prod/util/SelectionAssistant.js +1 -1
- package/dist/prod/util/SelectionAssistant.js.map +3 -3
- package/dist/prod/util/TabbableElements.js +1 -1
- package/dist/prod/util/TabbableElements.js.map +2 -2
- package/dist/prod/util/createInstanceChecker.js +2 -0
- package/dist/prod/util/createInstanceChecker.js.map +7 -0
- package/dist/prod/util/createMultiInstanceChecker.js +2 -0
- package/dist/prod/util/createMultiInstanceChecker.js.map +7 -0
- package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
- package/dist/prod/util/dragAndDrop/DragRegistry.js.map +3 -3
- package/dist/prod/util/getParentElement.js +2 -0
- package/dist/prod/util/getParentElement.js.map +7 -0
- package/dist/prod/util/isElementHidden.js +1 -1
- package/dist/prod/util/isElementHidden.js.map +3 -3
- package/dist/prod/util/isEventMarked.js +2 -0
- package/dist/prod/util/isEventMarked.js.map +7 -0
- package/dist/prod/util/valueStateNavigation.js +2 -0
- package/dist/prod/util/valueStateNavigation.js.map +7 -0
- package/dist/prod/validateThemeRoot.js +1 -1
- package/dist/prod/validateThemeRoot.js.map +2 -2
- package/dist/ssr-dom-shim.js +2 -1
- package/dist/ssr-dom-shim.js.map +1 -1
- package/dist/theming/applyTheme.d.ts +2 -0
- package/dist/theming/applyTheme.js +20 -5
- package/dist/theming/applyTheme.js.map +1 -1
- package/dist/theming/componentStyles.d.ts +3 -0
- package/dist/theming/componentStyles.js +15 -0
- package/dist/theming/componentStyles.js.map +1 -0
- package/dist/thirdparty/preact/preact.module.js +1 -1
- package/dist/types.d.ts +11 -3
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +2 -1
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/FocusableElements.js +3 -3
- package/dist/util/FocusableElements.js.map +1 -1
- package/dist/util/SelectionAssistant.js +0 -8
- package/dist/util/SelectionAssistant.js.map +1 -1
- package/dist/util/TabbableElements.js +2 -2
- package/dist/util/TabbableElements.js.map +1 -1
- package/dist/util/createInstanceChecker.d.ts +2 -0
- package/dist/util/createInstanceChecker.js +8 -0
- package/dist/util/createInstanceChecker.js.map +1 -0
- package/dist/util/createMultiInstanceChecker.d.ts +2 -0
- package/dist/util/createMultiInstanceChecker.js +19 -0
- package/dist/util/createMultiInstanceChecker.js.map +1 -0
- package/dist/util/dragAndDrop/DragRegistry.d.ts +14 -8
- package/dist/util/dragAndDrop/DragRegistry.js +46 -50
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +4 -3
- package/dist/util/getParentElement.d.ts +2 -0
- package/dist/util/getParentElement.js +5 -0
- package/dist/util/getParentElement.js.map +1 -0
- package/dist/util/isElementHidden.js +2 -1
- package/dist/util/isElementHidden.js.map +1 -1
- package/dist/util/isEventMarked.d.ts +2 -0
- package/dist/util/isEventMarked.js +6 -0
- package/dist/util/isEventMarked.js.map +1 -0
- package/dist/util/valueStateNavigation.d.ts +8 -0
- package/dist/util/valueStateNavigation.js +40 -0
- package/dist/util/valueStateNavigation.js.map +1 -0
- package/dist/validateThemeRoot.js +6 -2
- package/dist/validateThemeRoot.js.map +1 -1
- package/package-scripts.cjs +64 -33
- package/package.json +27 -22
- package/src/css/MultipleDragGhost.css +17 -0
- package/src/css/OpenUI5PopupStyles.css +10 -0
- package/src/css/ScrollbarStyles.css +3 -0
- package/src/css/SystemCSSVars.css +28 -3
- package/src/i18n/messagebundle.properties +5 -0
- package/src/i18n/messagebundle_en.properties +2 -0
- package/src/i18n/messagebundle_en_US_sappsd.properties +2 -0
- package/src/i18n/messagebundle_en_US_saprigi.properties +2 -0
- package/src/i18n/messagebundle_en_US_saptrc.properties +2 -0
- package/src/thirdparty/preact/preact.module.js +1 -1
- 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
- package/dist/css/FontFace.css +0 -96
- package/dist/css/OverrideFontFace.css +0 -32
- package/dist/generated/css/OverrideFontFace.css.d.ts +0 -2
- package/dist/generated/css/OverrideFontFace.css.js +0 -2
- package/dist/generated/css/OverrideFontFace.css.js.map +0 -1
- package/dist/prod/generated/css/OverrideFontFace.css.js +0 -2
- package/dist/prod/generated/css/OverrideFontFace.css.js.map +0 -7
- package/dist/prod/util/getEffectiveScrollbarStyle.js +0 -28
- package/dist/prod/util/getEffectiveScrollbarStyle.js.map +0 -7
- package/dist/util/getEffectiveScrollbarStyle.d.ts +0 -2
- package/dist/util/getEffectiveScrollbarStyle.js +0 -36
- package/dist/util/getEffectiveScrollbarStyle.js.map +0 -1
- package/src/css/FontFace.css +0 -96
- package/src/css/OverrideFontFace.css +0 -32
|
@@ -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
|
-
});
|