@sapudex/web-components 2.32.1 → 2.34.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/cypress/fixtures/masthead-shell.ts +281 -0
- package/cypress/specs/Breadcrumbs.cy.tsx +196 -1
- package/cypress/specs/FilterMenu.cy.tsx +53 -0
- package/cypress/specs/ListItem.cy.tsx +48 -0
- package/cypress/specs/MastheadMenu.cy.tsx +564 -0
- package/cypress/specs/MastheadMobileMenu.cy.tsx +573 -0
- package/cypress/specs/MastheadShell.cy.tsx +645 -0
- package/cypress/specs/SecondaryNavigationDesktop.cy.tsx +289 -95
- package/cypress/specs/SecondaryNavigationMobile.cy.tsx +42 -0
- package/cypress/specs/SelectBox.cy.tsx +63 -0
- package/cypress/specs/TabNavigation.cy.tsx +431 -10
- package/cypress/support/component-imports.instrumented.ts +14 -0
- package/cypress/support/component-imports.src.ts +10 -0
- package/dist/Breadcrumbs.d.ts +12 -0
- package/dist/Breadcrumbs.js +30 -6
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/BreadcrumbsPopoverTemplate.js +10 -1
- package/dist/BreadcrumbsPopoverTemplate.js.map +1 -1
- package/dist/BreadcrumbsTemplate.js +1 -1
- package/dist/BreadcrumbsTemplate.js.map +1 -1
- package/dist/ListItem.d.ts +3 -0
- package/dist/ListItem.js +10 -1
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemBase.d.ts +29 -0
- package/dist/ListItemBase.js +22 -0
- package/dist/ListItemBase.js.map +1 -1
- package/dist/MastheadItem.d.ts +2 -1
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadMenu.d.ts +2 -1
- package/dist/MastheadMenu.js.map +1 -1
- package/dist/SearchableListBase.d.ts +3 -1
- package/dist/SearchableListBase.js +7 -1
- package/dist/SearchableListBase.js.map +1 -1
- package/dist/SecondaryNavigation.d.ts +1 -6
- package/dist/SecondaryNavigation.js +6 -59
- package/dist/SecondaryNavigation.js.map +1 -1
- package/dist/SecondaryNavigationItem.d.ts +5 -12
- package/dist/SecondaryNavigationItem.js +34 -65
- package/dist/SecondaryNavigationItem.js.map +1 -1
- package/dist/SecondaryNavigationItemBase.d.ts +0 -1
- package/dist/SecondaryNavigationItemBase.js +0 -4
- package/dist/SecondaryNavigationItemBase.js.map +1 -1
- package/dist/SelectBase.js +4 -2
- package/dist/SelectBase.js.map +1 -1
- package/dist/Tab.d.ts +19 -0
- package/dist/Tab.js +22 -0
- package/dist/Tab.js.map +1 -1
- package/dist/TabNavigation.d.ts +9 -1
- package/dist/TabNavigation.js +25 -7
- package/dist/TabNavigation.js.map +1 -1
- package/dist/assets/{InputSuggestions-DeXhpK0F.js → InputSuggestions-Bz7HZXUc.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-jMEdrC07.js → ListItemStandardExpandableTextTemplate-CjE7hAvu.js} +1 -1
- package/dist/assets/{bundle-S1uYREqT.css → bundle-JYo3bV8v.css} +1 -1
- package/dist/assets/{bundle.esm-CwJAt93x.js → bundle.esm-mAR7ytdB.js} +217 -217
- package/dist/css/themes/Breadcrumbs.css +1 -1
- package/dist/css/themes/BreadcrumbsPopover.css +1 -1
- package/dist/css/themes/ListItem.css +1 -1
- package/dist/css/themes/MastheadMenu.css +1 -1
- package/dist/css/themes/MastheadMobileMenu.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/css/themes/TabNavigation.css +1 -1
- package/dist/custom-elements-internal.json +1357 -212
- package/dist/custom-elements.json +1342 -197
- package/dist/generated/templates/ListItemTemplate.lit.js +32 -28
- package/dist/generated/templates/ListItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadMenuTemplate.lit.js +8 -1
- package/dist/generated/templates/MastheadMenuTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadMobileMenuTemplate.lit.js +10 -4
- package/dist/generated/templates/MastheadMobileMenuTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SearchableListBaseTemplate.lit.js +3 -3
- package/dist/generated/templates/SearchableListBaseTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.js +4 -4
- package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SecondaryNavigationSubItemTemplate.lit.js +3 -3
- package/dist/generated/templates/SecondaryNavigationSubItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SecondaryNavigationTemplate.lit.js +5 -5
- package/dist/generated/templates/SecondaryNavigationTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SelectBoxTemplate.lit.js +12 -10
- package/dist/generated/templates/SelectBoxTemplate.lit.js.map +1 -1
- package/dist/generated/templates/TabHeaderTemplate.lit.js +40 -24
- package/dist/generated/templates/TabHeaderTemplate.lit.js.map +1 -1
- package/dist/generated/templates/TabNavigationTemplate.lit.js +1 -1
- package/dist/generated/templates/TabNavigationTemplate.lit.js.map +1 -1
- package/dist/generated/themes/Breadcrumbs.css.d.ts +1 -1
- package/dist/generated/themes/Breadcrumbs.css.js +1 -1
- package/dist/generated/themes/Breadcrumbs.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/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/MastheadMenu.css.d.ts +1 -1
- package/dist/generated/themes/MastheadMenu.css.js +1 -1
- package/dist/generated/themes/MastheadMenu.css.js.map +1 -1
- package/dist/generated/themes/MastheadMobileMenu.css.d.ts +1 -1
- package/dist/generated/themes/MastheadMobileMenu.css.js +1 -1
- package/dist/generated/themes/MastheadMobileMenu.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/TabNavigation.css.d.ts +1 -1
- package/dist/generated/themes/TabNavigation.css.js +1 -1
- package/dist/generated/themes/TabNavigation.css.js.map +1 -1
- package/dist/vscode.html-custom-data.json +236 -1
- package/dist/web-types.json +393 -3
- package/package.json +1 -1
- package/src/Breadcrumbs.ts +26 -7
- package/src/BreadcrumbsPopoverTemplate.tsx +53 -41
- package/src/BreadcrumbsTemplate.tsx +35 -21
- package/src/ListItem.hbs +42 -14
- package/src/ListItem.ts +12 -1
- package/src/ListItemBase.ts +40 -0
- package/src/MastheadItem.ts +2 -1
- package/src/MastheadMenu.hbs +35 -0
- package/src/MastheadMenu.ts +2 -1
- package/src/MastheadMobileMenu.hbs +40 -9
- package/src/SearchableListBase.hbs +12 -0
- package/src/SearchableListBase.ts +11 -2
- package/src/SecondaryNavigation.hbs +6 -6
- package/src/SecondaryNavigation.ts +7 -66
- package/src/SecondaryNavigationItem.hbs +4 -6
- package/src/SecondaryNavigationItem.ts +40 -83
- package/src/SecondaryNavigationItemBase.ts +0 -3
- package/src/SecondaryNavigationSubItem.hbs +3 -7
- package/src/SelectBase.ts +4 -2
- package/src/SelectBox.hbs +13 -5
- package/src/Tab.ts +32 -0
- package/src/TabHeader.hbs +40 -19
- package/src/TabNavigation.hbs +5 -9
- package/src/TabNavigation.ts +25 -8
- package/src/generated/templates/ListItemTemplate.lit.ts +32 -28
- package/src/generated/templates/MastheadMenuTemplate.lit.ts +8 -1
- package/src/generated/templates/MastheadMobileMenuTemplate.lit.ts +10 -4
- package/src/generated/templates/SearchableListBaseTemplate.lit.ts +3 -3
- package/src/generated/templates/SecondaryNavigationItemTemplate.lit.ts +4 -4
- package/src/generated/templates/SecondaryNavigationSubItemTemplate.lit.ts +3 -3
- package/src/generated/templates/SecondaryNavigationTemplate.lit.ts +5 -5
- package/src/generated/templates/SelectBoxTemplate.lit.ts +12 -10
- package/src/generated/templates/TabHeaderTemplate.lit.ts +40 -24
- package/src/generated/templates/TabNavigationTemplate.lit.ts +1 -1
- package/src/generated/themes/Breadcrumbs.css.ts +1 -1
- package/src/generated/themes/BreadcrumbsPopover.css.ts +1 -1
- package/src/generated/themes/ListItem.css.ts +1 -1
- package/src/generated/themes/MastheadMenu.css.ts +1 -1
- package/src/generated/themes/MastheadMobileMenu.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/TabNavigation.css.ts +1 -1
- package/src/themes/Breadcrumbs.css +6 -0
- package/src/themes/BreadcrumbsPopover.css +12 -2
- package/src/themes/ListItem.css +12 -5
- package/src/themes/MastheadMenu.css +45 -0
- package/src/themes/MastheadMobileMenu.css +45 -0
- package/src/themes/TabNavigation.css +58 -73
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UDExMastheadShell,
|
|
3
|
+
UDExMastheadItem,
|
|
4
|
+
UDExMastheadMenu,
|
|
5
|
+
UDExMastheadMobileMenu,
|
|
6
|
+
UDExMastheadProfileMenu,
|
|
7
|
+
UDExAvatar,
|
|
8
|
+
UDExSearch,
|
|
9
|
+
} from "../support/component-imports.js";
|
|
10
|
+
import { profileLoggedInUser, profileLinks, subItemsExplore, subItemsProduct } from "../fixtures/masthead-shell.js";
|
|
11
|
+
|
|
12
|
+
const logoUrl = "https://cdn.udex.services.sap.com/dds/design-tokens/assets/logos/sap-logo.svg";
|
|
13
|
+
const homeUrl = "https://sap.com";
|
|
14
|
+
const siteLabelUrl = "https://jobs.sap.com";
|
|
15
|
+
|
|
16
|
+
const defaultMastheadShell = (
|
|
17
|
+
<UDExMastheadShell
|
|
18
|
+
id="mastheadShellDefault"
|
|
19
|
+
site-label-url={siteLabelUrl}
|
|
20
|
+
home-url={homeUrl}
|
|
21
|
+
logo-url={logoUrl}
|
|
22
|
+
site-label="Site Label"
|
|
23
|
+
homepage-aria-label="SAP Homepage"
|
|
24
|
+
site-label-aria-label="SAP Homepage"
|
|
25
|
+
close-button-accessible-name="Close Search"
|
|
26
|
+
mobile-close-button-accessible-name="Close Menu"
|
|
27
|
+
logo-alt="SAP Logo"
|
|
28
|
+
logo-title="SAP Title"
|
|
29
|
+
style="z-index: 11">
|
|
30
|
+
<UDExMastheadItem id="product-item" accessible-name="Products">
|
|
31
|
+
Products
|
|
32
|
+
<UDExMastheadMenu id="product-menu" menu-title="Menu Heading" slot="dropdown" subItems={JSON.stringify(subItemsProduct)}></UDExMastheadMenu>
|
|
33
|
+
</UDExMastheadItem>
|
|
34
|
+
<UDExMastheadItem id="support-item" accessible-name="Support">Support</UDExMastheadItem>
|
|
35
|
+
<UDExMastheadItem id="learning-item" accessible-name="Learning">Learning</UDExMastheadItem>
|
|
36
|
+
<UDExMastheadItem accessible-name="Partners">Partners</UDExMastheadItem>
|
|
37
|
+
<UDExMastheadItem accessible-name="About">About</UDExMastheadItem>
|
|
38
|
+
<UDExSearch id="search" label="Search" mode={"Home Search" as any} slot="search" />
|
|
39
|
+
<UDExMastheadItem accessible-name="Explore SAP" slot="exploreSAP">
|
|
40
|
+
Explore SAP
|
|
41
|
+
<UDExMastheadMenu id="explore-menu" menu-title="Explore all areas of SAP" slot="dropdown" subItems={JSON.stringify(subItemsExplore)}/>
|
|
42
|
+
</UDExMastheadItem>
|
|
43
|
+
<UDExMastheadItem id="joule-item" icon="da" slot="joule" />
|
|
44
|
+
<UDExMastheadItem id="cart-item" icon="cart" slot="cart" />
|
|
45
|
+
<UDExMastheadItem id="support-item-icon" icon="sap-icon://sys-help" accessible-name="Get Help" slot="support">
|
|
46
|
+
<UDExMastheadMenu id="support-menu" slot="dropdown" />
|
|
47
|
+
</UDExMastheadItem>
|
|
48
|
+
<UDExMastheadItem id="profile-item" slot="profile">
|
|
49
|
+
<UDExAvatar size="XS" initials="JS" color-scheme="Neutral" interactive />
|
|
50
|
+
<UDExMastheadProfileMenu id="profile-menu" slot="dropdown" links={JSON.stringify(profileLinks)} loggedInUser={JSON.stringify(profileLoggedInUser)}/>
|
|
51
|
+
</UDExMastheadItem>
|
|
52
|
+
<UDExMastheadMobileMenu slot="mobileMenu">
|
|
53
|
+
<UDExMastheadItem id="product-mobile-item" accessible-name="Products" subItems={JSON.stringify(subItemsProduct)}>Products</UDExMastheadItem>
|
|
54
|
+
<UDExMastheadItem accessible-name="Support" href="https://www.sap.com/services-support.html">Support</UDExMastheadItem>
|
|
55
|
+
<UDExMastheadItem accessible-name="Learning" href="https://www.sap.com/training-certification.html">Learning</UDExMastheadItem>
|
|
56
|
+
</UDExMastheadMobileMenu>
|
|
57
|
+
</UDExMastheadShell>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const mastheadShellWithoutLogo = (
|
|
61
|
+
<UDExMastheadShell
|
|
62
|
+
id="mastheadShellWithoutLogo"
|
|
63
|
+
home-url={homeUrl}
|
|
64
|
+
site-label="Site Label">
|
|
65
|
+
<UDExMastheadItem accessible-name="Products">Products</UDExMastheadItem>
|
|
66
|
+
<UDExMastheadItem accessible-name="Support">Support</UDExMastheadItem>
|
|
67
|
+
<UDExMastheadItem icon="cart" slot="cart" />
|
|
68
|
+
<UDExMastheadItem slot="profile">
|
|
69
|
+
<UDExAvatar size="XS" initials="JS" color-scheme="Neutral" interactive />
|
|
70
|
+
</UDExMastheadItem>
|
|
71
|
+
</UDExMastheadShell>
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const mastheadShellWithoutHomepageLink = (
|
|
75
|
+
<UDExMastheadShell
|
|
76
|
+
id="mastheadShellWithoutHomepageLink"
|
|
77
|
+
open-search-button-accessible-name="Open Search"
|
|
78
|
+
logo-url={logoUrl}
|
|
79
|
+
site-label="Site Label">
|
|
80
|
+
<UDExMastheadItem accessible-name="Products">Products</UDExMastheadItem>
|
|
81
|
+
<UDExMastheadItem accessible-name="Support">Support</UDExMastheadItem>
|
|
82
|
+
<UDExMastheadItem accessible-name="Learning">Learning</UDExMastheadItem>
|
|
83
|
+
<UDExMastheadItem accessible-name="Partners">Partners</UDExMastheadItem>
|
|
84
|
+
<UDExMastheadItem accessible-name="About">About</UDExMastheadItem>
|
|
85
|
+
<UDExMastheadItem slot="profile">
|
|
86
|
+
<UDExAvatar size="XS" initials="JS" color-scheme="Neutral" interactive />
|
|
87
|
+
</UDExMastheadItem>
|
|
88
|
+
</UDExMastheadShell>
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
const mastheadShellWithoutSiteLabel = (
|
|
92
|
+
<UDExMastheadShell
|
|
93
|
+
id="mastheadShellWithoutSiteLabel"
|
|
94
|
+
home-url={homeUrl}
|
|
95
|
+
logo-url={logoUrl}>
|
|
96
|
+
<UDExMastheadItem accessible-name="Products">Products</UDExMastheadItem>
|
|
97
|
+
<UDExMastheadItem accessible-name="Support">Support</UDExMastheadItem>
|
|
98
|
+
<UDExMastheadItem slot="profile">
|
|
99
|
+
<UDExAvatar size="XS" initials="JS" color-scheme="Neutral" interactive />
|
|
100
|
+
</UDExMastheadItem>
|
|
101
|
+
</UDExMastheadShell>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const mastheadShellWithoutSearch = (
|
|
105
|
+
<UDExMastheadShell
|
|
106
|
+
id="mastheadShellWithoutSearch"
|
|
107
|
+
home-url={homeUrl}
|
|
108
|
+
logo-url={logoUrl}
|
|
109
|
+
site-label="Site Label">
|
|
110
|
+
<UDExMastheadItem accessible-name="Products">Products</UDExMastheadItem>
|
|
111
|
+
<UDExMastheadItem accessible-name="Support">Support</UDExMastheadItem>
|
|
112
|
+
<UDExMastheadItem icon="cart" slot="cart" />
|
|
113
|
+
<UDExMastheadItem slot="profile">
|
|
114
|
+
<UDExAvatar size="XS" initials="JS" color-scheme="Neutral" interactive />
|
|
115
|
+
</UDExMastheadItem>
|
|
116
|
+
</UDExMastheadShell>
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const mastheadShellMApproach = (
|
|
120
|
+
<UDExMastheadShell
|
|
121
|
+
id="mastheadShellMApproach"
|
|
122
|
+
site-label-url={siteLabelUrl}
|
|
123
|
+
home-url={homeUrl}
|
|
124
|
+
logo-url={logoUrl}
|
|
125
|
+
site-label="Site Label"
|
|
126
|
+
homepage-aria-label="SAP Homepage"
|
|
127
|
+
site-label-aria-label="SAP Homepage"
|
|
128
|
+
close-button-accessible-name="Close Search"
|
|
129
|
+
logo-alt="SAP Logo"
|
|
130
|
+
logo-title="SAP Title"
|
|
131
|
+
style="z-index: 11">
|
|
132
|
+
<UDExMastheadItem id="product-item" accessible-name="Products">Products list</UDExMastheadItem>
|
|
133
|
+
<UDExMastheadItem accessible-name="Support">Support team</UDExMastheadItem>
|
|
134
|
+
<UDExMastheadItem accessible-name="Learning">Learning portal</UDExMastheadItem>
|
|
135
|
+
<UDExMastheadItem accessible-name="Partners">Partners portal</UDExMastheadItem>
|
|
136
|
+
<UDExMastheadItem accessible-name="About">About us</UDExMastheadItem>
|
|
137
|
+
<UDExMastheadItem accessible-name="Community">Community team</UDExMastheadItem>
|
|
138
|
+
<UDExMastheadItem accessible-name="Industries">Industries</UDExMastheadItem>
|
|
139
|
+
<UDExMastheadItem accessible-name="SAP Business">SAP Business</UDExMastheadItem>
|
|
140
|
+
<UDExMastheadItem accessible-name="AI capabilities">AI capabilities</UDExMastheadItem>
|
|
141
|
+
<UDExMastheadItem accessible-name="Learning extra">Learning extra</UDExMastheadItem>
|
|
142
|
+
<UDExMastheadItem accessible-name="Partner Programs">Partner Programs</UDExMastheadItem>
|
|
143
|
+
<UDExMastheadItem accessible-name="About">About us</UDExMastheadItem>
|
|
144
|
+
<UDExMastheadItem accessible-name="Community">Community team</UDExMastheadItem>
|
|
145
|
+
<UDExMastheadItem accessible-name="Industries">Industries</UDExMastheadItem>
|
|
146
|
+
<UDExMastheadItem accessible-name="SAP Business">SAP Business</UDExMastheadItem>
|
|
147
|
+
<UDExMastheadItem accessible-name="AI capabilities">AI capabilities</UDExMastheadItem>
|
|
148
|
+
<UDExSearch id="search-m" label="Search" mode={"Home Search" as any} slot="search" />
|
|
149
|
+
<UDExMastheadItem accessible-name="Explore SAP" slot="exploreSAP">
|
|
150
|
+
Explore SAP
|
|
151
|
+
<UDExMastheadMenu id="explore-menu" menu-title="Explore all areas of SAP" slot="dropdown" />
|
|
152
|
+
</UDExMastheadItem>
|
|
153
|
+
<UDExMastheadItem id="cart-item" icon="cart" slot="cart" />
|
|
154
|
+
<UDExMastheadItem id="profile-item" slot="profile">
|
|
155
|
+
<UDExAvatar size="XS" initials="JS" color-scheme="Neutral" interactive />
|
|
156
|
+
<UDExMastheadProfileMenu
|
|
157
|
+
id="profile-menu"
|
|
158
|
+
slot="dropdown">
|
|
159
|
+
</UDExMastheadProfileMenu>
|
|
160
|
+
</UDExMastheadItem>
|
|
161
|
+
<UDExMastheadMobileMenu slot="mobileMenu">
|
|
162
|
+
<UDExMastheadItem id="product-mobile-item" accessible-name="Products">Products</UDExMastheadItem>
|
|
163
|
+
<UDExMastheadItem accessible-name="Support" href="https://www.sap.com/services-support.html">Support</UDExMastheadItem>
|
|
164
|
+
<UDExMastheadItem accessible-name="Learning" href="https://www.sap.com/services-support.html">Learning</UDExMastheadItem>
|
|
165
|
+
</UDExMastheadMobileMenu>
|
|
166
|
+
</UDExMastheadShell>
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const mastheadShellSearchDefault = (
|
|
170
|
+
<UDExMastheadShell
|
|
171
|
+
id="mastheadShellSearchDefault"
|
|
172
|
+
show-search-by-default
|
|
173
|
+
site-label-url={siteLabelUrl}
|
|
174
|
+
home-url={homeUrl}
|
|
175
|
+
logo-url={logoUrl}
|
|
176
|
+
site-label="Site Label"
|
|
177
|
+
homepage-aria-label="SAP Homepage"
|
|
178
|
+
site-label-aria-label="SAP Homepage"
|
|
179
|
+
close-button-accessible-name="Close Search"
|
|
180
|
+
logo-alt="SAP Logo"
|
|
181
|
+
logo-title="SAP Title"
|
|
182
|
+
style="z-index: 11">
|
|
183
|
+
<UDExMastheadItem accessible-name="Products">
|
|
184
|
+
Products
|
|
185
|
+
<UDExMastheadMenu menu-title="Menu Heading" slot="dropdown" />
|
|
186
|
+
</UDExMastheadItem>
|
|
187
|
+
<UDExMastheadItem accessible-name="Support">Support</UDExMastheadItem>
|
|
188
|
+
<UDExMastheadItem accessible-name="Learning">Learning</UDExMastheadItem>
|
|
189
|
+
<UDExMastheadItem accessible-name="Partners">Partners</UDExMastheadItem>
|
|
190
|
+
<UDExMastheadItem accessible-name="About">About</UDExMastheadItem>
|
|
191
|
+
<UDExSearch id="search-sd" label="Search" mode={"Home Search" as any} slot="search" />
|
|
192
|
+
<UDExMastheadItem accessible-name="Explore SAP" slot="exploreSAP">
|
|
193
|
+
Explore SAP
|
|
194
|
+
<UDExMastheadMenu menu-title="Explore all areas of SAP" slot="dropdown" />
|
|
195
|
+
</UDExMastheadItem>
|
|
196
|
+
<UDExMastheadItem icon="cart" slot="cart" />
|
|
197
|
+
<UDExMastheadItem slot="profile">
|
|
198
|
+
<UDExAvatar size="XS" initials="JS" color-scheme="Neutral" interactive />
|
|
199
|
+
</UDExMastheadItem>
|
|
200
|
+
</UDExMastheadShell>
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
describe("MastheadShell Default component", () => {
|
|
204
|
+
describe('"XL-L" screen sizes (1920x1080)', () => {
|
|
205
|
+
beforeEach(() => {
|
|
206
|
+
cy.viewport(1920, 1080);
|
|
207
|
+
cy.mount(defaultMastheadShell);
|
|
208
|
+
cy.get("#mastheadShellDefault").shadow().as("shell");
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("is correctly rendered", () => {
|
|
212
|
+
cy.get("@shell").find("header.udex-masthead-shell").should("exist");
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it("logo is rendered", () => {
|
|
216
|
+
cy.get("@shell").find(".udex-masthead-shell__logo").should("be.visible");
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it("logo is not rendered when logo-url property is not set", () => {
|
|
220
|
+
cy.mount(mastheadShellWithoutLogo);
|
|
221
|
+
cy.get("#mastheadShellWithoutLogo").shadow().find(".udex-masthead-shell__logo").should("not.exist");
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("logo is not a link when home-url property is not set", () => {
|
|
225
|
+
cy.mount(mastheadShellWithoutHomepageLink);
|
|
226
|
+
cy.get("#mastheadShellWithoutHomepageLink").shadow().find(".udex-masthead-shell__logo--link").should("not.exist");
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it("logo is a link with correct href and target when home-url is set", () => {
|
|
230
|
+
cy.get("@shell").find(".udex-masthead-shell__logo--link")
|
|
231
|
+
.should("be.visible")
|
|
232
|
+
.and("have.attr", "href", "https://sap.com")
|
|
233
|
+
.and("have.attr", "target", "_self");
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it("logo image src is correctly set", () => {
|
|
237
|
+
cy.get("@shell").find(".udex-masthead-shell__logo img")
|
|
238
|
+
.should("have.attr", "src", logoUrl);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it("site label text is 'Site Label'", () => {
|
|
242
|
+
cy.get("@shell").find(".udex-masthead-shell__site-label")
|
|
243
|
+
.should("have.text", "Site Label");
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it("site label is not displayed when site-label property is not set", () => {
|
|
247
|
+
cy.mount(mastheadShellWithoutSiteLabel);
|
|
248
|
+
cy.get("#mastheadShellWithoutSiteLabel").shadow().find(".udex-masthead-shell__site-label").should("not.exist");
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it("site label is a link with href='https://jobs.sap.com' when site-label-url is set", () => {
|
|
252
|
+
cy.get("@shell").find(".udex-masthead-shell__site-label--link")
|
|
253
|
+
.should("be.visible")
|
|
254
|
+
.and("have.attr", "href", "https://jobs.sap.com");
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it("site label is not a link when home-url is not set", () => {
|
|
258
|
+
cy.mount(mastheadShellWithoutHomepageLink);
|
|
259
|
+
cy.get("#mastheadShellWithoutHomepageLink").shadow().find(".udex-masthead-shell__site-label--link").should("not.exist");
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it("main menu renders 5 items", () => {
|
|
263
|
+
cy.get("@shell").find(".udex-masthead-shell__main-menu .udex-masthead-shell__item")
|
|
264
|
+
.should("have.length", 5);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it("'Explore SAP' item slot is rendered", () => {
|
|
268
|
+
cy.get("@shell").find(".udex-masthead-shell__explore slot[name='exploreSAP']").should("exist");
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it("search icon item is displayed", () => {
|
|
272
|
+
cy.get("@shell").find(".udex-masthead-shell__search-icon").should("be.visible");
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
it("open search icon has default accessible name 'Search'", () => {
|
|
276
|
+
cy.get("@shell").find(".udex-masthead-shell__search-btn")
|
|
277
|
+
.should("have.attr", "accessible-name", "Search");
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it("open search icon has custom accessible name when openSearchButtonAccessibleName is set to 'Open Search'", () => {
|
|
281
|
+
cy.get("#mastheadShellDefault").invoke("attr", "open-search-button-accessible-name", "Open Search");
|
|
282
|
+
cy.get("@shell").find(".udex-masthead-shell__search-btn")
|
|
283
|
+
.should("have.attr", "accessible-name", "Open Search");
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it("search icon is not displayed when search slot is empty", () => {
|
|
287
|
+
cy.mount(mastheadShellWithoutSearch);
|
|
288
|
+
cy.get("#mastheadShellWithoutSearch").shadow().find(".udex-masthead-shell__search-icon").should("not.exist");
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it("exploreSAP slot is rendered", () => {
|
|
292
|
+
cy.get("@shell").find('slot[name="exploreSAP"]').should("exist");
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it("profile slot is rendered", () => {
|
|
296
|
+
cy.get("@shell").find('slot[name="profile"]').should("exist");
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
it("mobileMenu slot is rendered", () => {
|
|
300
|
+
cy.get("@shell").find('slot[name="mobileMenu"]').should("exist");
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it("cart slot is rendered", () => {
|
|
304
|
+
cy.get("@shell").find('slot[name="cart"]').should("exist");
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it("joule slot is rendered", () => {
|
|
308
|
+
cy.get("@shell").find('slot[name="joule"]').should("exist");
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
it("clicking an item with a dropdown shows the sub-menu", () => {
|
|
312
|
+
cy.get("#product-item").realClick();
|
|
313
|
+
cy.get("#product-item").shadow().find(".udex-masthead-item__dropdown").should("be.visible");
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it("logo title attribute is 'SAP Title'", () => {
|
|
317
|
+
cy.get("@shell").find(".udex-masthead-shell__logo")
|
|
318
|
+
.should("have.attr", "title", "SAP Title");
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it("clicking search icon shows the search container", () => {
|
|
322
|
+
cy.get("@shell").find(".udex-masthead-shell__search-icon").click();
|
|
323
|
+
cy.get("@shell").find(".udex-masthead-shell__search-container").should("be.visible");
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it("main menu is hidden while search container is open", () => {
|
|
327
|
+
cy.get("@shell").find(".udex-masthead-shell__search-icon").click();
|
|
328
|
+
cy.get("@shell").find(".udex-masthead-shell__main-menu").should("not.exist");
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
it("clicking the close icon hides the search container", () => {
|
|
332
|
+
cy.get("@shell").find(".udex-masthead-shell__search-icon").click();
|
|
333
|
+
cy.get("@shell").find("udex-control-button").click();
|
|
334
|
+
cy.get("@shell").find(".udex-masthead-shell__search-container").should("not.exist");
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it("main menu is visible again after the search container is closed", () => {
|
|
338
|
+
cy.get("@shell").find(".udex-masthead-shell__search-icon").click();
|
|
339
|
+
cy.get("@shell").find("udex-control-button").click();
|
|
340
|
+
cy.get("@shell").find(".udex-masthead-shell__main-menu").should("be.visible");
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
describe('"S-XS" screen sizes (970x1080)', () => {
|
|
345
|
+
beforeEach(() => {
|
|
346
|
+
cy.viewport(970, 1080);
|
|
347
|
+
cy.mount(defaultMastheadShell);
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
it("logo is hidden when mobile menu opener is clicked", () => {
|
|
351
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__menu-btn").click();
|
|
352
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__logo").should("not.be.visible");
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
it("accessible name for mobile close button is 'Close Menu'", () => {
|
|
356
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__menu-btn").click();
|
|
357
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__close-btn")
|
|
358
|
+
.should("have.attr", "accessible-name", "Close Menu");
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
describe("Accessibility", () => {
|
|
363
|
+
beforeEach(() => {
|
|
364
|
+
cy.viewport(1920, 1080);
|
|
365
|
+
cy.mount(defaultMastheadShell);
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it("dropdown closes after pressing Escape key inside dropdown", () => {
|
|
369
|
+
cy.get("#product-item").realClick();
|
|
370
|
+
cy.get("#product-item").shadow().find(".udex-masthead-item__dropdown").should("be.visible");
|
|
371
|
+
cy.realPress("Escape");
|
|
372
|
+
cy.get("#product-item").shadow().find(".udex-masthead-item__dropdown").should("not.exist");
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
it("focus returns to the item after pressing Escape inside dropdown", () => {
|
|
376
|
+
cy.get("#product-item").realClick();
|
|
377
|
+
cy.get("#product-item").shadow().find(".udex-masthead-item__dropdown").should("be.visible");
|
|
378
|
+
cy.realPress("Escape");
|
|
379
|
+
cy.get("#product-item").should("be.focused");
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
it("dropdown opens after clicking item (Enter-equivalent activation)", () => {
|
|
383
|
+
cy.get("#product-item").realClick();
|
|
384
|
+
cy.get("#product-item").shadow().find(".udex-masthead-item__dropdown").should("be.visible");
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
it("aria-label for homepage link is 'SAP Homepage'", () => {
|
|
388
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__site-label--link")
|
|
389
|
+
.should("have.attr", "aria-label", "SAP Homepage");
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
it("accessible-name for search close button is 'Close Search'", () => {
|
|
393
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__search-icon").click();
|
|
394
|
+
cy.get("#mastheadShellDefault").shadow().find("udex-control-button")
|
|
395
|
+
.should("have.attr", "accessible-name", "Close Search");
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
it("alt attribute for logo image is 'SAP Logo'", () => {
|
|
399
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__logo img")
|
|
400
|
+
.should("have.attr", "alt", "SAP Logo");
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
it("Tab/Shift+Tab keyboard navigation on main menu items", () => {
|
|
404
|
+
cy.get("#support-item").realClick();
|
|
405
|
+
cy.realPress("Tab");
|
|
406
|
+
cy.get("#learning-item").should("be.focused");
|
|
407
|
+
cy.realPress(["Shift", "Tab"]);
|
|
408
|
+
cy.get("#support-item").should("be.focused");
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
describe("Component events", () => {
|
|
413
|
+
beforeEach(() => {
|
|
414
|
+
cy.viewport(1920, 1080);
|
|
415
|
+
cy.mount(defaultMastheadShell);
|
|
416
|
+
|
|
417
|
+
cy.document().then(doc => {
|
|
418
|
+
doc.addEventListener("click", (e: MouseEvent) => {
|
|
419
|
+
const anchor = e.composedPath().find((el) => (el as HTMLElement).tagName === "A");
|
|
420
|
+
if (anchor) {
|
|
421
|
+
e.preventDefault();
|
|
422
|
+
}
|
|
423
|
+
}, { capture: true });
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
cy.document().then(doc => {
|
|
427
|
+
["eventComp", "eventSearchOpenClose"].forEach(id => {
|
|
428
|
+
if (!doc.getElementById(id)) {
|
|
429
|
+
const div = doc.createElement("div");
|
|
430
|
+
div.id = id;
|
|
431
|
+
doc.body.appendChild(div);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
cy.get("#mastheadShellDefault").then($el => {
|
|
437
|
+
const shell = $el[0];
|
|
438
|
+
|
|
439
|
+
const capture = (id: string) => (e: Event) => {
|
|
440
|
+
const el = document.getElementById(id);
|
|
441
|
+
if (el) el.innerText = e.type;
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
const trackMain = capture("eventComp");
|
|
445
|
+
const trackOpenClose = capture("eventSearchOpenClose");
|
|
446
|
+
|
|
447
|
+
[
|
|
448
|
+
"ui5-search-click",
|
|
449
|
+
"ui5-support-click",
|
|
450
|
+
"ui5-search-close-click",
|
|
451
|
+
"ui5-cart-click",
|
|
452
|
+
"ui5-joule-click",
|
|
453
|
+
"ui5-profile-click",
|
|
454
|
+
"ui5-logo-click",
|
|
455
|
+
"ui5-site-label-click",
|
|
456
|
+
"ui5-mobile-menu-open",
|
|
457
|
+
"ui5-mobile-menu-close",
|
|
458
|
+
].forEach(name => shell.addEventListener(name, trackMain));
|
|
459
|
+
|
|
460
|
+
["ui5-search-opened", "ui5-search-closed"]
|
|
461
|
+
.forEach(name => shell.addEventListener(name, trackOpenClose));
|
|
462
|
+
});
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
afterEach(() => {
|
|
466
|
+
cy.document().then(doc => {
|
|
467
|
+
doc.getElementById("eventComp")?.remove();
|
|
468
|
+
doc.getElementById("eventSearchOpenClose")?.remove();
|
|
469
|
+
});
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
it("'ui5-cart-click' emits when clicking cart item", () => {
|
|
473
|
+
cy.get("#cart-item").click();
|
|
474
|
+
cy.get("#eventComp").should("have.text", "ui5-cart-click");
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
it("'ui5-joule-click' emits when clicking joule item", () => {
|
|
478
|
+
cy.get("#joule-item").click();
|
|
479
|
+
cy.get("#eventComp").should("have.text", "ui5-joule-click");
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
it("'ui5-support-click' emits when clicking support item", () => {
|
|
483
|
+
cy.get("#support-item-icon").click();
|
|
484
|
+
cy.get("#eventComp").should("have.text", "ui5-support-click");
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
it("'ui5-search-click' and 'ui5-search-opened' emit when clicking the search button", () => {
|
|
488
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__search-btn").click();
|
|
489
|
+
cy.get("#eventComp").should("have.text", "ui5-search-click");
|
|
490
|
+
cy.get("#eventSearchOpenClose").should("have.text", "ui5-search-opened");
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
it("'ui5-search-close-click' and 'ui5-search-closed' emit when clicking the close search button", () => {
|
|
494
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__search-icon").click();
|
|
495
|
+
cy.get("#mastheadShellDefault").shadow().find("udex-control-button").click();
|
|
496
|
+
cy.get("#eventComp").should("have.text", "ui5-search-close-click");
|
|
497
|
+
cy.get("#eventSearchOpenClose").should("have.text", "ui5-search-closed");
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
it("'ui5-profile-click' emits when clicking profile item", () => {
|
|
501
|
+
cy.get("#profile-item").click();
|
|
502
|
+
cy.get("#eventComp").should("have.text", "ui5-profile-click");
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
it("'ui5-logo-click' emits when clicking the logo", () => {
|
|
506
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__logo").click();
|
|
507
|
+
cy.get("#eventComp").should("have.text", "ui5-logo-click");
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
it("'ui5-site-label-click' emits when clicking the site label", () => {
|
|
511
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__site-label").click();
|
|
512
|
+
cy.get("#eventComp").should("have.text", "ui5-site-label-click");
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
it("'ui5-mobile-menu-open' emits at 970x1080 when clicking the mobile menu open button", () => {
|
|
516
|
+
cy.viewport(970, 1080);
|
|
517
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__menu-btn").click();
|
|
518
|
+
cy.get("#eventComp").should("have.text", "ui5-mobile-menu-open");
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
it("'ui5-mobile-menu-close' emits at 970x1080 when clicking the mobile menu close button", () => {
|
|
522
|
+
cy.viewport(970, 1080);
|
|
523
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__menu-btn").click();
|
|
524
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__close-btn").click();
|
|
525
|
+
cy.get("#eventComp").should("have.text", "ui5-mobile-menu-close");
|
|
526
|
+
});
|
|
527
|
+
});
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
describe("MastheadShell mobile mode", () => {
|
|
531
|
+
describe("desktop mode — items fit in available width", () => {
|
|
532
|
+
beforeEach(() => {
|
|
533
|
+
cy.viewport(1920, 1080);
|
|
534
|
+
cy.mount(defaultMastheadShell);
|
|
535
|
+
cy.wait(500);
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
it("does not set _is-mobile-mode when 5 items fit at 1920px", () => {
|
|
539
|
+
cy.get("#mastheadShellDefault").should("not.have.attr", "_is-mobile-mode");
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
it("hamburger menu button is not visible when items fit", () => {
|
|
543
|
+
cy.get("#mastheadShellDefault").shadow().find(".udex-masthead-shell__menu-btn")
|
|
544
|
+
.should("not.be.visible");
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
it("main menu items are visible when items fit", () => {
|
|
548
|
+
cy.get("#mastheadShellDefault").shadow()
|
|
549
|
+
.find(".udex-masthead-shell__main-menu .udex-masthead-shell__item")
|
|
550
|
+
.should("be.visible");
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
it("component is visible (opacity 1) after handleMobileMode runs", () => {
|
|
554
|
+
cy.get("#mastheadShellDefault").should("have.css", "opacity", "1");
|
|
555
|
+
});
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
describe("mobile mode — items overflow available width", () => {
|
|
559
|
+
it("component is visible (opacity 1) after handleMobileMode runs", () => {
|
|
560
|
+
cy.viewport(1920, 1080);
|
|
561
|
+
cy.mount(mastheadShellMApproach);
|
|
562
|
+
cy.wait(1000);
|
|
563
|
+
cy.get("#mastheadShellMApproach").should("have.css", "opacity", "1");
|
|
564
|
+
});
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
describe("transition — mobile mode removed when viewport is widened", () => {
|
|
568
|
+
it("removes _is-mobile-mode when viewport grows to fit items", () => {
|
|
569
|
+
cy.viewport(400, 1080);
|
|
570
|
+
cy.mount(defaultMastheadShell);
|
|
571
|
+
cy.wait(500);
|
|
572
|
+
cy.viewport(1920, 1080);
|
|
573
|
+
cy.wait(500);
|
|
574
|
+
cy.get("#mastheadShellDefault").should("not.have.attr", "_is-mobile-mode");
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
it("hamburger button is hidden after resizing back to desktop width", () => {
|
|
578
|
+
cy.viewport(400, 1080);
|
|
579
|
+
cy.mount(defaultMastheadShell);
|
|
580
|
+
cy.wait(500);
|
|
581
|
+
cy.viewport(1920, 1080);
|
|
582
|
+
cy.wait(500);
|
|
583
|
+
cy.get("#mastheadShellDefault").shadow()
|
|
584
|
+
.find(".udex-masthead-shell__menu-btn")
|
|
585
|
+
.should("not.be.visible");
|
|
586
|
+
});
|
|
587
|
+
});
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
describe("MastheadShell Search-Focused", () => {
|
|
591
|
+
describe('"XL-M" screen sizes (1920x1080) — search open by default', () => {
|
|
592
|
+
beforeEach(() => {
|
|
593
|
+
cy.viewport(1920, 1080);
|
|
594
|
+
cy.mount(mastheadShellSearchDefault);
|
|
595
|
+
cy.get("#mastheadShellSearchDefault").shadow().as("shell");
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
it("search container is displayed by default", () => {
|
|
599
|
+
cy.get("@shell").find(".udex-masthead-shell__search-container").should("be.visible");
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
it("search open button is not visible when search is shown by default", () => {
|
|
603
|
+
cy.get("@shell").find(".udex-masthead-shell__search-btn").should("not.be.visible");
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
it("main navigation is not visible when search is shown by default", () => {
|
|
607
|
+
cy.get("@shell").find(".udex-masthead-shell__main-menu").should("not.exist");
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
describe('"S" screen sizes (970x1080)', () => {
|
|
612
|
+
beforeEach(() => {
|
|
613
|
+
cy.viewport(970, 1080);
|
|
614
|
+
cy.mount(mastheadShellSearchDefault);
|
|
615
|
+
cy.get("#mastheadShellSearchDefault").shadow().as("shell");
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
it("search is not visible at small viewport", () => {
|
|
619
|
+
cy.get("@shell").find(".udex-masthead-shell__search-container").should("not.be.visible");
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
it("search open button is visible at small viewport", () => {
|
|
623
|
+
cy.get("@shell").find(".udex-masthead-shell__search-btn").should("be.visible");
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
it("search is visible after clicking the search open button", () => {
|
|
627
|
+
cy.get("@shell").find(".udex-masthead-shell__search-btn").click();
|
|
628
|
+
cy.get("@shell").find(".udex-masthead-shell__search-container").should("be.visible");
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
it("logo is visible after clicking the search open button", () => {
|
|
632
|
+
cy.get("@shell").find(".udex-masthead-shell__search-btn").click();
|
|
633
|
+
cy.get("@shell").find(".udex-masthead-shell__logo").should("be.visible");
|
|
634
|
+
});
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
describe('"XS" screen sizes (630x1080)', () => {
|
|
638
|
+
it("logo is not visible after clicking the search open button at XS viewport", () => {
|
|
639
|
+
cy.viewport(630, 1080);
|
|
640
|
+
cy.mount(mastheadShellSearchDefault);
|
|
641
|
+
cy.get("#mastheadShellSearchDefault").shadow().find(".udex-masthead-shell__search-btn").click();
|
|
642
|
+
cy.get("#mastheadShellSearchDefault").shadow().find(".udex-masthead-shell__logo").should("not.be.visible");
|
|
643
|
+
});
|
|
644
|
+
});
|
|
645
|
+
});
|