@scrippsproduct/networks-ui-library 1.1.8 → 1.1.10-alpha.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/dist/{Form.module-Cd8qH2rj.mjs → Form.module-CarfWK5T.mjs} +1 -1
- package/dist/ResultsTable.module-wcNUQEKe.mjs +14 -0
- package/dist/_commonjsHelpers-DaMA6jEr.mjs +8 -0
- package/dist/assets/ResultsTable.css +1 -1
- package/dist/assets/ScheduleLayout.css +1 -1
- package/dist/{chevron-left-DRvpaLmK.mjs → chevron-left-D0UjbrKw.mjs} +1 -1
- package/dist/{chevron-right-C8yCnmfx.mjs → chevron-right-0ZF3LruR.mjs} +1 -1
- package/dist/components/ActionButton/ActionButton.test.js +209 -0
- package/dist/components/AdBlock/AdBlock.test.js +286 -0
- package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +295 -0
- package/dist/components/AirDateFormatter/AirDateFormatter.test.js +192 -0
- package/dist/components/AnchorTag/AnchorTag.test.js +463 -0
- package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +295 -0
- package/dist/components/BasicGridModule/BasicGridModule.js +41 -37
- package/dist/components/BasicGridModule/BasicGridModule.test.js +227 -0
- package/dist/components/Button/Button.test.js +434 -0
- package/dist/components/Carousel/Carousel.js +2 -2
- package/dist/components/Carousel/Carousel.test.js +705 -0
- package/dist/components/CarouselSlide/CarouselSlide.test.js +378 -0
- package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
- package/dist/components/CastInfoLayout/CastInfoLayout.test.js +294 -0
- package/dist/components/ChannelSearch/ChannelSearch.test.js +565 -0
- package/dist/components/ChoicesItem/ChoicesItem.test.js +428 -0
- package/dist/components/Concat/Concat.js +1 -1
- package/dist/components/Concat/Concat.test.js +115 -0
- package/dist/components/CtaBlock/CtaBlock.js +1 -1
- package/dist/components/CtaBlock/CtaBlock.test.js +226 -0
- package/dist/components/CustomDataList/CustomDataList.js +4 -4
- package/dist/components/CustomSelect/CustomSelect.js +86 -86
- package/dist/components/CustomSelect/CustomSelect.test.js +313 -0
- package/dist/components/DateNavigation/DateNavigation.js +10 -10
- package/dist/components/DateNavigation/DateNavigation.test.js +370 -0
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +288 -0
- package/dist/components/DrawerNavigation/DrawerNavigation.test.js +316 -0
- package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +337 -0
- package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +358 -0
- package/dist/components/ErrorHandler/ErrorHandler.js +2 -2
- package/dist/components/ErrorHandler/ErrorHandler.test.js +158 -0
- package/dist/components/FeaturedList/FeaturedList.test.js +353 -0
- package/dist/components/Figure/Figure.js +1 -1
- package/dist/components/Figure/Figure.test.js +198 -0
- package/dist/components/FindUs/FindUs.test.js +499 -0
- package/dist/components/FooterNavigation/FooterNavigation.test.js +310 -0
- package/dist/components/GenericList/GenericList.js +1 -1
- package/dist/components/GenericList/GenericList.test.js +288 -0
- package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +689 -0
- package/dist/components/GradientButton/GradientButton.d.ts +1 -1
- package/dist/components/GradientButton/GradientButton.js +33 -31
- package/dist/components/GradientButton/GradientButton.test.js +457 -0
- package/dist/components/GridList/GridList.test.js +371 -0
- package/dist/components/ImageCard/ImageCard.test.js +668 -0
- package/dist/components/ImageCard/ImageCardCore.js +28 -28
- package/dist/components/ImageCard/ImageCardCore.test.js +577 -0
- package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +379 -0
- package/dist/components/InfoPanel/InfoPanel.js +1 -1
- package/dist/components/InlineNavigation/InlineNavigation.test.js +149 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.test.js +263 -0
- package/dist/components/InstructionsList/InstructionsList.js +11 -11
- package/dist/components/InstructionsList/InstructionsList.test.js +181 -0
- package/dist/components/LogoListItem/LogoListItem.test.js +303 -0
- package/dist/components/LogoNavigation/LogoNavigation.test.js +352 -0
- package/dist/components/ModalContainer/ModalContainer.js +2 -2
- package/dist/components/NavList/NavList.test.js +332 -0
- package/dist/components/Overlay/Overlay.js +24 -23
- package/dist/components/Overlay/Overlay.test.js +198 -0
- package/dist/components/PageHero/PageHero.test.js +241 -0
- package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
- package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
- package/dist/components/ProgramAirdate/ProgramAirdate.test.js +414 -0
- package/dist/components/PromotionBlock/PromotionBlock.test.js +208 -0
- package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +221 -0
- package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +349 -0
- package/dist/components/RescanInstructions/RescanInstructions.test.js +218 -0
- package/dist/components/ResponsiveImage/ResponsiveImage.test.js +264 -0
- package/dist/components/ResultsTable/ResultsTable.js +9 -2
- package/dist/components/ResultsTable/ResultsTable.test.js +402 -0
- package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
- package/dist/components/ResultsTableBody/ResultsTableBody.test.js +445 -0
- package/dist/components/ResultsTableHeader/ResultsTableHeader.js +37 -15
- package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +275 -0
- package/dist/components/ScheduleLayout/ScheduleContext.js +654 -626
- package/dist/components/ScheduleLayout/ScheduleLayout.js +1 -1
- package/dist/components/ScheduleLayout/useScheduleContext.js +5 -10
- package/dist/components/ScheduleList/ScheduleList.js +1 -1
- package/dist/components/SectionedContent/SectionedContent.js +1 -1
- package/dist/components/SectionedContent/SectionedContent.test.js +341 -0
- package/dist/components/Select/Select.js +24 -24
- package/dist/components/Select/Select.test.js +367 -0
- package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
- package/dist/components/ShowAboutContent/ShowAboutContent.test.js +535 -0
- package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +570 -0
- package/dist/components/SocialLinks/SocialLinks.js +1 -1
- package/dist/components/StringList/StringList.js +1 -1
- package/dist/components/StringList/StringList.test.js +311 -0
- package/dist/components/TabContent/TabContent.js +1 -1
- package/dist/components/TabContent/TabContent.test.js +274 -0
- package/dist/components/TabNavigation/TabNavigation.js +21 -21
- package/dist/components/TabNavigation/TabNavigation.test.js +535 -0
- package/dist/components/TabbedContent/TabbedContent.test.js +654 -0
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/UpcomingList/UpcomingList.test.js +471 -0
- package/dist/{index-VjANCDXC.mjs → index-06PEPfBQ.mjs} +1 -1
- package/dist/index-BUN4jQ3m.mjs +3098 -0
- package/dist/index-BVxBrkZB.mjs +3 -0
- package/dist/{index-DC2JJV3a.mjs → index-D3kkcgee.mjs} +1 -1
- package/dist/{index-C-kn9Zhn.mjs → index-DzfYkULW.mjs} +2 -1
- package/dist/magic-string.es-uPKorP4O.mjs +663 -0
- package/dist/matchers-35e4d3bd-BBPNTlen.mjs +2404 -0
- package/dist/react.esm-DLSrfVwM.mjs +23410 -0
- package/dist/test/setupTests.d.ts +1 -0
- package/dist/test/setupTests.js +55 -0
- package/dist/{triangle-PcCcGXjr.mjs → triangle-C4z906Wf.mjs} +1 -1
- package/dist/useScheduleContext-D7FdzNxe.mjs +17 -0
- package/dist/utils/analytics.js +1 -1
- package/dist/utils/getOnNowProgram.js +10 -10
- package/dist/{x-C-QzJ-qD.mjs → x-Ck9Vk5Fo.mjs} +1 -1
- package/package.json +4 -1
- package/dist/ResultsTable.module-1zxhXaem.mjs +0 -14
- package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as a } from "react/jsx-runtime";
|
|
2
|
+
import { v as c, d as r, b as g, a as y, i as s, r as o, s as i, g as t } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import { GridList as n } from "./GridList.js";
|
|
4
|
+
c.mock("../../utils/helpers", () => ({
|
|
5
|
+
classes: (l) => l.filter(Boolean).join(" ")
|
|
6
|
+
}));
|
|
7
|
+
c.mock("./GridList.module.scss", () => ({
|
|
8
|
+
default: {
|
|
9
|
+
"grid-list": "grid-list-module",
|
|
10
|
+
"grid-list-header": "grid-list-header-module",
|
|
11
|
+
"grid-list---5-columns": "grid-list---5-columns-module",
|
|
12
|
+
"grid-list--0-columns": "grid-list--0-columns-module",
|
|
13
|
+
"grid-list--1-columns": "grid-list--1-columns-module",
|
|
14
|
+
"grid-list--2-columns": "grid-list--2-columns-module",
|
|
15
|
+
"grid-list--3-columns": "grid-list--3-columns-module",
|
|
16
|
+
"grid-list--4-columns": "grid-list--4-columns-module",
|
|
17
|
+
"grid-list--5-columns": "grid-list--5-columns-module",
|
|
18
|
+
"grid-list--6-columns": "grid-list--6-columns-module",
|
|
19
|
+
"grid-list--7-columns": "grid-list--7-columns-module",
|
|
20
|
+
"grid-list--8-columns": "grid-list--8-columns-module",
|
|
21
|
+
"grid-list--9-columns": "grid-list--9-columns-module",
|
|
22
|
+
"grid-list--10-columns": "grid-list--10-columns-module"
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
r("GridList", () => {
|
|
26
|
+
g(() => {
|
|
27
|
+
c.clearAllMocks();
|
|
28
|
+
}), y(() => {
|
|
29
|
+
c.restoreAllMocks();
|
|
30
|
+
}), r("Basic Rendering", () => {
|
|
31
|
+
s("should render a ul element", () => {
|
|
32
|
+
o(
|
|
33
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Item 1" }) })
|
|
34
|
+
);
|
|
35
|
+
const l = i.getByRole("list");
|
|
36
|
+
t(l).toBeInTheDocument(), t(l.tagName).toBe("UL");
|
|
37
|
+
}), s("should render children inside the ul", () => {
|
|
38
|
+
o(
|
|
39
|
+
/* @__PURE__ */ m(n, { children: [
|
|
40
|
+
/* @__PURE__ */ e("li", { children: "Item 1" }),
|
|
41
|
+
/* @__PURE__ */ e("li", { children: "Item 2" }),
|
|
42
|
+
/* @__PURE__ */ e("li", { children: "Item 3" })
|
|
43
|
+
] })
|
|
44
|
+
), t(i.getByText("Item 1")).toBeInTheDocument(), t(i.getByText("Item 2")).toBeInTheDocument(), t(i.getByText("Item 3")).toBeInTheDocument();
|
|
45
|
+
}), s("should apply base grid-list class", () => {
|
|
46
|
+
o(
|
|
47
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
48
|
+
);
|
|
49
|
+
const l = i.getByRole("list");
|
|
50
|
+
t(l).toHaveClass("grid-list-module");
|
|
51
|
+
}), s("should render with no header by default", () => {
|
|
52
|
+
o(
|
|
53
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
54
|
+
), t(i.queryByRole("heading")).not.toBeInTheDocument();
|
|
55
|
+
});
|
|
56
|
+
}), r("Header Text", () => {
|
|
57
|
+
s("should render header when headerText is provided", () => {
|
|
58
|
+
o(
|
|
59
|
+
/* @__PURE__ */ e(n, { headerText: "My Grid", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
60
|
+
);
|
|
61
|
+
const l = i.getByRole("heading", { level: 3 });
|
|
62
|
+
t(l).toBeInTheDocument(), t(l).toHaveTextContent("My Grid");
|
|
63
|
+
}), s("should not render header when headerText is empty string", () => {
|
|
64
|
+
o(
|
|
65
|
+
/* @__PURE__ */ e(n, { headerText: "", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
66
|
+
), t(i.queryByRole("heading")).not.toBeInTheDocument();
|
|
67
|
+
}), s("should apply header classes", () => {
|
|
68
|
+
o(
|
|
69
|
+
/* @__PURE__ */ e(n, { headerText: "Test Header", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
70
|
+
);
|
|
71
|
+
const l = i.getByRole("heading");
|
|
72
|
+
t(l).toHaveClass("grid-list-header-module"), t(l).toHaveClass("grid-list-header");
|
|
73
|
+
}), s("should render h3 element for header", () => {
|
|
74
|
+
o(
|
|
75
|
+
/* @__PURE__ */ e(n, { headerText: "Title", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
76
|
+
);
|
|
77
|
+
const l = i.getByText("Title");
|
|
78
|
+
t(l.tagName).toBe("H3");
|
|
79
|
+
}), s("should handle special characters in header text", () => {
|
|
80
|
+
o(
|
|
81
|
+
/* @__PURE__ */ e(n, { headerText: "Grid & List <Title>", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
82
|
+
), t(i.getByText("Grid & List <Title>")).toBeInTheDocument();
|
|
83
|
+
}), s("should handle unicode characters in header text", () => {
|
|
84
|
+
o(
|
|
85
|
+
/* @__PURE__ */ e(n, { headerText: "🎨 Gallery Grid", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
86
|
+
), t(i.getByText("🎨 Gallery Grid")).toBeInTheDocument();
|
|
87
|
+
});
|
|
88
|
+
}), r("Number of Columns", () => {
|
|
89
|
+
s("should use 2 columns by default", () => {
|
|
90
|
+
o(
|
|
91
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
92
|
+
);
|
|
93
|
+
const l = i.getByRole("list");
|
|
94
|
+
t(l).toHaveClass("grid-list--2-columns-module");
|
|
95
|
+
}), s("should apply 1 column class", () => {
|
|
96
|
+
o(
|
|
97
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 1, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
98
|
+
);
|
|
99
|
+
const l = i.getByRole("list");
|
|
100
|
+
t(l).toHaveClass("grid-list--1-columns-module");
|
|
101
|
+
}), s("should apply 3 column class", () => {
|
|
102
|
+
o(
|
|
103
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 3, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
104
|
+
);
|
|
105
|
+
const l = i.getByRole("list");
|
|
106
|
+
t(l).toHaveClass("grid-list--3-columns-module");
|
|
107
|
+
}), s("should apply 4 column class", () => {
|
|
108
|
+
o(
|
|
109
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 4, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
110
|
+
);
|
|
111
|
+
const l = i.getByRole("list");
|
|
112
|
+
t(l).toHaveClass("grid-list--4-columns-module");
|
|
113
|
+
}), s("should apply 5 column class", () => {
|
|
114
|
+
o(
|
|
115
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 5, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
116
|
+
);
|
|
117
|
+
const l = i.getByRole("list");
|
|
118
|
+
t(l).toHaveClass("grid-list--5-columns-module");
|
|
119
|
+
}), s("should apply 6 column class", () => {
|
|
120
|
+
o(
|
|
121
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 6, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
122
|
+
);
|
|
123
|
+
const l = i.getByRole("list");
|
|
124
|
+
t(l).toHaveClass("grid-list--6-columns-module");
|
|
125
|
+
}), s("should apply 7 column class", () => {
|
|
126
|
+
o(
|
|
127
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 7, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
128
|
+
);
|
|
129
|
+
const l = i.getByRole("list");
|
|
130
|
+
t(l).toHaveClass("grid-list--7-columns-module");
|
|
131
|
+
}), s("should apply 8 column class", () => {
|
|
132
|
+
o(
|
|
133
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 8, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
134
|
+
);
|
|
135
|
+
const l = i.getByRole("list");
|
|
136
|
+
t(l).toHaveClass("grid-list--8-columns-module");
|
|
137
|
+
}), s("should apply 9 column class", () => {
|
|
138
|
+
o(
|
|
139
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 9, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
140
|
+
);
|
|
141
|
+
const l = i.getByRole("list");
|
|
142
|
+
t(l).toHaveClass("grid-list--9-columns-module");
|
|
143
|
+
}), s("should apply 10 column class", () => {
|
|
144
|
+
o(
|
|
145
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 10, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
146
|
+
);
|
|
147
|
+
const l = i.getByRole("list");
|
|
148
|
+
t(l).toHaveClass("grid-list--10-columns-module");
|
|
149
|
+
}), s("should cap numberOfColumns at 10 when 11 is provided", () => {
|
|
150
|
+
o(
|
|
151
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 11, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
152
|
+
);
|
|
153
|
+
const l = i.getByRole("list");
|
|
154
|
+
t(l).toHaveClass("grid-list--10-columns-module");
|
|
155
|
+
}), s("should cap numberOfColumns at 10 when 15 is provided", () => {
|
|
156
|
+
o(
|
|
157
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 15, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
158
|
+
);
|
|
159
|
+
const l = i.getByRole("list");
|
|
160
|
+
t(l).toHaveClass("grid-list--10-columns-module");
|
|
161
|
+
}), s("should cap numberOfColumns at 10 when 100 is provided", () => {
|
|
162
|
+
o(
|
|
163
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 100, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
164
|
+
);
|
|
165
|
+
const l = i.getByRole("list");
|
|
166
|
+
t(l).toHaveClass("grid-list--10-columns-module");
|
|
167
|
+
});
|
|
168
|
+
}), r("Children Rendering", () => {
|
|
169
|
+
s("should render single child", () => {
|
|
170
|
+
o(
|
|
171
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Single Item" }) })
|
|
172
|
+
);
|
|
173
|
+
const l = i.getAllByRole("listitem");
|
|
174
|
+
t(l).toHaveLength(1);
|
|
175
|
+
}), s("should render multiple children", () => {
|
|
176
|
+
o(
|
|
177
|
+
/* @__PURE__ */ m(n, { children: [
|
|
178
|
+
/* @__PURE__ */ e("li", { children: "Item 1" }),
|
|
179
|
+
/* @__PURE__ */ e("li", { children: "Item 2" }),
|
|
180
|
+
/* @__PURE__ */ e("li", { children: "Item 3" }),
|
|
181
|
+
/* @__PURE__ */ e("li", { children: "Item 4" })
|
|
182
|
+
] })
|
|
183
|
+
);
|
|
184
|
+
const l = i.getAllByRole("listitem");
|
|
185
|
+
t(l).toHaveLength(4);
|
|
186
|
+
}), s("should render complex children with nested elements", () => {
|
|
187
|
+
o(
|
|
188
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: /* @__PURE__ */ m("div", { children: [
|
|
189
|
+
/* @__PURE__ */ e("span", { children: "Complex" }),
|
|
190
|
+
/* @__PURE__ */ e("strong", { children: "Item" })
|
|
191
|
+
] }) }) })
|
|
192
|
+
), t(i.getByText("Complex")).toBeInTheDocument(), t(i.getByText("Item")).toBeInTheDocument();
|
|
193
|
+
}), s("should render children with custom components", () => {
|
|
194
|
+
const l = ({ text: d }) => /* @__PURE__ */ e("li", { children: d });
|
|
195
|
+
o(
|
|
196
|
+
/* @__PURE__ */ m(n, { children: [
|
|
197
|
+
/* @__PURE__ */ e(l, { text: "Custom 1" }),
|
|
198
|
+
/* @__PURE__ */ e(l, { text: "Custom 2" })
|
|
199
|
+
] })
|
|
200
|
+
), t(i.getByText("Custom 1")).toBeInTheDocument(), t(i.getByText("Custom 2")).toBeInTheDocument();
|
|
201
|
+
}), s("should handle empty children gracefully", () => {
|
|
202
|
+
o(
|
|
203
|
+
/* @__PURE__ */ e(n, { children: null })
|
|
204
|
+
);
|
|
205
|
+
const l = i.getByRole("list");
|
|
206
|
+
t(l).toBeInTheDocument();
|
|
207
|
+
}), s("should render children with conditional rendering", () => {
|
|
208
|
+
o(
|
|
209
|
+
/* @__PURE__ */ m(n, { children: [
|
|
210
|
+
/* @__PURE__ */ e("li", { children: "Conditional Item" }),
|
|
211
|
+
/* @__PURE__ */ e("li", { children: "Always Item" })
|
|
212
|
+
] })
|
|
213
|
+
), t(i.getByText("Conditional Item")).toBeInTheDocument(), t(i.getByText("Always Item")).toBeInTheDocument();
|
|
214
|
+
});
|
|
215
|
+
}), r("Class Application", () => {
|
|
216
|
+
s("should apply both module and global classes to list", () => {
|
|
217
|
+
o(
|
|
218
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
219
|
+
);
|
|
220
|
+
const l = i.getByRole("list");
|
|
221
|
+
t(l).toHaveClass("grid-list-module"), t(l).toHaveClass("grid-list--2-columns-module");
|
|
222
|
+
}), s("should apply column class based on numberOfColumns prop", () => {
|
|
223
|
+
o(
|
|
224
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 3, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
225
|
+
);
|
|
226
|
+
const l = i.getByRole("list");
|
|
227
|
+
t(l).toHaveClass("grid-list--3-columns-module"), t(l).not.toHaveClass("grid-list--2-columns-module");
|
|
228
|
+
}), s("should apply both header classes when header is rendered", () => {
|
|
229
|
+
o(
|
|
230
|
+
/* @__PURE__ */ e(n, { headerText: "Header", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
231
|
+
);
|
|
232
|
+
const l = i.getByRole("heading");
|
|
233
|
+
t(l).toHaveClass("grid-list-header-module"), t(l).toHaveClass("grid-list-header");
|
|
234
|
+
});
|
|
235
|
+
}), r("Edge Cases", () => {
|
|
236
|
+
s("should handle numberOfColumns as 0", () => {
|
|
237
|
+
o(
|
|
238
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 0, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
239
|
+
);
|
|
240
|
+
const l = i.getByRole("list");
|
|
241
|
+
t(l).toHaveClass("grid-list--0-columns-module");
|
|
242
|
+
}), s("should handle negative numberOfColumns", () => {
|
|
243
|
+
o(
|
|
244
|
+
/* @__PURE__ */ e(n, { numberOfColumns: -5, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
245
|
+
);
|
|
246
|
+
const l = i.getByRole("list");
|
|
247
|
+
t(l).toHaveClass("grid-list---5-columns-module");
|
|
248
|
+
}), s("should handle very long header text", () => {
|
|
249
|
+
const l = "A".repeat(500);
|
|
250
|
+
o(
|
|
251
|
+
/* @__PURE__ */ e(n, { headerText: l, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
252
|
+
), t(i.getByText(l)).toBeInTheDocument();
|
|
253
|
+
}), s("should render with whitespace-only header text", () => {
|
|
254
|
+
o(
|
|
255
|
+
/* @__PURE__ */ e(n, { headerText: " ", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
256
|
+
);
|
|
257
|
+
const l = i.getByRole("heading");
|
|
258
|
+
t(l).toBeInTheDocument(), t(l.textContent).toBe(" ");
|
|
259
|
+
}), s("should handle many children", () => {
|
|
260
|
+
const l = Array.from(
|
|
261
|
+
{ length: 100 },
|
|
262
|
+
(h, u) => /* @__PURE__ */ m("li", { children: [
|
|
263
|
+
"Item ",
|
|
264
|
+
u
|
|
265
|
+
] }, u)
|
|
266
|
+
);
|
|
267
|
+
o(/* @__PURE__ */ e(n, { children: l }));
|
|
268
|
+
const d = i.getAllByRole("listitem");
|
|
269
|
+
t(d).toHaveLength(100);
|
|
270
|
+
}), s("should handle fragment children", () => {
|
|
271
|
+
o(
|
|
272
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ m(a, { children: [
|
|
273
|
+
/* @__PURE__ */ e("li", { children: "Fragment Item 1" }),
|
|
274
|
+
/* @__PURE__ */ e("li", { children: "Fragment Item 2" })
|
|
275
|
+
] }) })
|
|
276
|
+
), t(i.getByText("Fragment Item 1")).toBeInTheDocument(), t(i.getByText("Fragment Item 2")).toBeInTheDocument();
|
|
277
|
+
});
|
|
278
|
+
}), r("Integration", () => {
|
|
279
|
+
s("should render complete grid with header and multiple columns", () => {
|
|
280
|
+
o(
|
|
281
|
+
/* @__PURE__ */ m(n, { headerText: "Product Gallery", numberOfColumns: 4, children: [
|
|
282
|
+
/* @__PURE__ */ e("li", { children: "Product 1" }),
|
|
283
|
+
/* @__PURE__ */ e("li", { children: "Product 2" }),
|
|
284
|
+
/* @__PURE__ */ e("li", { children: "Product 3" }),
|
|
285
|
+
/* @__PURE__ */ e("li", { children: "Product 4" }),
|
|
286
|
+
/* @__PURE__ */ e("li", { children: "Product 5" }),
|
|
287
|
+
/* @__PURE__ */ e("li", { children: "Product 6" })
|
|
288
|
+
] })
|
|
289
|
+
);
|
|
290
|
+
const l = i.getByRole("heading", { level: 3 });
|
|
291
|
+
t(l).toHaveTextContent("Product Gallery");
|
|
292
|
+
const d = i.getByRole("list");
|
|
293
|
+
t(d).toHaveClass("grid-list--4-columns-module");
|
|
294
|
+
const h = i.getAllByRole("listitem");
|
|
295
|
+
t(h).toHaveLength(6);
|
|
296
|
+
}), s("should render grid with maximum columns and header", () => {
|
|
297
|
+
o(
|
|
298
|
+
/* @__PURE__ */ m(n, { headerText: "Maximum Grid", numberOfColumns: 10, children: [
|
|
299
|
+
/* @__PURE__ */ e("li", { children: "Item 1" }),
|
|
300
|
+
/* @__PURE__ */ e("li", { children: "Item 2" })
|
|
301
|
+
] })
|
|
302
|
+
);
|
|
303
|
+
const l = i.getByRole("heading");
|
|
304
|
+
t(l).toHaveTextContent("Maximum Grid");
|
|
305
|
+
const d = i.getByRole("list");
|
|
306
|
+
t(d).toHaveClass("grid-list--10-columns-module");
|
|
307
|
+
}), s("should update when numberOfColumns changes", () => {
|
|
308
|
+
const { rerender: l } = o(
|
|
309
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 2, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
310
|
+
);
|
|
311
|
+
let d = i.getByRole("list");
|
|
312
|
+
t(d).toHaveClass("grid-list--2-columns-module"), l(
|
|
313
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 5, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
314
|
+
), d = i.getByRole("list"), t(d).toHaveClass("grid-list--5-columns-module"), t(d).not.toHaveClass("grid-list--2-columns-module");
|
|
315
|
+
}), s("should update when headerText changes", () => {
|
|
316
|
+
const { rerender: l } = o(
|
|
317
|
+
/* @__PURE__ */ e(n, { headerText: "Original Header", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
318
|
+
);
|
|
319
|
+
t(i.getByText("Original Header")).toBeInTheDocument(), l(
|
|
320
|
+
/* @__PURE__ */ e(n, { headerText: "Updated Header", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
321
|
+
), t(i.queryByText("Original Header")).not.toBeInTheDocument(), t(i.getByText("Updated Header")).toBeInTheDocument();
|
|
322
|
+
}), s("should show/hide header when headerText changes to/from empty", () => {
|
|
323
|
+
const { rerender: l } = o(
|
|
324
|
+
/* @__PURE__ */ e(n, { headerText: "Visible Header", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
325
|
+
);
|
|
326
|
+
t(i.getByRole("heading")).toBeInTheDocument(), l(
|
|
327
|
+
/* @__PURE__ */ e(n, { headerText: "", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
328
|
+
), t(i.queryByRole("heading")).not.toBeInTheDocument(), l(
|
|
329
|
+
/* @__PURE__ */ e(n, { headerText: "Back Again", children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
330
|
+
), t(i.getByRole("heading")).toBeInTheDocument(), t(i.getByText("Back Again")).toBeInTheDocument();
|
|
331
|
+
});
|
|
332
|
+
}), r("Default Props", () => {
|
|
333
|
+
s("should use default numberOfColumns of 2", () => {
|
|
334
|
+
o(
|
|
335
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
336
|
+
);
|
|
337
|
+
const l = i.getByRole("list");
|
|
338
|
+
t(l).toHaveClass("grid-list--2-columns-module");
|
|
339
|
+
}), s("should use default headerText of empty string", () => {
|
|
340
|
+
o(
|
|
341
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
342
|
+
), t(i.queryByRole("heading")).not.toBeInTheDocument();
|
|
343
|
+
}), s("should use all defaults when only children provided", () => {
|
|
344
|
+
o(
|
|
345
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
346
|
+
);
|
|
347
|
+
const l = i.getByRole("list");
|
|
348
|
+
t(l).toHaveClass("grid-list--2-columns-module"), t(i.queryByRole("heading")).not.toBeInTheDocument();
|
|
349
|
+
});
|
|
350
|
+
}), r("Column Cap Behavior", () => {
|
|
351
|
+
s("should not cap numberOfColumns when exactly 10", () => {
|
|
352
|
+
o(
|
|
353
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 10, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
354
|
+
);
|
|
355
|
+
const l = i.getByRole("list");
|
|
356
|
+
t(l).toHaveClass("grid-list--10-columns-module");
|
|
357
|
+
}), s("should cap numberOfColumns at first value over 10", () => {
|
|
358
|
+
o(
|
|
359
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 11, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
360
|
+
);
|
|
361
|
+
const l = i.getByRole("list");
|
|
362
|
+
t(l).toHaveClass("grid-list--10-columns-module"), t(l).not.toHaveClass("grid-list--11-columns-module");
|
|
363
|
+
}), s("should cap large numberOfColumns values", () => {
|
|
364
|
+
o(
|
|
365
|
+
/* @__PURE__ */ e(n, { numberOfColumns: 1e3, children: /* @__PURE__ */ e("li", { children: "Item" }) })
|
|
366
|
+
);
|
|
367
|
+
const l = i.getByRole("list");
|
|
368
|
+
t(l).toHaveClass("grid-list--10-columns-module");
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
});
|