@sapudex/web-components 2.2.0 → 2.4.0
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/.eslintignore +3 -0
- package/bundle.esm.js +3 -0
- package/cypress/fixtures/contact-numbers.ts +10 -0
- package/cypress/fixtures/event-ribbon-links.ts +5 -0
- package/cypress/specs/Accordion.cy.tsx +25 -2
- package/cypress/specs/AccordionItem.cy.tsx +1 -1
- package/cypress/specs/Avatar.cy.tsx +1 -1
- package/cypress/specs/AvatarGroup.cy.tsx +1 -2
- package/cypress/specs/Badge.cy.tsx +1 -1
- package/cypress/specs/Contact.cy.tsx +92 -0
- package/cypress/specs/ContactItem.cy.tsx +56 -0
- package/cypress/specs/CountrySelector.cy.tsx +10 -4
- package/cypress/specs/EventRibbon.cy.tsx +110 -0
- package/cypress/specs/Footer.cy.tsx +1 -1
- package/cypress/specs/ListItem.cy.tsx +1 -1
- package/cypress/specs/PhoneNumberField.cy.tsx +4 -2
- package/cypress/specs/Review.cy.tsx +1 -3
- package/cypress/specs/ReviewItem.cy.tsx +1 -1
- package/cypress/specs/SecondaryNavigationDesktop.cy.tsx +123 -116
- package/cypress/specs/SecondaryNavigationMobile.cy.tsx +27 -38
- package/cypress/specs/SelectBox.cy.tsx +93 -88
- package/cypress/specs/Slider.cy.tsx +1 -1
- package/cypress/specs/StatusBadge.cy.tsx +1 -1
- package/cypress/specs/StatusMessage.cy.tsx +1 -1
- package/cypress/specs/Switch.cy.tsx +1 -2
- package/cypress/specs/Table.cy.tsx +1 -9
- package/cypress/specs/Tag.cy.tsx +1 -1
- package/cypress/specs/TagGroup.cy.tsx +1 -2
- package/cypress/specs/TextField.cy.tsx +1 -1
- package/cypress/specs/Textarea.cy.tsx +1 -1
- package/cypress/specs/Toast.cy.tsx +1 -1
- package/cypress/specs/Tooltip.cy.tsx +1 -2
- package/cypress/specs/TruncatedText.cy.tsx +2 -1
- package/cypress/specs/Upload.cy.tsx +1 -2
- package/cypress/specs/UploadItem.cy.tsx +1 -1
- package/cypress/specs/Wizard.cy.tsx +7 -4
- package/cypress/support/commands.ts +31 -2
- package/cypress/support/component-imports.instrumented.ts +95 -0
- package/cypress/support/component-imports.src.ts +95 -0
- package/cypress/support/component.ts +1 -1
- package/cypress.config.ts +6 -0
- package/dist/Accordion.d.ts +7 -1
- package/dist/Accordion.js +3 -3
- package/dist/Accordion.js.map +1 -1
- package/dist/Assets.js +31 -0
- package/dist/Assets.js.map +1 -1
- package/dist/AssetsVariables.js +4 -0
- package/dist/AssetsVariables.js.map +1 -1
- package/dist/Button.d.ts +7 -0
- package/dist/Button.js +3 -0
- package/dist/Button.js.map +1 -1
- package/dist/Contact.d.ts +102 -0
- package/dist/Contact.js +152 -0
- package/dist/Contact.js.map +1 -0
- package/dist/ContactItem.d.ts +67 -0
- package/dist/ContactItem.js +96 -0
- package/dist/ContactItem.js.map +1 -0
- package/dist/ContactItemTemplate.d.ts +2 -0
- package/dist/ContactItemTemplate.js +13 -0
- package/dist/ContactItemTemplate.js.map +1 -0
- package/dist/ContactTemplate.d.ts +4 -0
- package/dist/ContactTemplate.js +29 -0
- package/dist/ContactTemplate.js.map +1 -0
- package/dist/CountrySelector.d.ts +2 -4
- package/dist/CountrySelector.js +3 -5
- package/dist/CountrySelector.js.map +1 -1
- package/dist/DatePicker.js +2 -1
- package/dist/DatePicker.js.map +1 -1
- package/dist/EventRibbon.d.ts +80 -0
- package/dist/EventRibbon.js +111 -0
- package/dist/EventRibbon.js.map +1 -0
- package/dist/EventRibbonTemplate.d.ts +2 -0
- package/dist/EventRibbonTemplate.js +7 -0
- package/dist/EventRibbonTemplate.js.map +1 -0
- package/dist/Footer.d.ts +0 -1
- package/dist/Footer.js +7 -9
- package/dist/Footer.js.map +1 -1
- package/dist/HeroBanner.d.ts +1 -1
- package/dist/List.d.ts +1 -1
- package/dist/List.js +1 -1
- package/dist/List.js.map +1 -1
- package/dist/MastheadItem.d.ts +1 -3
- package/dist/MastheadItem.js +6 -11
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadMenu.d.ts +0 -1
- package/dist/MastheadMenu.js +2 -4
- package/dist/MastheadMenu.js.map +1 -1
- package/dist/MastheadProfileMenu.d.ts +0 -1
- package/dist/MastheadProfileMenu.js +2 -4
- package/dist/MastheadProfileMenu.js.map +1 -1
- package/dist/MastheadShell.d.ts +4 -1
- package/dist/MastheadShell.js +21 -5
- package/dist/MastheadShell.js.map +1 -1
- package/dist/Pagination.d.ts +17 -3
- package/dist/Pagination.js +33 -31
- package/dist/Pagination.js.map +1 -1
- package/dist/PhoneNumberField.d.ts +5 -5
- package/dist/PhoneNumberField.js +1 -1
- package/dist/PhoneNumberField.js.map +1 -1
- package/dist/SearchableListBase.d.ts +9 -0
- package/dist/SearchableListBase.js +15 -3
- package/dist/SearchableListBase.js.map +1 -1
- package/dist/SecondaryNavigation.d.ts +0 -1
- package/dist/SecondaryNavigation.js +2 -4
- package/dist/SecondaryNavigation.js.map +1 -1
- package/dist/TextField.d.ts +7 -0
- package/dist/TextField.js +3 -0
- package/dist/TextField.js.map +1 -1
- package/dist/Wizard.d.ts +20 -1
- package/dist/Wizard.js +22 -9
- package/dist/Wizard.js.map +1 -1
- package/dist/WizardTemplate.js +1 -1
- package/dist/WizardTemplate.js.map +1 -1
- package/dist/assets/{InputSuggestions-KGCQrV_T.js → InputSuggestions-CYW_6A8K.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-D4zLIdLd.js → ListItemStandardExpandableTextTemplate-BDrgWGjT.js} +1 -1
- package/dist/assets/{bundle.esm-Diw1zQ-o.js → bundle.esm-DRCvw6Ji.js} +235 -225
- package/dist/assets/messagebundle_en-BK8-Eyic.js +1 -0
- package/dist/css/themes/Accordion.css +1 -1
- package/dist/css/themes/Button.css +1 -1
- package/dist/css/themes/Contact.css +1 -0
- package/dist/css/themes/ContactItem.css +1 -0
- package/dist/css/themes/DatePickerPopover.css +1 -1
- package/dist/css/themes/EventRibbon.css +1 -0
- package/dist/css/themes/MastheadCountrySelector.css +1 -1
- package/dist/css/themes/MastheadItem.css +1 -1
- package/dist/css/themes/MastheadShell.css +1 -1
- package/dist/css/themes/Modal.css +1 -1
- package/dist/css/themes/Pagination.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/css/themes/TextField.css +1 -1
- package/dist/custom-elements-internal.json +823 -99
- package/dist/custom-elements.json +783 -83
- package/dist/data/CountryListISO3166.d.ts +13 -4
- package/dist/data/CountryListISO3166.js +8 -0
- package/dist/data/CountryListISO3166.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +3 -1
- package/dist/generated/i18n/i18n-defaults.js +3 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/templates/AccordionTemplate.lit.js +4 -2
- package/dist/generated/templates/AccordionTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadItemTemplate.lit.js +25 -22
- package/dist/generated/templates/MastheadItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/PaginationTemplate.lit.js +1 -1
- package/dist/generated/templates/PaginationTemplate.lit.js.map +1 -1
- package/dist/generated/templates/PhoneNumberFieldTemplate.lit.js +2 -2
- package/dist/generated/templates/PhoneNumberFieldTemplate.lit.js.map +1 -1
- package/dist/generated/themes/Accordion.css.d.ts +1 -1
- package/dist/generated/themes/Accordion.css.js +1 -1
- package/dist/generated/themes/Accordion.css.js.map +1 -1
- package/dist/generated/themes/Button.css.d.ts +1 -1
- package/dist/generated/themes/Button.css.js +1 -1
- package/dist/generated/themes/Button.css.js.map +1 -1
- package/dist/generated/themes/Contact.css.d.ts +2 -0
- package/dist/generated/themes/Contact.css.js +8 -0
- package/dist/generated/themes/Contact.css.js.map +1 -0
- package/dist/generated/themes/ContactItem.css.d.ts +2 -0
- package/dist/generated/themes/ContactItem.css.js +8 -0
- package/dist/generated/themes/ContactItem.css.js.map +1 -0
- package/dist/generated/themes/DatePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js.map +1 -1
- package/dist/generated/themes/EventRibbon.css.d.ts +2 -0
- package/dist/generated/themes/EventRibbon.css.js +8 -0
- package/dist/generated/themes/EventRibbon.css.js.map +1 -0
- package/dist/generated/themes/MastheadCountrySelector.css.d.ts +1 -1
- package/dist/generated/themes/MastheadCountrySelector.css.js +1 -1
- package/dist/generated/themes/MastheadCountrySelector.css.js.map +1 -1
- package/dist/generated/themes/MastheadItem.css.d.ts +1 -1
- package/dist/generated/themes/MastheadItem.css.js +1 -1
- package/dist/generated/themes/MastheadItem.css.js.map +1 -1
- package/dist/generated/themes/MastheadShell.css.d.ts +1 -1
- package/dist/generated/themes/MastheadShell.css.js +1 -1
- package/dist/generated/themes/MastheadShell.css.js.map +1 -1
- package/dist/generated/themes/Modal.css.d.ts +1 -1
- package/dist/generated/themes/Modal.css.js +1 -1
- package/dist/generated/themes/Modal.css.js.map +1 -1
- package/dist/generated/themes/Pagination.css.d.ts +1 -1
- package/dist/generated/themes/Pagination.css.js +1 -1
- package/dist/generated/themes/Pagination.css.js.map +1 -1
- package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
- package/dist/generated/themes/RatingIndicator.css.js +1 -1
- package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
- package/dist/generated/themes/Slider.css.d.ts +1 -1
- package/dist/generated/themes/Slider.css.js +1 -1
- package/dist/generated/themes/Slider.css.js.map +1 -1
- package/dist/generated/themes/TextField.css.d.ts +1 -1
- package/dist/generated/themes/TextField.css.js +1 -1
- package/dist/generated/themes/TextField.css.js.map +1 -1
- package/dist/messagebundle.properties +5 -0
- package/dist/messagebundle_en.properties +3 -0
- package/dist/types/ContactItemIcon.d.ts +6 -0
- package/dist/types/ContactItemIcon.js +8 -0
- package/dist/types/ContactItemIcon.js.map +1 -0
- package/dist/types/EventRibbon.d.ts +37 -0
- package/dist/types/EventRibbon.js +43 -0
- package/dist/types/EventRibbon.js.map +1 -0
- package/dist/utils/parseArrayFromString.d.ts +2 -0
- package/dist/utils/parseArrayFromString.js +5 -0
- package/dist/utils/parseArrayFromString.js.map +1 -0
- package/dist/vscode.html-custom-data.json +183 -1
- package/dist/web-types.json +321 -2
- package/filter-coverage.js +58 -0
- package/package.json +8 -3
- package/src/Accordion.hbs +13 -9
- package/src/Accordion.ts +7 -4
- package/src/Assets.ts +29 -0
- package/src/AssetsVariables.ts +4 -0
- package/src/Button.ts +9 -0
- package/src/Contact.ts +200 -0
- package/src/ContactItem.ts +119 -0
- package/src/ContactItemTemplate.tsx +22 -0
- package/src/ContactTemplate.tsx +105 -0
- package/src/CountrySelector.ts +5 -8
- package/src/DatePicker.ts +2 -1
- package/src/EventRibbon.ts +143 -0
- package/src/EventRibbonTemplate.tsx +18 -0
- package/src/Footer.ts +7 -10
- package/src/List.ts +1 -1
- package/src/MastheadItem.hbs +8 -0
- package/src/MastheadItem.ts +8 -16
- package/src/MastheadMenu.ts +2 -5
- package/src/MastheadProfileMenu.ts +2 -5
- package/src/MastheadShell.ts +25 -5
- package/src/Pagination.hbs +7 -3
- package/src/Pagination.ts +48 -31
- package/src/PhoneNumberField.hbs +1 -1
- package/src/PhoneNumberField.ts +7 -2
- package/src/SearchableListBase.ts +24 -3
- package/src/SecondaryNavigation.ts +3 -5
- package/src/TextField.ts +9 -0
- package/src/Wizard.ts +39 -11
- package/src/WizardTemplate.tsx +5 -1
- package/src/data/CountryListISO3166.ts +10 -2
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/templates/AccordionTemplate.lit.ts +4 -2
- package/src/generated/templates/MastheadItemTemplate.lit.ts +25 -22
- package/src/generated/templates/PaginationTemplate.lit.ts +1 -1
- package/src/generated/templates/PhoneNumberFieldTemplate.lit.ts +1 -1
- package/src/generated/themes/Accordion.css.ts +1 -1
- package/src/generated/themes/Button.css.ts +1 -1
- package/src/generated/themes/Contact.css.ts +9 -0
- package/src/generated/themes/ContactItem.css.ts +9 -0
- package/src/generated/themes/DatePickerPopover.css.ts +1 -1
- package/src/generated/themes/EventRibbon.css.ts +9 -0
- package/src/generated/themes/MastheadCountrySelector.css.ts +1 -1
- package/src/generated/themes/MastheadItem.css.ts +1 -1
- package/src/generated/themes/MastheadShell.css.ts +1 -1
- package/src/generated/themes/Modal.css.ts +1 -1
- package/src/generated/themes/Pagination.css.ts +1 -1
- package/src/generated/themes/RatingIndicator.css.ts +1 -1
- package/src/generated/themes/Slider.css.ts +1 -1
- package/src/generated/themes/TextField.css.ts +1 -1
- package/src/i18n/messagebundle.properties +5 -0
- package/src/i18n/messagebundle_en.properties +3 -0
- package/src/themes/Accordion.css +1 -0
- package/src/themes/Button.css +74 -26
- package/src/themes/Contact.css +184 -0
- package/src/themes/ContactItem.css +44 -0
- package/src/themes/DatePickerPopover.css +64 -6
- package/src/themes/EventRibbon.css +411 -0
- package/src/themes/MastheadCountrySelector.css +8 -5
- package/src/themes/MastheadItem.css +12 -4
- package/src/themes/MastheadShell.css +3 -1
- package/src/themes/Modal.css +8 -4
- package/src/themes/Pagination.css +19 -0
- package/src/themes/TextField.css +2 -13
- package/src/types/ContactItemIcon.ts +7 -0
- package/src/types/EventRibbon.ts +51 -0
- package/src/utils/parseArrayFromString.ts +5 -0
- package/swap-component-imports.js +18 -0
- package/dist/assets/messagebundle_en-CVKgy_9L.js +0 -1
package/.eslintignore
CHANGED
package/bundle.esm.js
CHANGED
|
@@ -32,11 +32,14 @@ import "./dist/BreadcrumbsItem.js";
|
|
|
32
32
|
import "./dist/Button.js";
|
|
33
33
|
import "./dist/Carousel.js";
|
|
34
34
|
import "./dist/Checkbox.js";
|
|
35
|
+
import "./dist/Contact.js";
|
|
36
|
+
import "./dist/ContactItem.js";
|
|
35
37
|
import "./dist/ControlButton.js";
|
|
36
38
|
import "./dist/CountrySelector.js";
|
|
37
39
|
import "./dist/DatePicker.js";
|
|
38
40
|
import "./dist/Divider.js";
|
|
39
41
|
import "./dist/Dropdown.js";
|
|
42
|
+
import "./dist/EventRibbon.js";
|
|
40
43
|
import "./dist/FilterMenu.js";
|
|
41
44
|
import "./dist/FilterMenuGroupHeader.js";
|
|
42
45
|
import "./dist/FilterMenuItem.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import UDExAccordion from "
|
|
2
|
-
import UDExAccordionItem from "../../src/AccordionItem.js";
|
|
1
|
+
import { UDExAccordion, UDExAccordionItem } from "../support/component-imports.js";
|
|
3
2
|
|
|
4
3
|
const defaultAccordion = <UDExAccordion headline="Test headline" id="accordionComponent">
|
|
5
4
|
<UDExAccordionItem label="Some label for item 1" numberBadge="72">
|
|
@@ -19,6 +18,15 @@ const defaultAccordion = <UDExAccordion headline="Test headline" id="accordionCo
|
|
|
19
18
|
</UDExAccordionItem>
|
|
20
19
|
</UDExAccordion>
|
|
21
20
|
|
|
21
|
+
const simpleAccordion = <UDExAccordion hide-expand-button id="accordionComponent">
|
|
22
|
+
<UDExAccordionItem label="Some label for item 1">
|
|
23
|
+
<div>some content<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet aperiam aut eum ipsum natus necessitatibus neque officiis repellendus totam voluptatum!</p></div>
|
|
24
|
+
</UDExAccordionItem>
|
|
25
|
+
<UDExAccordionItem label="Some label for item 2">
|
|
26
|
+
<div>some content<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet aperiam aut eum ipsum natus necessitatibus neque officiis repellendus totam voluptatum!</p></div>
|
|
27
|
+
</UDExAccordionItem>
|
|
28
|
+
</UDExAccordion>
|
|
29
|
+
|
|
22
30
|
describe("Accordion", () => {
|
|
23
31
|
beforeEach(() => {
|
|
24
32
|
cy.mount(defaultAccordion)
|
|
@@ -139,4 +147,19 @@ describe("Accordion", () => {
|
|
|
139
147
|
cy.get("[udex-accordion]").shadow().find(".udex-accordion__btn").click()
|
|
140
148
|
cy.get("@toggleItems").should("have.been.called")
|
|
141
149
|
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
describe("Accordion - simplified", () => {
|
|
153
|
+
beforeEach(() => {
|
|
154
|
+
cy.mount(simpleAccordion)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
it("does not render empty headline", () => {
|
|
158
|
+
cy.get("[udex-accordion]").shadow().find(".udex-accordion__headline").should("not.exist");
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
it("hide expand all button", () => {
|
|
163
|
+
cy.get("[udex-accordion]").shadow().find(".udex-accordion__btn").should("not.exist");
|
|
164
|
+
});
|
|
142
165
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import UDExAccordionItem from "
|
|
1
|
+
import { UDExAccordionItem } from "../support/component-imports.js";
|
|
2
2
|
|
|
3
3
|
const accordionItem = <UDExAccordionItem label="Some label for item 1" numberBadge="72">
|
|
4
4
|
<div>some content<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet aperiam aut eum ipsum natus necessitatibus neque officiis repellendus totam voluptatum!</p></div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import UDExAvatar from "
|
|
2
|
-
import UDExAvatarGroup from "../../src/AvatarGroup.js";
|
|
1
|
+
import { UDExAvatar, UDExAvatarGroup } from "../support/component-imports.js";
|
|
3
2
|
|
|
4
3
|
const defaultAvatarGroup = <UDExAvatarGroup>
|
|
5
4
|
<UDExAvatar initials="SM"></UDExAvatar>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { UDExContact, UDExContactItem } from "../support/component-imports.js";
|
|
2
|
+
import { contactNumbers } from "../fixtures/contact-numbers.js";
|
|
3
|
+
|
|
4
|
+
const contactComponent = <UDExContact
|
|
5
|
+
button-text="Contact us"
|
|
6
|
+
local-country-numbers-link="local-country-numbers-link-href"
|
|
7
|
+
contact-numbers={JSON.stringify(contactNumbers)}
|
|
8
|
+
>
|
|
9
|
+
<UDExContactItem label="Call me now" href="www.sap.com" icon="Headset">SAP can call you to discuss any questions you have.</UDExContactItem>
|
|
10
|
+
<UDExContactItem label="Chat now" icon="Discussion-2">Get live help and chat with an SAP representative.</UDExContactItem>
|
|
11
|
+
<UDExContactItem label="Contact us" href="www.sap.com" icon="Email">E-mail us with comments, questions or feedback.</UDExContactItem>
|
|
12
|
+
</UDExContact>
|
|
13
|
+
|
|
14
|
+
describe("Contact component", () => {
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
cy.mount(contactComponent)
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("component is correctly rendered", () => {
|
|
20
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact").should("be.visible");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("renders the text for component", () => {
|
|
24
|
+
cy.get("[udex-contact]").shadow().find("[udex-button]").should("have.text", "Contact us");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("test if the popover is closed after pressing \"Escape\" key", () => {
|
|
28
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__button").click().realPress("Escape");
|
|
29
|
+
cy.get("[udex-contact]").shadow().find("[ui5-responsive-popover]").should("not.visible");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe("Desktop tests", () => {
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
cy.viewport(1920, 1080);
|
|
35
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__button").click();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("renders the popover after clicking the button opener", () => {
|
|
39
|
+
cy.get("[udex-contact]").shadow().find("[ui5-responsive-popover]").should("be.visible");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("renders the popover after clicking the button opener", () => {
|
|
43
|
+
cy.get("[udex-contact]").shadow().find("[ui5-responsive-popover]").should("be.visible");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("renders right amount of contact items", () => {
|
|
47
|
+
cy.get("[udex-contact]").find("udex-contact-item").should("have.length", 3);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("renders the title of phone section", () => {
|
|
51
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__call-us-title").should("have.text", "Call us today!");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("renders the text of complete list section", () => {
|
|
55
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__complete-list").should("have.text", "Complete list of local country numbers");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("renders the href of complete list link", () => {
|
|
59
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__local-country-link").should("have.attr", "href", "local-country-numbers-link-href");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("renders the list of phone numbers", () => {
|
|
63
|
+
const numbers = cy.get("[udex-contact]").shadow().find(".udex-contact__number-wrapper");
|
|
64
|
+
numbers.each(($item, index) => {
|
|
65
|
+
const currentContactNumber = contactNumbers[index];
|
|
66
|
+
const country = $item.find(".udex-contact__country").text();
|
|
67
|
+
const number = $item.find(".udex-contact__number").text();
|
|
68
|
+
expect(country).to.include(currentContactNumber.country);
|
|
69
|
+
expect(number).to.include(currentContactNumber.number);
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("Mobile tests", () => {
|
|
75
|
+
beforeEach(() => {
|
|
76
|
+
cy.simulateDevice();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("renders the close mobile button", () => {
|
|
80
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__button").click();
|
|
81
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__close-btn").should("be.visible");
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("renders the tooltip for the opener button", () => {
|
|
85
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__button").should("have.attr", "tooltip", "Contact us");
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("renders the accessibleName for the opener button", () => {
|
|
89
|
+
cy.get("[udex-contact]").shadow().find(".udex-contact__button").should("have.attr", "accessible-name", "Contact us");
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { UDExContactItem } from "../support/component-imports.js";
|
|
2
|
+
|
|
3
|
+
const contactItemComponent = <UDExContactItem label="Call me now" href="www.sap.com" icon="Headset">SAP can call you to discuss any questions you have.</UDExContactItem>
|
|
4
|
+
|
|
5
|
+
describe("Contact Item component", () => {
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
cy.mount(contactItemComponent)
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
it("component is correctly rendered", () => {
|
|
11
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item").should("be.visible");
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("renders the text for the item", () => {
|
|
15
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__description").should("be.visible");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("renders the link text for the item", () => {
|
|
19
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__link").should("have.text", "Call me now");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("renders the href for the link", () => {
|
|
23
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__link").should("have.attr", "href", "www.sap.com");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("renders the icon for the item", () => {
|
|
27
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__icon").should("be.visible");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("renders the name for the icon", () => {
|
|
31
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__icon").should("have.attr", "name", "headset");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("test the contact item has custom \"item-click\" event with mouse click on the link", () => {
|
|
35
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__link")
|
|
36
|
+
.then($link => {
|
|
37
|
+
$link.get(0).addEventListener("item-click", event => {
|
|
38
|
+
expect(event.type).to.equal("item-click");
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__link").click();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("tests the \"item-click\" event is prevented when prevent default is called", () => {
|
|
46
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__link")
|
|
47
|
+
.then($link => {
|
|
48
|
+
$link.get(0).addEventListener("item-click", event => {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
cy.get("[udex-contact-item]").shadow().find(".udex-contact-item__link").click();
|
|
54
|
+
cy.url().should("not.include", "www.sap.com");
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import UDExCountrySelector from "
|
|
1
|
+
import { UDExCountrySelector } from "../support/component-imports.js";
|
|
2
2
|
|
|
3
3
|
const defaultCountrySelector = <UDExCountrySelector id="default"
|
|
4
4
|
searchPlaceholder="Search Countries and Regions"
|
|
@@ -159,7 +159,9 @@ describe("CountrySelector", () => {
|
|
|
159
159
|
|
|
160
160
|
it('emits change-search when search field typing', () => {
|
|
161
161
|
const changeHandler = cy.stub().as("changeHandler")
|
|
162
|
-
|
|
162
|
+
cy.get("#default").then($countrySelector => {
|
|
163
|
+
$countrySelector[0].addEventListener("change-search", changeHandler)
|
|
164
|
+
})
|
|
163
165
|
cy.get("#default").shadow().find("#udexTextField").click()
|
|
164
166
|
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__field").click().realPress("p").realPress("o").realPress("l").realPress("a")
|
|
165
167
|
cy.get("@changeHandler").should("have.been.called")
|
|
@@ -167,7 +169,9 @@ describe("CountrySelector", () => {
|
|
|
167
169
|
|
|
168
170
|
it("emits reset-search when search reset button is clicked", () => {
|
|
169
171
|
const resetHandler = cy.stub().as("resetHandler")
|
|
170
|
-
|
|
172
|
+
cy.get("#default").then($countrySelector => {
|
|
173
|
+
$countrySelector[0].addEventListener("reset-search", resetHandler)
|
|
174
|
+
})
|
|
171
175
|
cy.get("#default").shadow().find("#udexTextField").click()
|
|
172
176
|
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__field").click().realPress("p").realPress("o").realPress("l").realPress("a")
|
|
173
177
|
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__reset-button").click()
|
|
@@ -176,7 +180,9 @@ describe("CountrySelector", () => {
|
|
|
176
180
|
|
|
177
181
|
it('emits submit-search when user presses Enter key in the search', () => {
|
|
178
182
|
const submitHandler = cy.stub().as("submitHandler")
|
|
179
|
-
|
|
183
|
+
cy.get("#default").then($countrySelector => {
|
|
184
|
+
$countrySelector[0].addEventListener("submit-search", submitHandler)
|
|
185
|
+
})
|
|
180
186
|
cy.get("#default").shadow().find("#udexTextField").click()
|
|
181
187
|
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__field").click().realPress("p").realPress("o").realPress("l").realPress("a").realPress("Enter")
|
|
182
188
|
cy.get("@submitHandler").should("have.been.called")
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { UDExEventRibbon } from "../support/component-imports.js";
|
|
2
|
+
import { eventLink } from "../fixtures/event-ribbon-links.js";
|
|
3
|
+
|
|
4
|
+
const defaultEventRibbon = <UDExEventRibbon
|
|
5
|
+
eventText="Get your free all-access pass to a network of latest innovations and insights"
|
|
6
|
+
eventLogo="now"
|
|
7
|
+
eventLink={JSON.stringify(eventLink)}
|
|
8
|
+
backgroundColorScheme="Blue1">
|
|
9
|
+
</UDExEventRibbon>
|
|
10
|
+
|
|
11
|
+
const linkIconEventRibbon = <UDExEventRibbon
|
|
12
|
+
eventLinkIcon="add-calendar"
|
|
13
|
+
eventText="Get your free all-access pass to a network of latest innovations and insights"
|
|
14
|
+
eventLogo="now"
|
|
15
|
+
eventLink={JSON.stringify(eventLink)}
|
|
16
|
+
backgroundColorScheme="Blue3">
|
|
17
|
+
</UDExEventRibbon>
|
|
18
|
+
|
|
19
|
+
const linkIconMediaEventRibbon = <UDExEventRibbon
|
|
20
|
+
eventLinkIcon="media-play"
|
|
21
|
+
eventText="Get your free all-access pass to a network of latest innovations and insights"
|
|
22
|
+
eventLogo="now"
|
|
23
|
+
eventLink={JSON.stringify(eventLink)}
|
|
24
|
+
backgroundColorScheme="Blue3">
|
|
25
|
+
</UDExEventRibbon>
|
|
26
|
+
|
|
27
|
+
const darkEventRibbon = <UDExEventRibbon
|
|
28
|
+
mode="dark"
|
|
29
|
+
eventText="Get your free all-access pass to a network of latest innovations and insights"
|
|
30
|
+
eventLogo="now"
|
|
31
|
+
eventLink={JSON.stringify(eventLink)}
|
|
32
|
+
backgroundColorScheme="Raspberry2">
|
|
33
|
+
</UDExEventRibbon>
|
|
34
|
+
|
|
35
|
+
const imageEventRibbon = <UDExEventRibbon
|
|
36
|
+
eventText="Get your free all-access pass to a network of latest innovations and insights"
|
|
37
|
+
eventLogo="now"
|
|
38
|
+
eventLink={JSON.stringify(eventLink)}
|
|
39
|
+
backgroundColorScheme="Blue1"
|
|
40
|
+
backgroundImage="https://cdn.udex.services.sap.com/dds/design-tokens/assets/logos/sap-logo.svg">
|
|
41
|
+
</UDExEventRibbon>
|
|
42
|
+
|
|
43
|
+
describe("EventRibbon", () => {
|
|
44
|
+
it("is correctly rendered", () => {
|
|
45
|
+
cy.mount(defaultEventRibbon)
|
|
46
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").should("be.visible");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
xit("renders light mode by default", () => {
|
|
50
|
+
cy.mount(defaultEventRibbon)
|
|
51
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").then($eventRibbon => {
|
|
52
|
+
const {backgroundColor} = window.getComputedStyle($eventRibbon[0])
|
|
53
|
+
expect(backgroundColor).eqls("rgb(85, 107, 129)")
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
xit("correctly darkens light solid background by 1 shade on hover", () => {
|
|
58
|
+
cy.mount(defaultEventRibbon)
|
|
59
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").realHover().then($eventRibbon => {
|
|
60
|
+
const {backgroundColor} = window.getComputedStyle($eventRibbon[0])
|
|
61
|
+
expect(backgroundColor).eqls("rgb(85, 107, 129)")
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("doesn't render event link icon by default", () => {
|
|
66
|
+
cy.mount(defaultEventRibbon)
|
|
67
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").find("ui5-icon").should("not.exist");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("correctly renders add-calendar icon", () => {
|
|
71
|
+
cy.mount(linkIconEventRibbon)
|
|
72
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").find("ui5-icon").should("have.attr", "name", "add-calendar");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("correctly renders media-play icon", () => {
|
|
76
|
+
cy.mount(linkIconMediaEventRibbon)
|
|
77
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").find("ui5-icon").should("have.attr", "name", "media-play");
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
xit("correctly renders dark solid background", () => {
|
|
81
|
+
cy.mount(darkEventRibbon)
|
|
82
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").then($eventRibbon => {
|
|
83
|
+
const {backgroundColor} = window.getComputedStyle($eventRibbon[0])
|
|
84
|
+
expect(backgroundColor).eqls("rgb(85, 107, 129)")
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
xit("correctly darkens dark solid background by 1 shade on hover", () => {
|
|
89
|
+
cy.mount(darkEventRibbon)
|
|
90
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").realHover().then($eventRibbon => {
|
|
91
|
+
const {backgroundColor} = window.getComputedStyle($eventRibbon[0])
|
|
92
|
+
expect(backgroundColor).eqls("rgb(85, 107, 129)")
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("correctly renders background image", () => {
|
|
97
|
+
cy.mount(imageEventRibbon)
|
|
98
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").then($eventRibbon => {
|
|
99
|
+
const { backgroundImage } = window.getComputedStyle($eventRibbon[0])
|
|
100
|
+
assert.strictEqual(backgroundImage, 'url("https://cdn.udex.services.sap.com/dds/design-tokens/assets/logos/sap-logo.svg")')
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("correctly parses eventLink object", () => {
|
|
105
|
+
cy.mount(defaultEventRibbon)
|
|
106
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").should("have.attr", "target", "_blank");
|
|
107
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").should("have.attr", "href", "#");
|
|
108
|
+
cy.get("[udex-event-ribbon]").shadow().find(".udex-event-ribbon__container").should("have.attr", "title", "Learn more");
|
|
109
|
+
});
|
|
110
|
+
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import UDExFooter from "
|
|
1
|
+
import { UDExFooter } from "../support/component-imports.js";
|
|
2
2
|
import { quickLinks, trendingLinks, aboutLinks, siteInformationLinks, socialLinks } from "../fixtures/footer-links.js";
|
|
3
3
|
import { setLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import UDExPhoneNumberField from "
|
|
1
|
+
import { UDExPhoneNumberField } from "../support/component-imports.js";
|
|
2
2
|
|
|
3
3
|
const defaultPhoneNumberField = <UDExPhoneNumberField id="default"
|
|
4
4
|
valueState="Standard"
|
|
@@ -128,8 +128,10 @@ describe("PhoneNumberField", () => {
|
|
|
128
128
|
|
|
129
129
|
it("emit input when the value of the component changes", () => {
|
|
130
130
|
const inputHandler = cy.stub().as("inputHandler")
|
|
131
|
-
document.addEventListener("input", inputHandler)
|
|
132
131
|
cy.mount(<UDExPhoneNumberField></UDExPhoneNumberField>)
|
|
132
|
+
cy.get("[udex-phone-number-field]").then($phoneNumberField => {
|
|
133
|
+
$phoneNumberField[0].addEventListener("input", inputHandler)
|
|
134
|
+
})
|
|
133
135
|
cy.get("[udex-phone-number-field]").shadow().find("input").click().type("012")
|
|
134
136
|
cy.get("@inputHandler").should("have.been.called")
|
|
135
137
|
});
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import UDExButton from "
|
|
2
|
-
import UDExRatingBar from "../../src/RatingBar.js";
|
|
3
|
-
import UDExReview from "../../src/Review.js";
|
|
1
|
+
import { UDExButton, UDExRatingBar, UDExReview } from "../support/component-imports.js";
|
|
4
2
|
|
|
5
3
|
const defaultReview = <UDExReview id="review-standard" rating={4.5} reviews={200}>
|
|
6
4
|
<span slot="defaultText">Share your thought with other customers</span>
|