@sapudex/web-components 2.10.0 → 2.12.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/bundle.esm.js +1 -0
- package/cypress/fixtures/profile-menu.ts +75 -0
- package/cypress/specs/Accordion.cy.tsx +19 -0
- package/cypress/specs/AccordionItem.cy.tsx +9 -0
- package/cypress/specs/Footer.cy.tsx +48 -11
- package/cypress/specs/ListItem.cy.tsx +66 -52
- package/cypress/specs/MastheadProfileMenu.cy.tsx +174 -0
- package/cypress/specs/PromoTile.cy.tsx +124 -0
- package/cypress/specs/Quote.cy.tsx +65 -0
- package/cypress/specs/SelectBox.cy.tsx +134 -66
- package/cypress/support/component-imports.instrumented.ts +8 -0
- package/cypress/support/component-imports.src.ts +9 -1
- package/dist/Accordion.d.ts +15 -0
- package/dist/Accordion.js +19 -0
- package/dist/Accordion.js.map +1 -1
- package/dist/AccordionItem.d.ts +19 -0
- package/dist/AccordionItem.js +23 -0
- package/dist/AccordionItem.js.map +1 -1
- package/dist/AccordionItemTemplate.js +7 -2
- package/dist/AccordionItemTemplate.js.map +1 -1
- package/dist/AccordionTemplate.js +21 -1
- package/dist/AccordionTemplate.js.map +1 -1
- package/dist/Button.d.ts +8 -0
- package/dist/Button.js +11 -0
- package/dist/Button.js.map +1 -1
- package/dist/Footer.d.ts +45 -3
- package/dist/Footer.js +41 -17
- package/dist/Footer.js.map +1 -1
- package/dist/List.d.ts +9 -2
- package/dist/List.js +19 -8
- package/dist/List.js.map +1 -1
- package/dist/ListGroupHeader.d.ts +2 -1
- package/dist/ListGroupHeader.js.map +1 -1
- package/dist/ListItem.d.ts +12 -1
- package/dist/ListItem.js +15 -1
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemBase.d.ts +10 -0
- package/dist/ListItemBase.js +31 -0
- package/dist/ListItemBase.js.map +1 -1
- package/dist/ListSelectAll.d.ts +2 -1
- package/dist/ListSelectAll.js.map +1 -1
- package/dist/MastheadItem.d.ts +2 -0
- package/dist/MastheadItem.js +6 -0
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadProfileMenu.d.ts +67 -3
- package/dist/MastheadProfileMenu.js +164 -10
- package/dist/MastheadProfileMenu.js.map +1 -1
- package/dist/MastheadShell.d.ts +1 -0
- package/dist/MastheadShell.js +6 -1
- package/dist/MastheadShell.js.map +1 -1
- package/dist/PromoTile.d.ts +143 -0
- package/dist/PromoTile.js +198 -0
- package/dist/PromoTile.js.map +1 -0
- package/dist/PromoTileTemplate.d.ts +2 -0
- package/dist/PromoTileTemplate.js +22 -0
- package/dist/PromoTileTemplate.js.map +1 -0
- package/dist/Quote.d.ts +11 -0
- package/dist/Quote.js +18 -3
- package/dist/Quote.js.map +1 -1
- package/dist/Search.d.ts +3 -1
- package/dist/Search.js +1 -0
- package/dist/Search.js.map +1 -1
- package/dist/SearchableListBase.d.ts +16 -0
- package/dist/SearchableListBase.js +31 -1
- package/dist/SearchableListBase.js.map +1 -1
- package/dist/SelectBox.js +10 -0
- package/dist/SelectBox.js.map +1 -1
- package/dist/SelectBoxItem.d.ts +29 -0
- package/dist/SelectBoxItem.js +26 -0
- package/dist/SelectBoxItem.js.map +1 -1
- package/dist/StatusBadge.d.ts +1 -7
- package/dist/StatusBadge.js +1 -8
- package/dist/StatusBadge.js.map +1 -1
- package/dist/StepInputTemplate.js +1 -1
- package/dist/StepInputTemplate.js.map +1 -1
- package/dist/assets/{InputSuggestions-xcV7PZDf.js → InputSuggestions-DtUQULbo.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-RYCr4pVL.js → ListItemStandardExpandableTextTemplate-B62PaSFk.js} +1 -1
- package/dist/assets/{bundle.esm-bg-64miJ.js → bundle.esm-Ba8g4ech.js} +211 -210
- package/dist/assets/messagebundle_en-PmkE-Vht.js +1 -0
- package/dist/css/themes/AccordionItem.css +1 -1
- package/dist/css/themes/BreadcrumbsPopover.css +1 -1
- package/dist/css/themes/Button.css +1 -1
- package/dist/css/themes/CountrySelector.css +1 -1
- package/dist/css/themes/Divider.css +1 -1
- package/dist/css/themes/Footer.css +1 -1
- package/dist/css/themes/HeroBanner.css +1 -1
- package/dist/css/themes/ListItem.css +1 -1
- package/dist/css/themes/MastheadProfileMenu.css +1 -1
- package/dist/css/themes/PromoTile.css +1 -0
- package/dist/css/themes/Quote.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/css/themes/StepInput.css +1 -1
- package/dist/css/themes/Tag.css +1 -1
- package/dist/custom-elements-internal.json +1515 -277
- package/dist/custom-elements.json +1220 -146
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +7 -1
- package/dist/generated/i18n/i18n-defaults.js +7 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/templates/FooterTemplate.lit.js +33 -32
- package/dist/generated/templates/FooterTemplate.lit.js.map +1 -1
- package/dist/generated/templates/HeroBannerTemplate.lit.js +1 -1
- package/dist/generated/templates/HeroBannerTemplate.lit.js.map +1 -1
- package/dist/generated/templates/ListItemTemplate.lit.js +31 -23
- package/dist/generated/templates/ListItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/ListTemplate.lit.js +2 -2
- package/dist/generated/templates/ListTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadProfileMenuTemplate.lit.js +11 -6
- package/dist/generated/templates/MastheadProfileMenuTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SearchableListBaseTemplate.lit.js +6 -6
- package/dist/generated/templates/SearchableListBaseTemplate.lit.js.map +1 -1
- package/dist/generated/themes/AccordionItem.css.d.ts +1 -1
- package/dist/generated/themes/AccordionItem.css.js +1 -1
- package/dist/generated/themes/AccordionItem.css.js.map +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.css.d.ts +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.css.js +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.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/CountrySelector.css.d.ts +1 -1
- package/dist/generated/themes/CountrySelector.css.js +1 -1
- package/dist/generated/themes/CountrySelector.css.js.map +1 -1
- package/dist/generated/themes/Divider.css.d.ts +1 -1
- package/dist/generated/themes/Divider.css.js +1 -1
- package/dist/generated/themes/Divider.css.js.map +1 -1
- package/dist/generated/themes/Footer.css.d.ts +1 -1
- package/dist/generated/themes/Footer.css.js +1 -1
- package/dist/generated/themes/Footer.css.js.map +1 -1
- package/dist/generated/themes/HeroBanner.css.d.ts +1 -1
- package/dist/generated/themes/HeroBanner.css.js +1 -1
- package/dist/generated/themes/HeroBanner.css.js.map +1 -1
- package/dist/generated/themes/ListItem.css.d.ts +1 -1
- package/dist/generated/themes/ListItem.css.js +1 -1
- package/dist/generated/themes/ListItem.css.js.map +1 -1
- package/dist/generated/themes/MastheadProfileMenu.css.d.ts +1 -1
- package/dist/generated/themes/MastheadProfileMenu.css.js +1 -1
- package/dist/generated/themes/MastheadProfileMenu.css.js.map +1 -1
- package/dist/generated/themes/PromoTile.css.d.ts +2 -0
- package/dist/generated/themes/PromoTile.css.js +8 -0
- package/dist/generated/themes/PromoTile.css.js.map +1 -0
- package/dist/generated/themes/Quote.css.d.ts +1 -1
- package/dist/generated/themes/Quote.css.js +1 -1
- package/dist/generated/themes/Quote.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/StepInput.css.d.ts +1 -1
- package/dist/generated/themes/StepInput.css.js +1 -1
- package/dist/generated/themes/StepInput.css.js.map +1 -1
- package/dist/generated/themes/Tag.css.d.ts +1 -1
- package/dist/generated/themes/Tag.css.js +1 -1
- package/dist/generated/themes/Tag.css.js.map +1 -1
- package/dist/messagebundle.properties +10 -0
- package/dist/messagebundle_en.properties +6 -0
- package/dist/types/PromoTile.d.ts +60 -0
- package/dist/types/PromoTile.js +63 -0
- package/dist/types/PromoTile.js.map +1 -0
- package/dist/types/StatusBadgeValueState.d.ts +8 -0
- package/dist/types/StatusBadgeValueState.js +10 -0
- package/dist/types/StatusBadgeValueState.js.map +1 -0
- package/dist/utils/debounce.d.ts +3 -1
- package/dist/utils/debounce.js +16 -4
- package/dist/utils/debounce.js.map +1 -1
- package/dist/vscode.html-custom-data.json +185 -16
- package/dist/web-types.json +603 -34
- package/package.json +1 -1
- package/src/Accordion.ts +19 -0
- package/src/AccordionItem.ts +28 -0
- package/src/AccordionItemTemplate.tsx +25 -10
- package/src/AccordionTemplate.tsx +22 -1
- package/src/Button.ts +10 -0
- package/src/Footer.hbs +39 -36
- package/src/Footer.ts +81 -6
- package/src/HeroBanner.hbs +0 -1
- package/src/List.hbs +0 -2
- package/src/List.ts +27 -8
- package/src/ListGroupHeader.ts +2 -1
- package/src/ListItem.hbs +16 -2
- package/src/ListItem.ts +29 -2
- package/src/ListItemBase.ts +42 -0
- package/src/ListSelectAll.ts +2 -1
- package/src/MastheadItem.ts +9 -0
- package/src/MastheadProfileMenu.hbs +79 -15
- package/src/MastheadProfileMenu.ts +228 -13
- package/src/MastheadShell.ts +7 -1
- package/src/PromoTile.ts +290 -0
- package/src/PromoTileTemplate.tsx +68 -0
- package/src/Quote.ts +17 -3
- package/src/Search.ts +1 -0
- package/src/SearchableListBase.hbs +18 -1
- package/src/SearchableListBase.ts +47 -1
- package/src/SelectBox.ts +11 -0
- package/src/SelectBoxItem.ts +39 -0
- package/src/StatusBadge.ts +1 -8
- package/src/StepInputTemplate.tsx +1 -1
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/templates/FooterTemplate.lit.ts +33 -32
- package/src/generated/templates/HeroBannerTemplate.lit.ts +1 -1
- package/src/generated/templates/ListItemTemplate.lit.ts +31 -23
- package/src/generated/templates/ListTemplate.lit.ts +2 -2
- package/src/generated/templates/MastheadProfileMenuTemplate.lit.ts +10 -5
- package/src/generated/templates/SearchableListBaseTemplate.lit.ts +6 -6
- package/src/generated/themes/AccordionItem.css.ts +1 -1
- package/src/generated/themes/BreadcrumbsPopover.css.ts +1 -1
- package/src/generated/themes/Button.css.ts +1 -1
- package/src/generated/themes/CountrySelector.css.ts +1 -1
- package/src/generated/themes/Divider.css.ts +1 -1
- package/src/generated/themes/Footer.css.ts +1 -1
- package/src/generated/themes/HeroBanner.css.ts +1 -1
- package/src/generated/themes/ListItem.css.ts +1 -1
- package/src/generated/themes/MastheadProfileMenu.css.ts +1 -1
- package/src/generated/themes/PromoTile.css.ts +9 -0
- package/src/generated/themes/Quote.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/StepInput.css.ts +1 -1
- package/src/generated/themes/Tag.css.ts +1 -1
- package/src/i18n/messagebundle.properties +10 -0
- package/src/i18n/messagebundle_en.properties +6 -0
- package/src/themes/AccordionItem.css +61 -22
- package/src/themes/BreadcrumbsPopover.css +2 -1
- package/src/themes/Button.css +13 -0
- package/src/themes/CountrySelector.css +4 -0
- package/src/themes/Divider.css +2 -1
- package/src/themes/Footer.css +44 -9
- package/src/themes/HeroBanner.css +34 -32
- package/src/themes/ListItem.css +4 -9
- package/src/themes/MastheadProfileMenu.css +87 -3
- package/src/themes/PromoTile.css +152 -0
- package/src/themes/Quote.css +21 -24
- package/src/themes/StepInput.css +10 -0
- package/src/themes/Tag.css +18 -24
- package/src/types/PromoTile.ts +61 -0
- package/src/types/StatusBadgeValueState.ts +9 -0
- package/src/utils/debounce.ts +19 -4
- package/dist/assets/messagebundle_en-BHfPJk-2.js +0 -1
package/bundle.esm.js
CHANGED
|
@@ -72,6 +72,7 @@ import "./dist/Pagination.js";
|
|
|
72
72
|
import "./dist/PasswordField.js";
|
|
73
73
|
import "./dist/PhoneNumberField.js";
|
|
74
74
|
import "./dist/ProgressBar.js";
|
|
75
|
+
import "./dist/PromoTile.js";
|
|
75
76
|
import "./dist/Quote.js";
|
|
76
77
|
import "./dist/RadioButton.js";
|
|
77
78
|
import "./dist/RangeSlider.js";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const userData = {
|
|
2
|
+
name : "John Sánchez",
|
|
3
|
+
username : "john.miller",
|
|
4
|
+
email : "john.miller@sap.com",
|
|
5
|
+
avatarUrl : "https://avatars.profile.sap.com/d/6/idd62e808170c86bf4c00df641a1d5715e4283e241ea481a2aa4a13c9711c0acbf_small.jpeg",
|
|
6
|
+
avatarInitials: "JS"
|
|
7
|
+
};
|
|
8
|
+
export const columnsData = [
|
|
9
|
+
{
|
|
10
|
+
category: "Group heading",
|
|
11
|
+
url: "https://sap.com",
|
|
12
|
+
items: [
|
|
13
|
+
{
|
|
14
|
+
"title": "Lorem ipsum",
|
|
15
|
+
"url": "https://sap.com",
|
|
16
|
+
"externalLink": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"title": "Curabitur aliquam",
|
|
20
|
+
"url": "https://sap.com"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"title": "Sed sodales nisisuscipit",
|
|
24
|
+
"url": "https://sap.com"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "Lorem ipsum example of two lines in row",
|
|
28
|
+
"url": "https://sap.com",
|
|
29
|
+
"externalLink": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"title": "Sed sodales nisisuscipit",
|
|
33
|
+
"url": "https://sap.com"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
items: [
|
|
39
|
+
{
|
|
40
|
+
title: "SAP Learning Journeys",
|
|
41
|
+
url: "https://community-qa.sap.com/topics",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: "Training Courses",
|
|
45
|
+
url: "https://community-qa.sap.com/topics",
|
|
46
|
+
externalLink: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: "SAP Learning Hub",
|
|
50
|
+
url: "https://community-qa.sap.com/topics",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: "SAP Training and Adoption",
|
|
54
|
+
url: "https://community-qa.sap.com/topics",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
export const identities = [
|
|
61
|
+
{
|
|
62
|
+
avatarUrl: "https://avatars.profile.sap.com/d/6/idd62e808170c86bf4c00df641a1d5715e4283e241ea481a2aa4a13c9711c0acbf_small.jpeg",
|
|
63
|
+
email: "email_1@email.com",
|
|
64
|
+
name: "code_type1",
|
|
65
|
+
idsUser: "P1111111",
|
|
66
|
+
isLogged: false,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
avatarUrl: "https://avatars.profile.sap.com/d/6/idd62e808170c86bf4c00df641a1d5715e4283e241ea481a2aa4a13c9711c0acbf_small.jpeg",
|
|
70
|
+
email: "email_2@email.com",
|
|
71
|
+
name: "code_type2",
|
|
72
|
+
idsUser: "P2222222",
|
|
73
|
+
isLogged: true,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UDExAccordion, UDExAccordionItem } from "../support/component-imports.js";
|
|
2
|
+
import {UDExAccordionHeadlineLevel} from "../../src/Accordion.js";
|
|
2
3
|
|
|
3
4
|
const defaultAccordion = <UDExAccordion headline="Test headline" id="accordionComponent">
|
|
4
5
|
<UDExAccordionItem label="Some label for item 1" numberBadge="72">
|
|
@@ -44,6 +45,24 @@ describe("Accordion", () => {
|
|
|
44
45
|
cy.get("[udex-accordion]").find("udex-accordion-item").should("have.length", 5);
|
|
45
46
|
});
|
|
46
47
|
|
|
48
|
+
it("renders default tag of the accordion headline", () => {
|
|
49
|
+
cy.get("[udex-accordion]").shadow().find(".udex-accordion__headline").then($el => {
|
|
50
|
+
expect($el.get(0).tagName).to.equal("H3")
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("renders right tag of the accordion headline", () => {
|
|
55
|
+
cy.mount(<UDExAccordion headline="Test headline" headlineLevel={UDExAccordionHeadlineLevel.H1}>
|
|
56
|
+
<UDExAccordionItem label="Some label for item 1" numberBadge="72">
|
|
57
|
+
<div>Lorem ipsum dolor sit amet</div>
|
|
58
|
+
</UDExAccordionItem>
|
|
59
|
+
</UDExAccordion>)
|
|
60
|
+
|
|
61
|
+
cy.get("[udex-accordion]").shadow().find(".udex-accordion__headline").then($el => {
|
|
62
|
+
expect($el.get(0).tagName).to.equal("H1")
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
47
66
|
it("clicking on expand all btn shows hidden", () => {
|
|
48
67
|
cy.get("[udex-accordion]").shadow().find(".udex-accordion__btn").click()
|
|
49
68
|
|
|
@@ -8,6 +8,10 @@ const expandedAccordionItem = <UDExAccordionItem label="Some label for item 1" n
|
|
|
8
8
|
<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>
|
|
9
9
|
</UDExAccordionItem>
|
|
10
10
|
|
|
11
|
+
const accordionItemLarge = <UDExAccordionItem label="Some label for item 1" labelSize="Large">
|
|
12
|
+
<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>
|
|
13
|
+
</UDExAccordionItem>
|
|
14
|
+
|
|
11
15
|
describe('AccordionItem', () => {
|
|
12
16
|
|
|
13
17
|
beforeEach(() => {
|
|
@@ -26,6 +30,11 @@ describe('AccordionItem', () => {
|
|
|
26
30
|
cy.get("[udex-accordion-item]").click().shadow().find(".udex-accordion-item__content").should("exist").and("be.visible")
|
|
27
31
|
});
|
|
28
32
|
|
|
33
|
+
it("render different headline size", () => {
|
|
34
|
+
cy.mount(accordionItemLarge);
|
|
35
|
+
cy.get("[udex-accordion-item]").click().shadow().find(".udex-accordion-item__content").should("exist");
|
|
36
|
+
});
|
|
37
|
+
|
|
29
38
|
it("click on accordion item add necessary class and change aria-expanded to true", () => {
|
|
30
39
|
cy.get("[udex-accordion-item]").click().shadow().find(".udex-accordion-item__header").should("have.attr", "aria-expanded")
|
|
31
40
|
});
|
|
@@ -2,12 +2,18 @@ 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
|
|
|
5
|
+
const taglineAlt = "SAP tagline alt";
|
|
6
|
+
const chineseLogoUrl = "./stories/footer/chinese-logo.svg";
|
|
7
|
+
const chineseLogoLink = "https://www.sap.cn/index.html";
|
|
8
|
+
const taglineUrl = "./stories/footer/tagline.svg";
|
|
9
|
+
const chineseTaglineUrl = "./stories/footer/chinese-tagline.svg";
|
|
10
|
+
|
|
5
11
|
const defaultFooter = <UDExFooter
|
|
6
12
|
id="footer"
|
|
7
13
|
logoLink="#test"
|
|
8
14
|
logoTitle="SAP Title"
|
|
9
15
|
logoAriaLabel="SAP Homepage"
|
|
10
|
-
logoUrl='
|
|
16
|
+
logoUrl='https://cdn.udex.services.sap.com/dds/design-tokens/assets/logos/sap-logo.svg'
|
|
11
17
|
contactNumbersList='[{"country":"France","number":"400-619-0727"},{"country":"United State","number":"1-800-872-1727"}]'
|
|
12
18
|
localCountryNumbersLink='#'
|
|
13
19
|
chatWithUsLink='#'
|
|
@@ -16,7 +22,12 @@ const defaultFooter = <UDExFooter
|
|
|
16
22
|
aboutLinks = {JSON.stringify(aboutLinks)}
|
|
17
23
|
siteInformationLinks = {JSON.stringify(siteInformationLinks)}
|
|
18
24
|
socialLinks = {JSON.stringify(socialLinks)}
|
|
19
|
-
contactUsLink='#'
|
|
25
|
+
contactUsLink='#'
|
|
26
|
+
tagline-alt={taglineAlt}
|
|
27
|
+
tagline-url={taglineUrl}
|
|
28
|
+
chinese-tagline-url={chineseTaglineUrl}
|
|
29
|
+
chinese-logo-url={chineseLogoUrl}
|
|
30
|
+
chinese-logo-link={chineseLogoLink}>
|
|
20
31
|
</UDExFooter>
|
|
21
32
|
|
|
22
33
|
describe("Footer", () => {
|
|
@@ -70,16 +81,17 @@ describe("Footer", () => {
|
|
|
70
81
|
});
|
|
71
82
|
|
|
72
83
|
it("sets data-id attribute to social links", () => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
cy.get("#footer").shadow().find(".udex-footer__social-container [udex-social-media-button]").each(($socialLink, index) => {
|
|
85
|
+
expect($socialLink[0]).attr("data-id").eqls(socialLinks[index].id)
|
|
86
|
+
})
|
|
87
|
+
});
|
|
77
88
|
|
|
78
|
-
it("renders
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
it("renders tagline image", () => {
|
|
90
|
+
cy.get("#footer").shadow().find(".udex-footer__tagline-image").should("have.attr", "src", taglineUrl);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("renders tagline image alt", () => {
|
|
94
|
+
cy.get("#footer").shadow().find(".udex-footer__tagline-image").should("have.attr", "alt", taglineAlt);
|
|
83
95
|
});
|
|
84
96
|
|
|
85
97
|
describe("Desktop tests", () => {
|
|
@@ -309,4 +321,29 @@ describe("Footer", () => {
|
|
|
309
321
|
cy.get("#footer").shadow().find("udex-accordion-item.udex-footer__action-item").should("exist")
|
|
310
322
|
});
|
|
311
323
|
});
|
|
324
|
+
|
|
325
|
+
describe("Footer chinese", () => {
|
|
326
|
+
beforeEach(() => {
|
|
327
|
+
cy.viewport(1920, 1080);
|
|
328
|
+
setLanguage("zh_cn");
|
|
329
|
+
cy.get("#footer").shadow().as("footer");
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
it("renders chinese text when specified in url", () => {
|
|
333
|
+
cy.get("@footer").find(".udex-footer__copyright-chinese-text").should("have.text", "ICP_NUMBER PUBLIC_SECURITY_NETWORK_NUMBER")
|
|
334
|
+
cy.get("@footer").find(".udex-footer__copyright-chinese-link").should("have.attr", "href", "https://beian.miit.gov.cn/")
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it("renders chinese logo", () => {
|
|
338
|
+
cy.get("@footer").find(".udex-footer__logo-image-chinese").should("have.attr", "src", chineseLogoUrl);
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it("renders chinese logo link", () => {
|
|
342
|
+
cy.get("@footer").find(".udex-footer__logo a").should("have.attr", "href", chineseLogoLink);
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it("renders chinese tagline image", () => {
|
|
346
|
+
cy.get("@footer").find(".udex-footer__tagline-image-chinese").should("have.attr", "src", chineseTaglineUrl);
|
|
347
|
+
});
|
|
348
|
+
});
|
|
312
349
|
});
|
|
@@ -1,71 +1,76 @@
|
|
|
1
1
|
import { UDExListItem } from "../support/component-imports.js";
|
|
2
2
|
import UDExButton from "../../src/Button.js"
|
|
3
|
+
import { UDExAvatarShape } from "../../dist/Avatar.js";
|
|
4
|
+
import { UDExAvatarSize } from "../../src/Avatar.js";
|
|
5
|
+
import { UDExAdditionalTextState, UDExListStyleType } from "../../src/types/List.js";
|
|
6
|
+
import UDExStatusBadgeValueState from "../../dist/types/StatusBadgeValueState.js";
|
|
3
7
|
|
|
4
8
|
const defaultListItem = <UDExListItem
|
|
5
|
-
id="listItem"
|
|
6
|
-
accessibleName="accessible-name"
|
|
7
|
-
supportingText="Supporting text"
|
|
8
|
-
image="image"
|
|
9
|
-
imageAlt="Person Avatar"
|
|
10
|
-
additionalText="Additional Text"
|
|
11
|
-
additionalTextState=
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
id="listItem"
|
|
10
|
+
accessibleName="accessible-name"
|
|
11
|
+
supportingText="Supporting text"
|
|
12
|
+
image="./stories/list/image.png"
|
|
13
|
+
imageAlt="Person Avatar"
|
|
14
|
+
additionalText="Additional Text"
|
|
15
|
+
additionalTextState={UDExAdditionalTextState.Information}
|
|
16
|
+
imageBadgeState={UDExStatusBadgeValueState.Information}
|
|
17
|
+
imageSize={UDExAvatarSize.M}
|
|
18
|
+
imageShape={UDExAvatarShape.Square}
|
|
19
|
+
type={UDExListStyleType.Circle}>
|
|
20
|
+
Default List Item
|
|
16
21
|
</UDExListItem>
|
|
17
22
|
|
|
18
23
|
const listItemSuccess = <UDExListItem
|
|
19
|
-
id="listItemSuccess"
|
|
20
|
-
accessibleName="accessible-name"
|
|
21
|
-
supportingText="Supporting text"
|
|
22
|
-
image="./stories/list/image.png"
|
|
23
|
-
imageAlt="Person Avatar"
|
|
24
|
-
additionalText="Additional Text"
|
|
25
|
-
additionalTextState=
|
|
26
|
-
imageSize=
|
|
27
|
-
imageShape=
|
|
28
|
-
|
|
24
|
+
id="listItemSuccess"
|
|
25
|
+
accessibleName="accessible-name"
|
|
26
|
+
supportingText="Supporting text"
|
|
27
|
+
image="./stories/list/image.png"
|
|
28
|
+
imageAlt="Person Avatar"
|
|
29
|
+
additionalText="Additional Text"
|
|
30
|
+
additionalTextState={UDExAdditionalTextState.Success}
|
|
31
|
+
imageSize={UDExAvatarSize.M}
|
|
32
|
+
imageShape={UDExAvatarShape.Square}>
|
|
33
|
+
Default List Item
|
|
29
34
|
</UDExListItem>
|
|
30
35
|
|
|
31
36
|
const listItemError = <UDExListItem
|
|
32
|
-
id="listItemError"
|
|
33
|
-
accessibleName="accessible-name"
|
|
34
|
-
supportingText="Supporting text"
|
|
35
|
-
image="./stories/list/image.png"
|
|
36
|
-
imageAlt="Person Avatar"
|
|
37
|
-
additionalText="Additional Text"
|
|
38
|
-
additionalTextState=
|
|
39
|
-
imageSize=
|
|
40
|
-
imageShape=
|
|
41
|
-
|
|
37
|
+
id="listItemError"
|
|
38
|
+
accessibleName="accessible-name"
|
|
39
|
+
supportingText="Supporting text"
|
|
40
|
+
image="./stories/list/image.png"
|
|
41
|
+
imageAlt="Person Avatar"
|
|
42
|
+
additionalText="Additional Text"
|
|
43
|
+
additionalTextState={UDExAdditionalTextState.Error}
|
|
44
|
+
imageSize={UDExAvatarSize.M}
|
|
45
|
+
imageShape={UDExAvatarShape.Square}>
|
|
46
|
+
Default List Item
|
|
42
47
|
</UDExListItem>
|
|
43
48
|
|
|
44
49
|
const listItemWarning = <UDExListItem
|
|
45
|
-
id="listItemWarning"
|
|
46
|
-
accessibleName="accessible-name"
|
|
47
|
-
supportingText="Supporting text"
|
|
48
|
-
image="./stories/list/image.png"
|
|
49
|
-
imageAlt="Person Avatar"
|
|
50
|
-
additionalText="Additional Text"
|
|
51
|
-
additionalTextState=
|
|
52
|
-
imageSize=
|
|
53
|
-
imageShape=
|
|
54
|
-
|
|
50
|
+
id="listItemWarning"
|
|
51
|
+
accessibleName="accessible-name"
|
|
52
|
+
supportingText="Supporting text"
|
|
53
|
+
image="./stories/list/image.png"
|
|
54
|
+
imageAlt="Person Avatar"
|
|
55
|
+
additionalText="Additional Text"
|
|
56
|
+
additionalTextState={UDExAdditionalTextState.Warning}
|
|
57
|
+
imageSize={UDExAvatarSize.M}
|
|
58
|
+
imageShape={UDExAvatarShape.Square}>
|
|
59
|
+
Default List Item
|
|
55
60
|
</UDExListItem>
|
|
56
61
|
|
|
57
62
|
const listItemWithIcons = <UDExListItem
|
|
58
|
-
id="listItemIcons"
|
|
59
|
-
accessible-name="accessible-name"
|
|
60
|
-
supporting-text="Supporting text"
|
|
61
|
-
image="./stories/list/image.png"
|
|
62
|
-
image-alt="Person Avatar"
|
|
63
|
-
additional-text="Additional Text"
|
|
64
|
-
imageSize=
|
|
65
|
-
imageShape=
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
id="listItemIcons"
|
|
64
|
+
accessible-name="accessible-name"
|
|
65
|
+
supporting-text="Supporting text"
|
|
66
|
+
image="./stories/list/image.png"
|
|
67
|
+
image-alt="Person Avatar"
|
|
68
|
+
additional-text="Additional Text"
|
|
69
|
+
imageSize={UDExAvatarSize.M}
|
|
70
|
+
imageShape={UDExAvatarShape.Square}>
|
|
71
|
+
Default List Item
|
|
72
|
+
<UDExButton accessible-name='Action' slot='firstIcon' design='Tertiary' icon='edit' size='Small'></UDExButton>
|
|
73
|
+
<UDExButton accessible-name='Action' slot='secondIcon' design='Tertiary' icon='decline' size='Small'></UDExButton>
|
|
69
74
|
</UDExListItem>
|
|
70
75
|
|
|
71
76
|
describe("ListItem", () => {
|
|
@@ -111,6 +116,15 @@ describe("ListItem", () => {
|
|
|
111
116
|
expect($wrapper.attr("aria-labelledby")).to.eq(`${itemId}-invisibleText`);
|
|
112
117
|
});
|
|
113
118
|
});
|
|
119
|
+
|
|
120
|
+
it("renders status badge", () => {
|
|
121
|
+
cy.get("#listItem").shadow().find("udex-status-badge").should("exist");
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("renders status badge properties", () => {
|
|
125
|
+
cy.get("#listItem").shadow().find("udex-status-badge").should("have.attr", "value-state", UDExStatusBadgeValueState.Information);
|
|
126
|
+
cy.get("#listItem").shadow().find("udex-status-badge").should("have.attr", "size", UDExAvatarSize.M);
|
|
127
|
+
});
|
|
114
128
|
});
|
|
115
129
|
|
|
116
130
|
describe("With Icons", () => {
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { UDExMastheadProfileMenu } from "../support/component-imports.js"
|
|
2
|
+
import { UDExMessageStrip } from "../support/component-imports.js"
|
|
3
|
+
import { UDExLink } from "../support/component-imports.js";
|
|
4
|
+
import { identities, columnsData, userData } from "../fixtures/profile-menu.js";
|
|
5
|
+
import AnalyticsName from "../../src/types/AnalyticsName.js";
|
|
6
|
+
|
|
7
|
+
const profileMenu = <UDExMastheadProfileMenu
|
|
8
|
+
id="profileMenu"
|
|
9
|
+
identities={JSON.stringify(identities)}
|
|
10
|
+
links={JSON.stringify(columnsData)}
|
|
11
|
+
loggedInUser={JSON.stringify(userData)}
|
|
12
|
+
accessible-name="Test accessible name">
|
|
13
|
+
<UDExMessageStrip design="Action" slot="message">
|
|
14
|
+
<span style="vertical-align: middle">Action or Promotion.</span>
|
|
15
|
+
<UDExLink design="Default" href="https://www.sap.com" target="_blank">
|
|
16
|
+
Learn more
|
|
17
|
+
</UDExLink>
|
|
18
|
+
</UDExMessageStrip>
|
|
19
|
+
</UDExMastheadProfileMenu>
|
|
20
|
+
|
|
21
|
+
const simpleProfileMenu = <UDExMastheadProfileMenu
|
|
22
|
+
id="masthead-profile-menu-simple"
|
|
23
|
+
accessible-name="Test accessible name"
|
|
24
|
+
loggedInUser={JSON.stringify(userData)}
|
|
25
|
+
links={JSON.stringify([columnsData[1]])}
|
|
26
|
+
logoutUrl="#">
|
|
27
|
+
</UDExMastheadProfileMenu>
|
|
28
|
+
|
|
29
|
+
describe("Masthead Profile Menu", () => {
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
cy.mount(profileMenu);
|
|
32
|
+
cy.get("[udex-masthead-profile-menu]").shadow().as("profile");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("is correctly rendered", () => {
|
|
36
|
+
cy.get("@profile").find(".udex-masthead-profile-menu").should("be.visible");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("tests if web component renders user avatar", () => {
|
|
40
|
+
cy.get("@profile").find("udex-avatar").should("exist");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("tests if web component renders user name", () => {
|
|
44
|
+
cy.get("@profile").find(".udex-profile-menu__account-name").should("have.text", "John Sánchez");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("tests if web component renders user email", () => {
|
|
48
|
+
cy.get("@profile").find(".udex-profile-menu__account-email").should("have.text", "john.miller@sap.com");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("tests if web component renders message strip", () => {
|
|
52
|
+
cy.get("[udex-masthead-profile-menu]").find("udex-message-strip").should("exist");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("tests if web component renders masthead menu", () => {
|
|
56
|
+
cy.get("@profile").find("udex-masthead-menu").should("exist");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("tests if web component renders logout link", () => {
|
|
60
|
+
cy.mount(simpleProfileMenu);
|
|
61
|
+
cy.get("#masthead-profile-menu-simple").shadow().find(".udex-masthead-profile-menu__actions").should("exist");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("tests if web component renders switch account button", () => {
|
|
65
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").should("exist");
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("tests if identities menu opens when the switch account button is clicked", () => {
|
|
69
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
70
|
+
cy.get("@profile").find("[udex-list]").should("be.visible");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("verifies the correct number of identity list items are rendered", () => {
|
|
74
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
75
|
+
cy.get("@profile").find("udex-list").find("[udex-list-item]").should("have.length", identities.length);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("renders the correct title for the identity switcher list", () => {
|
|
79
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
80
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__switcher-title").should("have.text", "Switch account");
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("renders the back button for the identity", () => {
|
|
84
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
85
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-back").should("exist");
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("navigates back to the profile view after clicking the back button", () => {
|
|
89
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
90
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-back").click();
|
|
91
|
+
cy.get("@profile").find(".udex-profile-menu__account-name").should("have.text", "John Sánchez");
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("renders the back button title for the desktop", () => {
|
|
95
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
96
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-back").should("have.attr", "label", "Back");
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("renders the back button title for the mobile", () => {
|
|
100
|
+
cy.viewport(1024, 640);
|
|
101
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
102
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-back").should("have.attr", "label", "Switch account");
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("tests if event \"ui5-profile-item-click\" emits when clicking on a menu item", () => {
|
|
106
|
+
let eventType;
|
|
107
|
+
let analyticsName;
|
|
108
|
+
let itemLabel
|
|
109
|
+
|
|
110
|
+
cy.get("#profileMenu").then(menu => {
|
|
111
|
+
menu.get(0).addEventListener("ui5-profile-item-click", ({type, detail}: CustomEvent) => {
|
|
112
|
+
eventType = type;
|
|
113
|
+
analyticsName = detail.analyticsName;
|
|
114
|
+
itemLabel = detail.item.label;
|
|
115
|
+
detail.originalEvent.preventDefault();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
cy.get("@profile").find("udex-masthead-menu").shadow().find("udex-masthead-menu-item").eq(0).click().then(() => {
|
|
120
|
+
expect(eventType).to.equal("ui5-profile-item-click");
|
|
121
|
+
expect(analyticsName).to.equal(AnalyticsName.Header);
|
|
122
|
+
expect(itemLabel).to.equal(columnsData[0].category);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it("tests if event \"ui5-logout\" emits when clicking on logout item", () => {
|
|
127
|
+
let eventType;
|
|
128
|
+
cy.mount(simpleProfileMenu);
|
|
129
|
+
cy.get("#masthead-profile-menu-simple").then(menu => {
|
|
130
|
+
menu.get(0).addEventListener("ui5-logout", (e: CustomEvent) => {
|
|
131
|
+
eventType = e.type;
|
|
132
|
+
e.detail.originalEvent.preventDefault();
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
cy.get("#masthead-profile-menu-simple").shadow().find(".udex-masthead-profile-menu__actions").find("udex-masthead-menu-item").eq(0).click().then(() => {
|
|
137
|
+
expect(eventType).to.equal("ui5-logout");
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it("tests if event \"ui5-add-or-remove-account-click\" emits when clicking on add or remove account button", () => {
|
|
142
|
+
let eventType;
|
|
143
|
+
let analyticsName;
|
|
144
|
+
cy.get("#profileMenu").then(menu => {
|
|
145
|
+
menu.get(0).addEventListener("ui5-add-or-remove-account-click", (e: CustomEvent) => {
|
|
146
|
+
eventType = e.type;
|
|
147
|
+
analyticsName = e.detail.analyticsName;
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
152
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__add-remove-btn").click().then(() => {
|
|
153
|
+
expect(eventType).to.equal("ui5-add-or-remove-account-click");
|
|
154
|
+
expect(analyticsName).to.equal(AnalyticsName.Header);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("tests if event \"ui5-identity-item-click\" emits when clicking on identity item", () => {
|
|
159
|
+
let eventType;
|
|
160
|
+
let idsUser;
|
|
161
|
+
cy.get("#profileMenu").then(menu => {
|
|
162
|
+
menu.get(0).addEventListener("ui5-identity-item-click", (e: CustomEvent) => {
|
|
163
|
+
eventType = e.type;
|
|
164
|
+
idsUser = e.detail.item.idsUser;
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
cy.get("@profile").find(".udex-masthead-profile-menu__btn-switcher").click();
|
|
169
|
+
cy.get("@profile").find("udex-list-item").eq(0).click().then(() => {
|
|
170
|
+
expect(eventType).to.equal("ui5-identity-item-click");
|
|
171
|
+
expect(idsUser).to.equal(identities[0].idsUser);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
});
|