@sapudex/web-components 2.33.0 → 2.35.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/specs/FilterMenu.cy.tsx +53 -0
- package/cypress/specs/ListItem.cy.tsx +73 -21
- package/cypress/specs/MastheadMenu.cy.tsx +645 -0
- package/cypress/specs/MastheadMobileMenu.cy.tsx +573 -0
- package/cypress/specs/MastheadShell.cy.tsx +79 -0
- package/cypress/specs/SecondaryNavigationDesktop.cy.tsx +14 -0
- package/cypress/specs/SelectBox.cy.tsx +229 -1
- package/cypress/support/component-imports.instrumented.ts +2 -0
- package/cypress/support/component-imports.src.ts +2 -0
- package/dist/CountrySelector.d.ts +1 -0
- package/dist/CountrySelector.js +3 -0
- package/dist/CountrySelector.js.map +1 -1
- package/dist/FilterMenu.d.ts +1 -0
- package/dist/FilterMenu.js +3 -0
- package/dist/FilterMenu.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 +31 -0
- package/dist/ListItemBase.js +28 -0
- package/dist/ListItemBase.js.map +1 -1
- package/dist/MastheadItem.d.ts +12 -1
- package/dist/MastheadItem.js +33 -1
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadMenu.d.ts +5 -1
- package/dist/MastheadMenu.js +16 -6
- 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/SecondaryNavigationItem.d.ts +5 -1
- package/dist/SecondaryNavigationItem.js +35 -5
- package/dist/SecondaryNavigationItem.js.map +1 -1
- package/dist/SelectBase.js +14 -3
- package/dist/SelectBase.js.map +1 -1
- package/dist/SelectBox.d.ts +1 -0
- package/dist/SelectBox.js +3 -0
- package/dist/SelectBox.js.map +1 -1
- package/dist/assets/{InputSuggestions-B_Dl2L6w.js → InputSuggestions-CrSNIz-l.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-9Z-aZmJx.js → ListItemStandardExpandableTextTemplate-BUgxFxi7.js} +1 -1
- package/dist/assets/{bundle-DbTEs-Za.css → bundle-JYo3bV8v.css} +1 -1
- package/dist/assets/{bundle.esm-BlIxH9k1.js → bundle.esm-BZJm6rNI.js} +633 -219
- package/dist/css/themes/Breadcrumbs.css +1 -1
- package/dist/css/themes/BreadcrumbsPopover.css +1 -1
- package/dist/css/themes/FilterMenu.css +1 -1
- package/dist/css/themes/ListGroupHeader.css +1 -1
- package/dist/css/themes/ListItem.css +1 -1
- package/dist/css/themes/MastheadItem.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/SearchableList.css +1 -1
- package/dist/css/themes/SecondaryNavigation.css +1 -1
- package/dist/css/themes/SecondaryNavigationItem.css +1 -1
- package/dist/css/themes/SelectBase.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/custom-elements-internal.json +1125 -35
- package/dist/custom-elements.json +1126 -36
- package/dist/generated/templates/ListGroupHeaderTemplate.lit.js +16 -12
- package/dist/generated/templates/ListGroupHeaderTemplate.lit.js.map +1 -1
- package/dist/generated/templates/ListItemTemplate.lit.js +40 -32
- package/dist/generated/templates/ListItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadItemTemplate.lit.js +2 -2
- package/dist/generated/templates/MastheadItemTemplate.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/MastheadShellTemplate.lit.js +3 -3
- package/dist/generated/templates/MastheadShellTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SearchableListBaseTemplate.lit.js +4 -4
- package/dist/generated/templates/SearchableListBaseTemplate.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/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/FilterMenu.css.d.ts +1 -1
- package/dist/generated/themes/FilterMenu.css.js +1 -1
- package/dist/generated/themes/FilterMenu.css.js.map +1 -1
- package/dist/generated/themes/ListGroupHeader.css.d.ts +1 -1
- package/dist/generated/themes/ListGroupHeader.css.js +1 -1
- package/dist/generated/themes/ListGroupHeader.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/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/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/SearchableList.css.d.ts +1 -1
- package/dist/generated/themes/SearchableList.css.js +1 -1
- package/dist/generated/themes/SearchableList.css.js.map +1 -1
- package/dist/generated/themes/SecondaryNavigation.css.d.ts +1 -1
- package/dist/generated/themes/SecondaryNavigation.css.js +1 -1
- package/dist/generated/themes/SecondaryNavigation.css.js.map +1 -1
- package/dist/generated/themes/SecondaryNavigationItem.css.d.ts +1 -1
- package/dist/generated/themes/SecondaryNavigationItem.css.js +1 -1
- package/dist/generated/themes/SecondaryNavigationItem.css.js.map +1 -1
- package/dist/generated/themes/SelectBase.css.d.ts +1 -1
- package/dist/generated/themes/SelectBase.css.js +1 -1
- package/dist/generated/themes/SelectBase.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/types/List.d.ts +2 -0
- package/dist/types/List.js +2 -0
- package/dist/types/List.js.map +1 -1
- package/dist/vscode.html-custom-data.json +292 -12
- package/dist/web-types.json +431 -21
- package/package.json +1 -1
- package/src/CountrySelector.ts +3 -0
- package/src/FilterMenu.ts +3 -0
- package/src/ListGroupHeader.hbs +11 -7
- package/src/ListItem.hbs +28 -2
- package/src/ListItem.ts +12 -1
- package/src/ListItemBase.ts +48 -0
- package/src/MastheadItem.hbs +2 -0
- package/src/MastheadItem.ts +37 -2
- package/src/MastheadMenu.hbs +35 -0
- package/src/MastheadMenu.ts +21 -7
- package/src/MastheadMobileMenu.hbs +40 -9
- package/src/MastheadShell.hbs +3 -0
- package/src/SearchableListBase.hbs +21 -1
- package/src/SearchableListBase.ts +11 -2
- package/src/SecondaryNavigationItem.ts +37 -5
- package/src/SelectBase.ts +15 -3
- package/src/SelectBox.hbs +13 -5
- package/src/SelectBox.ts +3 -0
- package/src/generated/templates/ListGroupHeaderTemplate.lit.ts +16 -12
- package/src/generated/templates/ListItemTemplate.lit.ts +40 -32
- package/src/generated/templates/MastheadItemTemplate.lit.ts +2 -2
- package/src/generated/templates/MastheadMenuTemplate.lit.ts +8 -1
- package/src/generated/templates/MastheadMobileMenuTemplate.lit.ts +10 -4
- package/src/generated/templates/MastheadShellTemplate.lit.ts +3 -3
- package/src/generated/templates/SearchableListBaseTemplate.lit.ts +4 -4
- package/src/generated/templates/SelectBoxTemplate.lit.ts +12 -10
- package/src/generated/themes/Breadcrumbs.css.ts +1 -1
- package/src/generated/themes/BreadcrumbsPopover.css.ts +1 -1
- package/src/generated/themes/FilterMenu.css.ts +1 -1
- package/src/generated/themes/ListGroupHeader.css.ts +1 -1
- package/src/generated/themes/ListItem.css.ts +1 -1
- package/src/generated/themes/MastheadItem.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/SearchableList.css.ts +1 -1
- package/src/generated/themes/SecondaryNavigation.css.ts +1 -1
- package/src/generated/themes/SecondaryNavigationItem.css.ts +1 -1
- package/src/generated/themes/SelectBase.css.ts +1 -1
- package/src/generated/themes/Slider.css.ts +1 -1
- package/src/themes/Breadcrumbs.css +16 -2
- package/src/themes/BreadcrumbsPopover.css +18 -3
- package/src/themes/FilterMenu.css +4 -9
- package/src/themes/ListGroupHeader.css +11 -0
- package/src/themes/ListItem.css +6 -4
- package/src/themes/MastheadItem.css +41 -9
- package/src/themes/MastheadMenu.css +45 -0
- package/src/themes/MastheadMobileMenu.css +45 -0
- package/src/themes/SearchableList.css +18 -3
- package/src/themes/SecondaryNavigation.css +1 -1
- package/src/themes/SecondaryNavigationItem.css +5 -2
- package/src/themes/SelectBase.css +0 -9
- package/src/types/List.ts +2 -0
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import {UDExFilterMenu, UDExFilterMenuItem, UDExFilterMenuGroupHeader, UDExFilterMenuSelectAll} from "../support/component-imports.js";
|
|
2
2
|
import {UDExListMode} from "../../src/types/List.js";
|
|
3
3
|
|
|
4
|
+
const filterMenuWithRating = <UDExFilterMenu
|
|
5
|
+
id="filter-menu-rating"
|
|
6
|
+
filter-name="Rating"
|
|
7
|
+
show-search-input="true"
|
|
8
|
+
mode={UDExListMode.MultiSelect}>
|
|
9
|
+
<UDExFilterMenuItem rating="5" ratingCount="5.0" totalCount="23"></UDExFilterMenuItem>
|
|
10
|
+
<UDExFilterMenuItem rating="4" ratingCount="4.0" totalCount="17"></UDExFilterMenuItem>
|
|
11
|
+
<UDExFilterMenuItem rating="3" ratingCount="3.0" totalCount="34"></UDExFilterMenuItem>
|
|
12
|
+
<UDExFilterMenuItem rating="2" ratingCount="2.0" totalCount="40"></UDExFilterMenuItem>
|
|
13
|
+
<UDExFilterMenuItem rating="1" ratingCount="1.0" totalCount="73"></UDExFilterMenuItem>
|
|
14
|
+
</UDExFilterMenu>
|
|
15
|
+
|
|
4
16
|
const filterMenu = <>
|
|
5
17
|
<div id="resetClick"></div>
|
|
6
18
|
<div id="resultClick"></div>
|
|
@@ -911,4 +923,45 @@ describe("Filter Menu component", () => {
|
|
|
911
923
|
cy.get("#resultSelectAll").should("have.text", "ui5-select-all");
|
|
912
924
|
});
|
|
913
925
|
});
|
|
926
|
+
|
|
927
|
+
describe("Filter Menu Rating Indicator", () => {
|
|
928
|
+
it("renders rating indicator in dropdown items when rating is set", () => {
|
|
929
|
+
cy.mount(filterMenuWithRating);
|
|
930
|
+
cy.get("#filter-menu-rating").shadow().find(".udex-filter-menu__trigger").click();
|
|
931
|
+
|
|
932
|
+
cy.get("#filter-menu-rating").shadow().find("udex-list-item").eq(0).shadow()
|
|
933
|
+
.find("[udex-rating-indicator]")
|
|
934
|
+
.should("exist");
|
|
935
|
+
});
|
|
936
|
+
|
|
937
|
+
it("passes correct rating attributes to dropdown list items", () => {
|
|
938
|
+
cy.mount(filterMenuWithRating);
|
|
939
|
+
cy.get("#filter-menu-rating").shadow().find(".udex-filter-menu__trigger").click();
|
|
940
|
+
|
|
941
|
+
cy.get("#filter-menu-rating").shadow().find("udex-list-item").eq(0)
|
|
942
|
+
.should("have.attr", "rating", "5")
|
|
943
|
+
.and("have.attr", "rating-count", "5.0")
|
|
944
|
+
.and("have.attr", "total-count", "23");
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
it("renders correct number of rating items", () => {
|
|
948
|
+
cy.mount(filterMenuWithRating);
|
|
949
|
+
cy.get("#filter-menu-rating").shadow().find(".udex-filter-menu__trigger").click();
|
|
950
|
+
|
|
951
|
+
cy.get("#filter-menu-rating").shadow().find("udex-list-item")
|
|
952
|
+
.should("have.length", 5);
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
it("selects a rating item on click", () => {
|
|
956
|
+
cy.mount(filterMenuWithRating);
|
|
957
|
+
cy.get("#filter-menu-rating").shadow().find(".udex-filter-menu__trigger").click();
|
|
958
|
+
|
|
959
|
+
cy.get("#filter-menu-rating").shadow().find("udex-list-item").eq(0).shadow()
|
|
960
|
+
.find(".udex-list__item").click();
|
|
961
|
+
|
|
962
|
+
cy.get("#filter-menu-rating").shadow().find("udex-list-item").eq(0).shadow()
|
|
963
|
+
.find(".udex-list__item")
|
|
964
|
+
.should("have.attr", "data-selected", "true");
|
|
965
|
+
});
|
|
966
|
+
});
|
|
914
967
|
});
|
|
@@ -4,8 +4,9 @@ import { UDExAvatarShape } from "../../dist/Avatar.js";
|
|
|
4
4
|
import { UDExAvatarSize } from "../../src/Avatar.js";
|
|
5
5
|
import { UDExAdditionalTextState, UDExListStyleType } from "../../src/types/List.js";
|
|
6
6
|
import UDExStatusBadgeValueState from "../../dist/types/StatusBadgeValueState.js";
|
|
7
|
+
import { UDExDisplayType } from "../../src/RatingIndicator.js";
|
|
7
8
|
|
|
8
|
-
const defaultListItem = <UDExListItem
|
|
9
|
+
const defaultListItem = <UDExListItem
|
|
9
10
|
id="listItem"
|
|
10
11
|
accessibleName="accessible-name"
|
|
11
12
|
supportingText="Supporting text"
|
|
@@ -20,7 +21,7 @@ const defaultListItem = <UDExListItem
|
|
|
20
21
|
Default List Item
|
|
21
22
|
</UDExListItem>
|
|
22
23
|
|
|
23
|
-
const listItemSuccess = <UDExListItem
|
|
24
|
+
const listItemSuccess = <UDExListItem
|
|
24
25
|
id="listItemSuccess"
|
|
25
26
|
accessibleName="accessible-name"
|
|
26
27
|
supportingText="Supporting text"
|
|
@@ -33,7 +34,7 @@ const listItemSuccess = <UDExListItem
|
|
|
33
34
|
Default List Item
|
|
34
35
|
</UDExListItem>
|
|
35
36
|
|
|
36
|
-
const listItemError = <UDExListItem
|
|
37
|
+
const listItemError = <UDExListItem
|
|
37
38
|
id="listItemError"
|
|
38
39
|
accessibleName="accessible-name"
|
|
39
40
|
supportingText="Supporting text"
|
|
@@ -46,7 +47,7 @@ const listItemError = <UDExListItem
|
|
|
46
47
|
Default List Item
|
|
47
48
|
</UDExListItem>
|
|
48
49
|
|
|
49
|
-
const listItemWarning = <UDExListItem
|
|
50
|
+
const listItemWarning = <UDExListItem
|
|
50
51
|
id="listItemWarning"
|
|
51
52
|
accessibleName="accessible-name"
|
|
52
53
|
supportingText="Supporting text"
|
|
@@ -59,7 +60,7 @@ const listItemWarning = <UDExListItem
|
|
|
59
60
|
Default List Item
|
|
60
61
|
</UDExListItem>
|
|
61
62
|
|
|
62
|
-
const listItemWithIcons = <UDExListItem
|
|
63
|
+
const listItemWithIcons = <UDExListItem
|
|
63
64
|
id="listItemIcons"
|
|
64
65
|
accessible-name="accessible-name"
|
|
65
66
|
supporting-text="Supporting text"
|
|
@@ -73,6 +74,13 @@ const listItemWithIcons = <UDExListItem
|
|
|
73
74
|
<UDExButton accessible-name='Action' slot='secondIcon' design='Tertiary' icon='decline' size='Small'></UDExButton>
|
|
74
75
|
</UDExListItem>
|
|
75
76
|
|
|
77
|
+
const listItemWithRating = <UDExListItem
|
|
78
|
+
id="listItemRating"
|
|
79
|
+
rating="4"
|
|
80
|
+
ratingCount="4.0"
|
|
81
|
+
totalCount="20">
|
|
82
|
+
</UDExListItem>
|
|
83
|
+
|
|
76
84
|
describe("ListItem", () => {
|
|
77
85
|
describe("Default rendering", () => {
|
|
78
86
|
it("should render the component", () => {
|
|
@@ -80,32 +88,36 @@ describe("ListItem", () => {
|
|
|
80
88
|
cy.get("[udex-list-item]").should("exist");
|
|
81
89
|
});
|
|
82
90
|
});
|
|
83
|
-
|
|
91
|
+
|
|
84
92
|
describe("Basic attributes", () => {
|
|
85
93
|
beforeEach(() => {
|
|
86
94
|
cy.mount(defaultListItem);
|
|
87
95
|
});
|
|
88
|
-
|
|
96
|
+
|
|
89
97
|
it("has correct supporting text", () => {
|
|
90
98
|
cy.get("#listItem").shadow().find(".udex-list__supporting-text").should("have.text", "Supporting text");
|
|
91
99
|
});
|
|
92
|
-
|
|
100
|
+
|
|
93
101
|
it("has correct avatar", () => {
|
|
94
102
|
cy.get("#listItem").shadow().find(".udex-list__avatar").should("exist");
|
|
95
103
|
});
|
|
96
|
-
|
|
104
|
+
|
|
97
105
|
it("has avatar of size M", () => {
|
|
98
106
|
cy.get("#listItem").shadow().find(".udex-list__avatar").should("have.attr", "size", "M");
|
|
99
107
|
});
|
|
100
|
-
|
|
108
|
+
|
|
101
109
|
it("has avatar of shape Square", () => {
|
|
102
110
|
cy.get("#listItem").shadow().find(".udex-list__avatar").should("have.attr", "shape", "Square");
|
|
103
111
|
});
|
|
104
|
-
|
|
112
|
+
|
|
105
113
|
it("has avatar with alternative text", () => {
|
|
106
114
|
cy.get("#listItem").shadow().find(".udex-list__avatar").find("img").should("have.attr", "alt", "Person Avatar");
|
|
107
115
|
});
|
|
108
|
-
|
|
116
|
+
|
|
117
|
+
it("renders bullet marker at the start of the item", () => {
|
|
118
|
+
cy.get("#listItem").shadow().find(".udex-list__circle").should("exist");
|
|
119
|
+
});
|
|
120
|
+
|
|
109
121
|
it("has correct accessibleName", () => {
|
|
110
122
|
cy.get("#listItem").shadow().find(".udex-list__content-wrap").should(($wrapper) => {
|
|
111
123
|
const itemId = $wrapper.attr("_id");
|
|
@@ -122,51 +134,91 @@ describe("ListItem", () => {
|
|
|
122
134
|
cy.get("#listItem").shadow().find("udex-status-badge").should("have.attr", "size", UDExAvatarSize.M);
|
|
123
135
|
});
|
|
124
136
|
});
|
|
125
|
-
|
|
137
|
+
|
|
126
138
|
describe("With Icons", () => {
|
|
127
139
|
beforeEach(() => {
|
|
128
140
|
cy.mount(listItemWithIcons);
|
|
129
141
|
});
|
|
130
|
-
|
|
142
|
+
|
|
131
143
|
it("renders first and second icons when both slots are filled", () => {
|
|
132
144
|
cy.get("#listItemIcons").find("udex-button").should("have.length", 2);
|
|
133
145
|
});
|
|
134
|
-
|
|
146
|
+
|
|
135
147
|
it("becomes selected when clicking", () => {
|
|
136
148
|
cy.get("#listItemIcons").shadow().find(".udex-list__item").click();
|
|
137
149
|
cy.get("#listItemIcons").should("have.attr", "selected");
|
|
138
150
|
});
|
|
139
|
-
|
|
151
|
+
|
|
140
152
|
it("pressing Enter sets data-selected", () => {
|
|
141
153
|
cy.realPress("Enter");
|
|
142
154
|
cy.get("#listItemIcons").shadow().find(".udex-list__item").should("have.attr", "data-selected");
|
|
143
155
|
});
|
|
144
|
-
|
|
156
|
+
|
|
145
157
|
it("pressing Space sets data-selected", () => {
|
|
146
158
|
cy.realPress("Space");
|
|
147
159
|
cy.get("#listItemIcons").shadow().find(".udex-list__item").should("have.attr", "data-selected");
|
|
148
160
|
});
|
|
149
161
|
});
|
|
150
|
-
|
|
162
|
+
|
|
151
163
|
describe("Additional Text States", () => {
|
|
152
164
|
it("shows Information state", () => {
|
|
153
165
|
cy.mount(defaultListItem);
|
|
154
166
|
cy.get("#listItem").shadow().find(".udex-list__add-text").should("have.css", "color", "rgb(0, 64, 176)");
|
|
155
167
|
});
|
|
156
|
-
|
|
168
|
+
|
|
157
169
|
it("shows Success state", () => {
|
|
158
170
|
cy.mount(listItemSuccess);
|
|
159
171
|
cy.get("#listItemSuccess").shadow().find(".udex-list__add-text").should("have.css", "color", "rgb(30, 89, 47)");
|
|
160
172
|
});
|
|
161
|
-
|
|
173
|
+
|
|
162
174
|
it("shows Error state", () => {
|
|
163
175
|
cy.mount(listItemError);
|
|
164
176
|
cy.get("#listItemError").shadow().find(".udex-list__add-text").should("have.css", "color", "rgb(132, 6, 6)");
|
|
165
177
|
});
|
|
166
|
-
|
|
178
|
+
|
|
167
179
|
it("shows Warning state", () => {
|
|
168
180
|
cy.mount(listItemWarning);
|
|
169
181
|
cy.get("#listItemWarning").shadow().find(".udex-list__add-text").should("have.css", "color", "rgb(141, 42, 0)");
|
|
170
182
|
});
|
|
171
183
|
});
|
|
184
|
+
|
|
185
|
+
describe("RatingIndicator", () => {
|
|
186
|
+
beforeEach(() => {
|
|
187
|
+
cy.mount(listItemWithRating);
|
|
188
|
+
cy.get("#listItemRating").shadow().find("[udex-rating-indicator]").as("rating");
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it("renders rating indicator when rating is set", () => {
|
|
192
|
+
cy.get("@rating").should("exist");
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it("passes correct value to rating indicator", () => {
|
|
196
|
+
cy.get("@rating").should("have.attr", "value", "4");
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("passes correct rating-count to rating indicator", () => {
|
|
200
|
+
cy.get("@rating").should("have.attr", "rating-count", "4.0");
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it("passes correct total-count to rating indicator", () => {
|
|
204
|
+
cy.get("@rating").should("have.attr", "total-count", "20");
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("sets max to 5 by default", () => {
|
|
208
|
+
cy.get("@rating").should("have.attr", "max", "5");
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("sets display to Desktop by default", () => {
|
|
212
|
+
cy.get("@rating").should("have.attr", "display", UDExDisplayType.Desktop);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it("sets disabled and readonly states by default", () => {
|
|
216
|
+
cy.get("@rating").should("have.attr", "disabled");
|
|
217
|
+
cy.get("@rating").should("have.attr", "readonly");
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it("sets correct aria-label on rating indicator", () => {
|
|
221
|
+
cy.get("@rating").should("have.attr", "aria-label", "Rating 4.0, Total 20, Rating Indicator 4 of 5");
|
|
222
|
+
});
|
|
223
|
+
});
|
|
172
224
|
});
|