@scrippsproduct/networks-ui-library 1.1.9 → 1.1.10

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.
Files changed (120) hide show
  1. package/dist/{Form.module-Cd8qH2rj.mjs → Form.module-CarfWK5T.mjs} +1 -1
  2. package/dist/ResultsTable.module-wcNUQEKe.mjs +14 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.mjs +8 -0
  4. package/dist/assets/ResultsTable.css +1 -1
  5. package/dist/{chevron-left-DRvpaLmK.mjs → chevron-left-D0UjbrKw.mjs} +1 -1
  6. package/dist/{chevron-right-C8yCnmfx.mjs → chevron-right-0ZF3LruR.mjs} +1 -1
  7. package/dist/components/ActionButton/ActionButton.test.js +209 -0
  8. package/dist/components/AdBlock/AdBlock.test.js +286 -0
  9. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +295 -0
  10. package/dist/components/AirDateFormatter/AirDateFormatter.test.js +192 -0
  11. package/dist/components/AnchorTag/AnchorTag.test.js +463 -0
  12. package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +295 -0
  13. package/dist/components/BasicGridModule/BasicGridModule.js +41 -37
  14. package/dist/components/BasicGridModule/BasicGridModule.test.js +227 -0
  15. package/dist/components/Button/Button.test.js +434 -0
  16. package/dist/components/Carousel/Carousel.js +2 -2
  17. package/dist/components/Carousel/Carousel.test.js +705 -0
  18. package/dist/components/CarouselSlide/CarouselSlide.test.js +378 -0
  19. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
  20. package/dist/components/CastInfoLayout/CastInfoLayout.test.js +294 -0
  21. package/dist/components/ChannelSearch/ChannelSearch.test.js +565 -0
  22. package/dist/components/ChoicesItem/ChoicesItem.test.js +428 -0
  23. package/dist/components/Concat/Concat.js +1 -1
  24. package/dist/components/Concat/Concat.test.js +115 -0
  25. package/dist/components/CtaBlock/CtaBlock.js +1 -1
  26. package/dist/components/CtaBlock/CtaBlock.test.js +226 -0
  27. package/dist/components/CustomDataList/CustomDataList.js +4 -4
  28. package/dist/components/CustomSelect/CustomSelect.js +86 -86
  29. package/dist/components/CustomSelect/CustomSelect.test.js +313 -0
  30. package/dist/components/DateNavigation/DateNavigation.js +10 -10
  31. package/dist/components/DateNavigation/DateNavigation.test.js +370 -0
  32. package/dist/components/DatePicker/DatePicker.js +1 -1
  33. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +288 -0
  34. package/dist/components/DrawerNavigation/DrawerNavigation.test.js +316 -0
  35. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +337 -0
  36. package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +358 -0
  37. package/dist/components/ErrorHandler/ErrorHandler.js +2 -2
  38. package/dist/components/ErrorHandler/ErrorHandler.test.js +158 -0
  39. package/dist/components/FeaturedList/FeaturedList.test.js +353 -0
  40. package/dist/components/Figure/Figure.js +1 -1
  41. package/dist/components/Figure/Figure.test.js +198 -0
  42. package/dist/components/FindUs/FindUs.test.js +499 -0
  43. package/dist/components/FooterNavigation/FooterNavigation.test.js +310 -0
  44. package/dist/components/GenericList/GenericList.js +1 -1
  45. package/dist/components/GenericList/GenericList.test.js +288 -0
  46. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +689 -0
  47. package/dist/components/GradientButton/GradientButton.d.ts +1 -1
  48. package/dist/components/GradientButton/GradientButton.js +33 -31
  49. package/dist/components/GradientButton/GradientButton.test.js +457 -0
  50. package/dist/components/GridList/GridList.test.js +371 -0
  51. package/dist/components/ImageCard/ImageCard.test.js +668 -0
  52. package/dist/components/ImageCard/ImageCardCore.js +28 -28
  53. package/dist/components/ImageCard/ImageCardCore.test.js +577 -0
  54. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +379 -0
  55. package/dist/components/InfoPanel/InfoPanel.js +1 -1
  56. package/dist/components/InlineNavigation/InlineNavigation.test.js +149 -0
  57. package/dist/components/Input/Input.js +1 -1
  58. package/dist/components/Input/Input.test.js +263 -0
  59. package/dist/components/InstructionsList/InstructionsList.js +11 -11
  60. package/dist/components/InstructionsList/InstructionsList.test.js +181 -0
  61. package/dist/components/LogoListItem/LogoListItem.test.js +303 -0
  62. package/dist/components/LogoNavigation/LogoNavigation.test.js +352 -0
  63. package/dist/components/ModalContainer/ModalContainer.js +2 -2
  64. package/dist/components/NavList/NavList.test.js +332 -0
  65. package/dist/components/Overlay/Overlay.js +24 -23
  66. package/dist/components/Overlay/Overlay.test.js +198 -0
  67. package/dist/components/PageHero/PageHero.test.js +241 -0
  68. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
  69. package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
  70. package/dist/components/ProgramAirdate/ProgramAirdate.test.js +414 -0
  71. package/dist/components/PromotionBlock/PromotionBlock.test.js +208 -0
  72. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +221 -0
  73. package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +349 -0
  74. package/dist/components/RescanInstructions/RescanInstructions.test.js +218 -0
  75. package/dist/components/ResponsiveImage/ResponsiveImage.test.js +264 -0
  76. package/dist/components/ResultsTable/ResultsTable.js +9 -2
  77. package/dist/components/ResultsTable/ResultsTable.test.js +402 -0
  78. package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
  79. package/dist/components/ResultsTableBody/ResultsTableBody.test.js +445 -0
  80. package/dist/components/ResultsTableHeader/ResultsTableHeader.js +37 -15
  81. package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +275 -0
  82. package/dist/components/ScheduleLayout/ScheduleContext.js +654 -626
  83. package/dist/components/ScheduleLayout/ScheduleLayout.js +1 -1
  84. package/dist/components/ScheduleLayout/useScheduleContext.js +5 -10
  85. package/dist/components/ScheduleList/ScheduleList.js +1 -1
  86. package/dist/components/SectionedContent/SectionedContent.js +1 -1
  87. package/dist/components/SectionedContent/SectionedContent.test.js +341 -0
  88. package/dist/components/Select/Select.js +24 -24
  89. package/dist/components/Select/Select.test.js +367 -0
  90. package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
  91. package/dist/components/ShowAboutContent/ShowAboutContent.test.js +535 -0
  92. package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +570 -0
  93. package/dist/components/SocialLinks/SocialLinks.js +1 -1
  94. package/dist/components/StringList/StringList.js +1 -1
  95. package/dist/components/StringList/StringList.test.js +311 -0
  96. package/dist/components/TabContent/TabContent.js +1 -1
  97. package/dist/components/TabContent/TabContent.test.js +274 -0
  98. package/dist/components/TabNavigation/TabNavigation.js +21 -21
  99. package/dist/components/TabNavigation/TabNavigation.test.js +535 -0
  100. package/dist/components/TabbedContent/TabbedContent.test.js +654 -0
  101. package/dist/components/TextArea/TextArea.js +1 -1
  102. package/dist/components/UpcomingList/UpcomingList.test.js +471 -0
  103. package/dist/{index-VjANCDXC.mjs → index-06PEPfBQ.mjs} +1 -1
  104. package/dist/index-BUN4jQ3m.mjs +3098 -0
  105. package/dist/index-BVxBrkZB.mjs +3 -0
  106. package/dist/{index-DC2JJV3a.mjs → index-D3kkcgee.mjs} +1 -1
  107. package/dist/{index-C-kn9Zhn.mjs → index-DzfYkULW.mjs} +2 -1
  108. package/dist/magic-string.es-uPKorP4O.mjs +663 -0
  109. package/dist/matchers-35e4d3bd-BBPNTlen.mjs +2404 -0
  110. package/dist/react.esm-DLSrfVwM.mjs +23410 -0
  111. package/dist/test/setupTests.d.ts +1 -0
  112. package/dist/test/setupTests.js +55 -0
  113. package/dist/{triangle-PcCcGXjr.mjs → triangle-C4z906Wf.mjs} +1 -1
  114. package/dist/useScheduleContext-D7FdzNxe.mjs +17 -0
  115. package/dist/utils/analytics.js +1 -1
  116. package/dist/utils/getOnNowProgram.js +10 -10
  117. package/dist/{x-C-QzJ-qD.mjs → x-Ck9Vk5Fo.mjs} +1 -1
  118. package/package.json +4 -1
  119. package/dist/ResultsTable.module-1zxhXaem.mjs +0 -14
  120. package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
@@ -0,0 +1,310 @@
1
+ import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
+ import { v as u, d as c, b as g, a as y, i, r as a, g as e, s as l } from "../../react.esm-DLSrfVwM.mjs";
3
+ import "../../index-BVxBrkZB.mjs";
4
+ import { FooterNavigation as o } from "./FooterNavigation.js";
5
+ u.mock("../NavList", () => ({
6
+ default: ({ classname: d, title: t, links: s }) => /* @__PURE__ */ h(
7
+ "div",
8
+ {
9
+ "data-classname": d,
10
+ "data-links-count": (s == null ? void 0 : s.length) || 0,
11
+ "data-testid": "nav-list",
12
+ "data-title": t,
13
+ children: [
14
+ "NavList Mock - ",
15
+ t
16
+ ]
17
+ }
18
+ )
19
+ }));
20
+ c("FooterNavigation", () => {
21
+ let d;
22
+ g(() => {
23
+ d = document.createElement("div"), d.id = "root", document.body.appendChild(d);
24
+ }), y(() => {
25
+ document.body.removeChild(d);
26
+ }), c("Basic Rendering", () => {
27
+ i("should render nav element", () => {
28
+ a(/* @__PURE__ */ n(o, {}));
29
+ const t = document.querySelector("nav");
30
+ e(t).toBeInTheDocument();
31
+ }), i("should apply footer-navigation CSS class", () => {
32
+ a(/* @__PURE__ */ n(o, {}));
33
+ const t = document.querySelector("nav");
34
+ e(t).toHaveClass("footer-navigation");
35
+ }), i("should have aria-labelledby attribute", () => {
36
+ a(/* @__PURE__ */ n(o, {}));
37
+ const t = document.querySelector("nav");
38
+ e(t).toHaveAttribute("aria-labelledby", "footer-navigation");
39
+ }), i("should render screen reader only heading", () => {
40
+ a(/* @__PURE__ */ n(o, {}));
41
+ const t = document.getElementById("footer-navigation");
42
+ e(t).toBeInTheDocument(), e(t == null ? void 0 : t.tagName).toBe("H4"), e(t).toHaveTextContent("Footer Navigation");
43
+ }), i("should apply sr-only class to heading", () => {
44
+ a(/* @__PURE__ */ n(o, {}));
45
+ const t = document.getElementById("footer-navigation");
46
+ e(t).toHaveClass("sr-only");
47
+ });
48
+ }), c("Sections Rendering", () => {
49
+ i("should render no NavList when sections is empty", () => {
50
+ a(/* @__PURE__ */ n(o, { sections: [] }));
51
+ const t = l.queryAllByTestId("nav-list");
52
+ e(t).toHaveLength(0);
53
+ }), i("should render single section", () => {
54
+ a(/* @__PURE__ */ n(o, { sections: [
55
+ {
56
+ title: "Quick Links",
57
+ links: [{ label: "Home", href: "/" }]
58
+ }
59
+ ] }));
60
+ const s = l.getAllByTestId("nav-list");
61
+ e(s).toHaveLength(1);
62
+ }), i("should render multiple sections", () => {
63
+ a(/* @__PURE__ */ n(o, { sections: [
64
+ { title: "Section 1", links: [] },
65
+ { title: "Section 2", links: [] },
66
+ { title: "Section 3", links: [] }
67
+ ] }));
68
+ const s = l.getAllByTestId("nav-list");
69
+ e(s).toHaveLength(3);
70
+ }), i("should render many sections", () => {
71
+ const t = Array.from({ length: 10 }, (r, v) => ({
72
+ title: `Section ${v + 1}`,
73
+ links: []
74
+ }));
75
+ a(/* @__PURE__ */ n(o, { sections: t }));
76
+ const s = l.getAllByTestId("nav-list");
77
+ e(s).toHaveLength(10);
78
+ }), i("should render sections in correct order", () => {
79
+ a(/* @__PURE__ */ n(o, { sections: [
80
+ { title: "First Section", links: [] },
81
+ { title: "Second Section", links: [] },
82
+ { title: "Third Section", links: [] }
83
+ ] })), e(l.getByText("NavList Mock - First Section")).toBeInTheDocument(), e(l.getByText("NavList Mock - Second Section")).toBeInTheDocument(), e(l.getByText("NavList Mock - Third Section")).toBeInTheDocument();
84
+ });
85
+ }), c("NavList Props", () => {
86
+ i("should pass title to NavList", () => {
87
+ a(/* @__PURE__ */ n(o, { sections: [
88
+ { title: "About Us", links: [] }
89
+ ] }));
90
+ const s = l.getByTestId("nav-list");
91
+ e(s).toHaveAttribute("data-title", "About Us");
92
+ }), i("should pass classname to NavList", () => {
93
+ a(/* @__PURE__ */ n(o, { sections: [
94
+ { classname: "custom-class", title: "Links", links: [] }
95
+ ] }));
96
+ const s = l.getByTestId("nav-list");
97
+ e(s).toHaveAttribute("data-classname", "custom-class");
98
+ }), i("should pass links to NavList", () => {
99
+ a(/* @__PURE__ */ n(o, { sections: [
100
+ {
101
+ title: "Navigation",
102
+ links: [
103
+ { label: "Home", href: "/" },
104
+ { label: "About", href: "/about" },
105
+ { label: "Contact", href: "/contact" }
106
+ ]
107
+ }
108
+ ] }));
109
+ const s = l.getByTestId("nav-list");
110
+ e(s).toHaveAttribute("data-links-count", "3");
111
+ }), i("should handle section without title", () => {
112
+ a(/* @__PURE__ */ n(o, { sections: [
113
+ { links: [{ label: "Link", href: "/" }] }
114
+ ] }));
115
+ const s = l.getByTestId("nav-list");
116
+ e(s.hasAttribute("data-title")).toBe(!1);
117
+ }), i("should handle section without classname", () => {
118
+ a(/* @__PURE__ */ n(o, { sections: [
119
+ { title: "Links", links: [] }
120
+ ] }));
121
+ const s = l.getByTestId("nav-list");
122
+ e(s.hasAttribute("data-classname")).toBe(!1);
123
+ }), i("should handle section without links", () => {
124
+ a(/* @__PURE__ */ n(o, { sections: [
125
+ { title: "Empty Section" }
126
+ ] }));
127
+ const s = l.getByTestId("nav-list");
128
+ e(s).toHaveAttribute("data-links-count", "0");
129
+ }), i("should handle section with empty links array", () => {
130
+ a(/* @__PURE__ */ n(o, { sections: [
131
+ { title: "Empty Links", links: [] }
132
+ ] }));
133
+ const s = l.getByTestId("nav-list");
134
+ e(s).toHaveAttribute("data-links-count", "0");
135
+ });
136
+ }), c("Keys Generation", () => {
137
+ i("should generate unique keys for sections", () => {
138
+ const t = [
139
+ { title: "Section 1", links: [] },
140
+ { title: "Section 2", links: [] },
141
+ { title: "Section 3", links: [] }
142
+ ], { container: s } = a(/* @__PURE__ */ n(o, { sections: t })), r = s.querySelectorAll('[data-testid="nav-list"]');
143
+ e(r).toHaveLength(3);
144
+ }), i("should use index-based keys", () => {
145
+ a(/* @__PURE__ */ n(o, { sections: [
146
+ { title: "Same Title", links: [] },
147
+ { title: "Same Title", links: [] }
148
+ ] }));
149
+ const s = l.getAllByTestId("nav-list");
150
+ e(s).toHaveLength(2);
151
+ });
152
+ }), c("Default Props", () => {
153
+ i("should use empty array as default for sections", () => {
154
+ a(/* @__PURE__ */ n(o, {}));
155
+ const t = l.queryAllByTestId("nav-list");
156
+ e(t).toHaveLength(0);
157
+ }), i("should render correctly without any props", () => {
158
+ const { container: t } = a(/* @__PURE__ */ n(o, {})), s = t.querySelector("nav");
159
+ e(s).toBeInTheDocument(), e(s).toHaveClass("footer-navigation");
160
+ });
161
+ }), c("Section Variations", () => {
162
+ i("should render section with all properties", () => {
163
+ a(/* @__PURE__ */ n(o, { sections: [
164
+ {
165
+ classname: "main-links",
166
+ title: "Main Navigation",
167
+ links: [
168
+ { label: "Home", href: "/" },
169
+ { label: "Products", href: "/products" }
170
+ ]
171
+ }
172
+ ] }));
173
+ const s = l.getByTestId("nav-list");
174
+ e(s).toHaveAttribute("data-classname", "main-links"), e(s).toHaveAttribute("data-title", "Main Navigation"), e(s).toHaveAttribute("data-links-count", "2");
175
+ }), i("should render sections with varying properties", () => {
176
+ a(/* @__PURE__ */ n(o, { sections: [
177
+ {
178
+ classname: "section-1",
179
+ title: "First",
180
+ links: [{ label: "Link 1", href: "/1" }]
181
+ },
182
+ {
183
+ title: "Second",
184
+ links: [
185
+ { label: "Link 2", href: "/2" },
186
+ { label: "Link 3", href: "/3" }
187
+ ]
188
+ },
189
+ {
190
+ classname: "section-3",
191
+ links: []
192
+ }
193
+ ] }));
194
+ const s = l.getAllByTestId("nav-list");
195
+ e(s).toHaveLength(3), e(s[0]).toHaveAttribute("data-links-count", "1"), e(s[1]).toHaveAttribute("data-links-count", "2"), e(s[2]).toHaveAttribute("data-links-count", "0");
196
+ });
197
+ }), c("Accessibility", () => {
198
+ i("should have accessible navigation landmark", () => {
199
+ a(/* @__PURE__ */ n(o, {}));
200
+ const t = l.getByRole("navigation");
201
+ e(t).toBeInTheDocument();
202
+ }), i("should have accessible name via aria-labelledby", () => {
203
+ a(/* @__PURE__ */ n(o, {}));
204
+ const t = l.getByRole("navigation", { name: "Footer Navigation" });
205
+ e(t).toBeInTheDocument();
206
+ }), i("should have heading with correct id for aria-labelledby", () => {
207
+ a(/* @__PURE__ */ n(o, {}));
208
+ const t = document.getElementById("footer-navigation"), s = document.querySelector("nav");
209
+ e(t).toBeInTheDocument(), e(s == null ? void 0 : s.getAttribute("aria-labelledby")).toBe("footer-navigation");
210
+ }), i("should hide heading visually with sr-only", () => {
211
+ a(/* @__PURE__ */ n(o, {}));
212
+ const t = document.getElementById("footer-navigation");
213
+ e(t).toHaveClass("sr-only");
214
+ });
215
+ }), c("Edge Cases", () => {
216
+ i("should handle empty sections array", () => {
217
+ a(/* @__PURE__ */ n(o, { sections: [] }));
218
+ const t = document.querySelector("nav");
219
+ e(t).toBeInTheDocument(), e(l.queryAllByTestId("nav-list")).toHaveLength(0);
220
+ }), i("should handle sections with only empty objects", () => {
221
+ a(/* @__PURE__ */ n(o, { sections: [{}, {}, {}] }));
222
+ const s = l.getAllByTestId("nav-list");
223
+ e(s).toHaveLength(3);
224
+ }), i("should handle sections with special characters in title", () => {
225
+ a(/* @__PURE__ */ n(o, { sections: [
226
+ { title: "Links & Resources", links: [] },
227
+ { title: "FAQ's", links: [] },
228
+ { title: "Contact <Us>", links: [] }
229
+ ] })), e(l.getByText("NavList Mock - Links & Resources")).toBeInTheDocument(), e(l.getByText("NavList Mock - FAQ's")).toBeInTheDocument(), e(l.getByText("NavList Mock - Contact <Us>")).toBeInTheDocument();
230
+ }), i("should handle section with very long title", () => {
231
+ const t = "This is a very long section title that might cause layout issues if not handled properly";
232
+ a(/* @__PURE__ */ n(o, { sections: [
233
+ { title: t, links: [] }
234
+ ] }));
235
+ const r = l.getByTestId("nav-list");
236
+ e(r).toHaveAttribute("data-title", t);
237
+ }), i("should handle section with many links", () => {
238
+ const t = [
239
+ {
240
+ title: "All Links",
241
+ links: Array.from({ length: 50 }, (r, v) => ({
242
+ label: `Link ${v + 1}`,
243
+ href: `/link-${v + 1}`
244
+ }))
245
+ }
246
+ ];
247
+ a(/* @__PURE__ */ n(o, { sections: t }));
248
+ const s = l.getByTestId("nav-list");
249
+ e(s).toHaveAttribute("data-links-count", "50");
250
+ }), i("should handle classname with special characters", () => {
251
+ a(/* @__PURE__ */ n(o, { sections: [
252
+ { classname: "footer__nav--primary", title: "Primary", links: [] }
253
+ ] }));
254
+ const s = l.getByTestId("nav-list");
255
+ e(s).toHaveAttribute("data-classname", "footer__nav--primary");
256
+ }), i("should handle undefined sections prop", () => {
257
+ a(/* @__PURE__ */ n(o, { sections: void 0 }));
258
+ const t = document.querySelector("nav");
259
+ e(t).toBeInTheDocument();
260
+ });
261
+ }), c("Integration", () => {
262
+ i("should render complete footer navigation with multiple sections", () => {
263
+ a(/* @__PURE__ */ n(o, { sections: [
264
+ {
265
+ classname: "footer-nav-about",
266
+ title: "About",
267
+ links: [
268
+ { label: "About Us", href: "/about" },
269
+ { label: "Our Team", href: "/team" },
270
+ { label: "Careers", href: "/careers" }
271
+ ]
272
+ },
273
+ {
274
+ classname: "footer-nav-support",
275
+ title: "Support",
276
+ links: [
277
+ { label: "Help Center", href: "/help" },
278
+ { label: "Contact", href: "/contact" }
279
+ ]
280
+ },
281
+ {
282
+ classname: "footer-nav-legal",
283
+ title: "Legal",
284
+ links: [
285
+ { label: "Privacy Policy", href: "/privacy" },
286
+ { label: "Terms of Service", href: "/terms" }
287
+ ]
288
+ }
289
+ ] }));
290
+ const s = l.getByRole("navigation", { name: "Footer Navigation" });
291
+ e(s).toBeInTheDocument();
292
+ const r = l.getAllByTestId("nav-list");
293
+ e(r).toHaveLength(3), e(l.getByText("NavList Mock - About")).toBeInTheDocument(), e(l.getByText("NavList Mock - Support")).toBeInTheDocument(), e(l.getByText("NavList Mock - Legal")).toBeInTheDocument();
294
+ }), i("should update when sections prop changes", () => {
295
+ const t = [
296
+ { title: "Section 1", links: [] }
297
+ ], { rerender: s } = a(/* @__PURE__ */ n(o, { sections: t }));
298
+ e(l.getAllByTestId("nav-list")).toHaveLength(1), s(/* @__PURE__ */ n(o, { sections: [
299
+ { title: "Section 1", links: [] },
300
+ { title: "Section 2", links: [] },
301
+ { title: "Section 3", links: [] }
302
+ ] })), e(l.getAllByTestId("nav-list")).toHaveLength(3);
303
+ }), i("should render correctly when sections change from empty to populated", () => {
304
+ const { rerender: t } = a(/* @__PURE__ */ n(o, { sections: [] }));
305
+ e(l.queryAllByTestId("nav-list")).toHaveLength(0), t(/* @__PURE__ */ n(o, { sections: [
306
+ { title: "New Section", links: [{ label: "Link", href: "/" }] }
307
+ ] })), e(l.getAllByTestId("nav-list")).toHaveLength(1);
308
+ });
309
+ });
310
+ });
@@ -1,5 +1,5 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { p as c } from "../../index-VjANCDXC.mjs";
2
+ import { p as c } from "../../index-06PEPfBQ.mjs";
3
3
  import { classes as t } from "../../utils/helpers.js";
4
4
  function f({
5
5
  list: s = [],
@@ -0,0 +1,288 @@
1
+ import { jsx as o, jsxs as h } from "react/jsx-runtime";
2
+ import { v as d, d as m, b as y, a as g, i as s, r as l, g as t, s as i } from "../../react.esm-DLSrfVwM.mjs";
3
+ import "../../index-BVxBrkZB.mjs";
4
+ import { GenericList as n } from "./GenericList.js";
5
+ d.mock("html-react-parser", () => ({
6
+ default: (c) => {
7
+ if (c.includes("<strong>"))
8
+ return /* @__PURE__ */ o("strong", { children: c.replace(/<\/?strong>/g, "") });
9
+ if (c.includes("<em>"))
10
+ return /* @__PURE__ */ o("em", { children: c.replace(/<\/?em>/g, "") });
11
+ if (c.includes("<a")) {
12
+ const e = c.match(/href="([^"]+)">([^<]+)/);
13
+ if (e)
14
+ return /* @__PURE__ */ o("a", { href: e[1], children: e[2] });
15
+ }
16
+ return c;
17
+ }
18
+ }));
19
+ d.mock("../../utils/helpers", () => ({
20
+ classes: (c) => c.filter(Boolean).join(" ")
21
+ }));
22
+ m("GenericList", () => {
23
+ let c;
24
+ y(() => {
25
+ c = document.createElement("div"), c.id = "root", document.body.appendChild(c);
26
+ }), g(() => {
27
+ document.body.removeChild(c);
28
+ }), m("Basic Rendering - Unordered List", () => {
29
+ s("should render ul element by default", () => {
30
+ l(/* @__PURE__ */ o(n, { list: ["Item 1"] }));
31
+ const e = document.querySelector("ul");
32
+ t(e).toBeInTheDocument();
33
+ }), s("should render ul when type is unordered", () => {
34
+ l(/* @__PURE__ */ o(n, { list: ["Item 1"], type: "unordered" }));
35
+ const e = document.querySelector("ul");
36
+ t(e).toBeInTheDocument(), t(document.querySelector("ol")).not.toBeInTheDocument();
37
+ }), s("should apply generic-list class to ul", () => {
38
+ l(/* @__PURE__ */ o(n, { list: ["Item 1"] }));
39
+ const e = document.querySelector("ul");
40
+ t(e).toHaveClass("generic-list");
41
+ }), s("should not apply ordered class to unordered list", () => {
42
+ l(/* @__PURE__ */ o(n, { list: ["Item 1"], type: "unordered" }));
43
+ const e = document.querySelector("ul");
44
+ t(e).not.toHaveClass("generic-list--ordered");
45
+ });
46
+ }), m("Basic Rendering - Ordered List", () => {
47
+ s("should render ol when type is ordered", () => {
48
+ l(/* @__PURE__ */ o(n, { list: ["Item 1"], type: "ordered" }));
49
+ const e = document.querySelector("ol");
50
+ t(e).toBeInTheDocument(), t(document.querySelector("ul")).not.toBeInTheDocument();
51
+ }), s("should apply generic-list class to ol", () => {
52
+ l(/* @__PURE__ */ o(n, { list: ["Item 1"], type: "ordered" }));
53
+ const e = document.querySelector("ol");
54
+ t(e).toHaveClass("generic-list");
55
+ }), s("should apply ordered class to ol", () => {
56
+ l(/* @__PURE__ */ o(n, { list: ["Item 1"], type: "ordered" }));
57
+ const e = document.querySelector("ol");
58
+ t(e).toHaveClass("generic-list--ordered");
59
+ });
60
+ }), m("List Items - String Content", () => {
61
+ s("should render string items", () => {
62
+ l(/* @__PURE__ */ o(n, { list: ["Item 1", "Item 2", "Item 3"] })), t(i.getByText("Item 1")).toBeInTheDocument(), t(i.getByText("Item 2")).toBeInTheDocument(), t(i.getByText("Item 3")).toBeInTheDocument();
63
+ }), s("should render correct number of list items", () => {
64
+ l(/* @__PURE__ */ o(n, { list: ["Item 1", "Item 2", "Item 3"] }));
65
+ const e = document.querySelectorAll("li");
66
+ t(e).toHaveLength(3);
67
+ }), s("should apply generic-list__item class to list items", () => {
68
+ l(/* @__PURE__ */ o(n, { list: ["Item 1"] }));
69
+ const e = document.querySelector("li");
70
+ t(e).toHaveClass("generic-list__item");
71
+ }), s("should parse HTML in string items", () => {
72
+ l(/* @__PURE__ */ o(n, { list: ["<strong>Bold text</strong>"] }));
73
+ const e = document.querySelector("strong");
74
+ t(e).toBeInTheDocument(), t(e).toHaveTextContent("Bold text");
75
+ }), s("should parse multiple HTML elements", () => {
76
+ l(/* @__PURE__ */ o(n, { list: ["<em>Italic text</em>", "<strong>Bold text</strong>"] })), t(document.querySelector("em")).toBeInTheDocument(), t(document.querySelector("strong")).toBeInTheDocument();
77
+ }), s("should parse links in string items", () => {
78
+ l(/* @__PURE__ */ o(n, { list: ['<a href="/test">Link text</a>'] }));
79
+ const e = i.getByRole("link");
80
+ t(e).toHaveAttribute("href", "/test"), t(e).toHaveTextContent("Link text");
81
+ }), s("should not parse empty strings", () => {
82
+ l(/* @__PURE__ */ o(n, { list: ["", "Valid item"] }));
83
+ const e = document.querySelectorAll("li");
84
+ t(e).toHaveLength(2), t(e[0]).toHaveTextContent(""), t(e[1]).toHaveTextContent("Valid item");
85
+ });
86
+ }), m("List Items - JSX Content", () => {
87
+ s("should render JSX element items", () => {
88
+ l(/* @__PURE__ */ o(n, { list: [/* @__PURE__ */ o("span", { children: "JSX Content" })] })), t(i.getByText("JSX Content")).toBeInTheDocument();
89
+ }), s("should render multiple JSX elements", () => {
90
+ l(/* @__PURE__ */ o(n, { list: [
91
+ /* @__PURE__ */ o("span", { children: "First" }, "1"),
92
+ /* @__PURE__ */ o("span", { children: "Second" }, "2"),
93
+ /* @__PURE__ */ o("span", { children: "Third" }, "3")
94
+ ] })), t(i.getByText("First")).toBeInTheDocument(), t(i.getByText("Second")).toBeInTheDocument(), t(i.getByText("Third")).toBeInTheDocument();
95
+ }), s("should render complex JSX elements", () => {
96
+ l(/* @__PURE__ */ o(n, { list: [/* @__PURE__ */ h("div", { children: [
97
+ /* @__PURE__ */ o("strong", { children: "Title" }),
98
+ /* @__PURE__ */ o("p", { children: "Description" })
99
+ ] })] })), t(i.getByText("Title")).toBeInTheDocument(), t(i.getByText("Description")).toBeInTheDocument();
100
+ });
101
+ }), m("Mixed Content", () => {
102
+ s("should render mixed string and JSX items", () => {
103
+ l(/* @__PURE__ */ o(n, { list: [
104
+ "String item",
105
+ /* @__PURE__ */ o("span", { children: "JSX item" }, "jsx"),
106
+ "Another string"
107
+ ] })), t(i.getByText("String item")).toBeInTheDocument(), t(i.getByText("JSX item")).toBeInTheDocument(), t(i.getByText("Another string")).toBeInTheDocument();
108
+ }), s("should handle HTML strings mixed with JSX", () => {
109
+ l(/* @__PURE__ */ o(n, { list: [
110
+ "<strong>Bold string</strong>",
111
+ /* @__PURE__ */ o("em", { children: "Italic JSX" }, "jsx")
112
+ ] })), t(document.querySelector("strong")).toHaveTextContent("Bold string"), t(document.querySelector("em")).toHaveTextContent("Italic JSX");
113
+ });
114
+ }), m("Custom Classnames", () => {
115
+ s("should apply custom classname to list", () => {
116
+ l(/* @__PURE__ */ o(n, { classname: "custom-list", list: ["Item"] }));
117
+ const e = document.querySelector("ul");
118
+ t(e).toHaveClass("generic-list"), t(e).toHaveClass("custom-list");
119
+ }), s("should apply custom classname to ordered list", () => {
120
+ l(/* @__PURE__ */ o(n, { classname: "custom-ordered", list: ["Item"], type: "ordered" }));
121
+ const e = document.querySelector("ol");
122
+ t(e).toHaveClass("generic-list"), t(e).toHaveClass("generic-list--ordered"), t(e).toHaveClass("custom-ordered");
123
+ }), s("should apply custom classname__item to list items", () => {
124
+ l(/* @__PURE__ */ o(n, { classname: "custom-list", list: ["Item"] }));
125
+ const e = document.querySelector("li");
126
+ t(e).toHaveClass("generic-list__item"), t(e).toHaveClass("custom-list__item");
127
+ }), s("should handle empty classname", () => {
128
+ l(/* @__PURE__ */ o(n, { classname: "", list: ["Item"] }));
129
+ const e = document.querySelector("ul"), r = document.querySelector("li");
130
+ t(e).toHaveClass("generic-list"), t(r).toHaveClass("generic-list__item");
131
+ }), s("should handle classname with special characters", () => {
132
+ l(/* @__PURE__ */ o(n, { classname: "my-list__special--variant", list: ["Item"] }));
133
+ const e = document.querySelector("ul");
134
+ t(e).toHaveClass("my-list__special--variant");
135
+ });
136
+ }), m("Keys Generation", () => {
137
+ s("should generate generic-list keys when classname is empty", () => {
138
+ const { container: e } = l(/* @__PURE__ */ o(n, { classname: "", list: ["Item 1", "Item 2"] })), r = e.querySelectorAll("li");
139
+ t(r).toHaveLength(2);
140
+ }), s("should generate custom keys when classname is provided", () => {
141
+ const { container: e } = l(/* @__PURE__ */ o(n, { classname: "custom", list: ["Item 1", "Item 2"] })), r = e.querySelectorAll("li");
142
+ t(r).toHaveLength(2);
143
+ }), s("should handle duplicate items with unique keys", () => {
144
+ l(/* @__PURE__ */ o(n, { list: ["Same", "Same", "Same"] }));
145
+ const e = document.querySelectorAll("li");
146
+ t(e).toHaveLength(3);
147
+ });
148
+ }), m("Empty Lists", () => {
149
+ s("should render empty ul with empty list", () => {
150
+ l(/* @__PURE__ */ o(n, { list: [] }));
151
+ const e = document.querySelector("ul");
152
+ t(e).toBeInTheDocument(), t(e == null ? void 0 : e.children).toHaveLength(0);
153
+ }), s("should render empty ol with empty list", () => {
154
+ l(/* @__PURE__ */ o(n, { list: [], type: "ordered" }));
155
+ const e = document.querySelector("ol");
156
+ t(e).toBeInTheDocument(), t(e == null ? void 0 : e.children).toHaveLength(0);
157
+ }), s("should use empty array as default", () => {
158
+ l(/* @__PURE__ */ o(n, {}));
159
+ const e = document.querySelector("ul");
160
+ t(e).toBeInTheDocument(), t(e == null ? void 0 : e.children).toHaveLength(0);
161
+ }), s("should render list with empty string items", () => {
162
+ l(/* @__PURE__ */ o(n, { list: ["", "", ""] }));
163
+ const e = document.querySelectorAll("li");
164
+ t(e).toHaveLength(3);
165
+ });
166
+ }), m("Default Props", () => {
167
+ s("should use unordered as default type", () => {
168
+ l(/* @__PURE__ */ o(n, { list: ["Item"] })), t(document.querySelector("ul")).toBeInTheDocument(), t(document.querySelector("ol")).not.toBeInTheDocument();
169
+ }), s("should use empty array as default list", () => {
170
+ l(/* @__PURE__ */ o(n, {}));
171
+ const e = document.querySelectorAll("li");
172
+ t(e).toHaveLength(0);
173
+ }), s("should use empty string as default classname", () => {
174
+ const { container: e } = l(/* @__PURE__ */ o(n, { list: ["Item"] })), r = e.querySelector("ul");
175
+ t(r == null ? void 0 : r.className).toBe("generic-list");
176
+ });
177
+ }), m("Edge Cases", () => {
178
+ s("should handle very long list", () => {
179
+ const e = Array.from({ length: 100 }, (a, u) => `Item ${u + 1}`);
180
+ l(/* @__PURE__ */ o(n, { list: e }));
181
+ const r = document.querySelectorAll("li");
182
+ t(r).toHaveLength(100);
183
+ }), s("should handle items with special characters", () => {
184
+ l(/* @__PURE__ */ o(n, { list: [
185
+ "Item with 'quotes'",
186
+ 'Item with "double quotes"',
187
+ "Item with & ampersand",
188
+ "Item with <brackets>"
189
+ ] })), t(i.getByText("Item with 'quotes'")).toBeInTheDocument(), t(i.getByText('Item with "double quotes"')).toBeInTheDocument(), t(i.getByText("Item with & ampersand")).toBeInTheDocument();
190
+ }), s("should handle items with unicode characters", () => {
191
+ l(/* @__PURE__ */ o(n, { list: ["Item © 2024", "Item™ trademark", "Item 😊 emoji"] })), t(i.getByText("Item © 2024")).toBeInTheDocument(), t(i.getByText("Item™ trademark")).toBeInTheDocument(), t(i.getByText("Item 😊 emoji")).toBeInTheDocument();
192
+ }), s("should handle very long item text", () => {
193
+ const e = "This is a very long item text that goes on and on and contains a lot of information that might cause layout issues if not handled properly in the component.";
194
+ l(/* @__PURE__ */ o(n, { list: [e] })), t(i.getByText(e)).toBeInTheDocument();
195
+ }), s("should handle whitespace-only strings", () => {
196
+ l(/* @__PURE__ */ o(n, { list: [" ", " ", `
197
+ `] }));
198
+ const e = document.querySelectorAll("li");
199
+ t(e).toHaveLength(3);
200
+ }), s("should handle null-like values gracefully", () => {
201
+ l(/* @__PURE__ */ o(n, { list: ["Valid item", "", "Another valid"] }));
202
+ const r = document.querySelectorAll("li");
203
+ t(r).toHaveLength(3);
204
+ });
205
+ }), m("Conditional Rendering", () => {
206
+ s("should render string item when not empty", () => {
207
+ l(/* @__PURE__ */ o(n, { list: ["Not empty"] }));
208
+ const e = document.querySelector("li");
209
+ t(e).toHaveTextContent("Not empty");
210
+ }), s("should render JSX item directly", () => {
211
+ l(/* @__PURE__ */ o(n, { list: [/* @__PURE__ */ o("span", { children: "JSX Content" })] })), t(i.getByText("JSX Content")).toBeInTheDocument();
212
+ }), s("should not parse JSX elements", () => {
213
+ l(/* @__PURE__ */ o(n, { list: [/* @__PURE__ */ o("span", { "data-testid": "jsx-span", children: "Content" })] })), t(i.getByTestId("jsx-span")).toBeInTheDocument();
214
+ });
215
+ }), m("Integration", () => {
216
+ s("should render complete unordered list with all features", () => {
217
+ l(
218
+ /* @__PURE__ */ o(
219
+ n,
220
+ {
221
+ classname: "feature-list",
222
+ list: [
223
+ "<strong>Bold item</strong>",
224
+ /* @__PURE__ */ o("em", { children: "Italic JSX" }, "em"),
225
+ "Plain text",
226
+ '<a href="/link">Link item</a>'
227
+ ],
228
+ type: "unordered"
229
+ }
230
+ )
231
+ );
232
+ const r = document.querySelector("ul");
233
+ t(r).toHaveClass("generic-list", "feature-list");
234
+ const a = document.querySelectorAll("li");
235
+ t(a).toHaveLength(4), a.forEach((u) => {
236
+ t(u).toHaveClass("generic-list__item", "feature-list__item");
237
+ }), t(document.querySelector("strong")).toHaveTextContent("Bold item"), t(document.querySelector("em")).toHaveTextContent("Italic JSX"), t(i.getByText("Plain text")).toBeInTheDocument(), t(i.getByRole("link")).toHaveTextContent("Link item");
238
+ }), s("should render complete ordered list with all features", () => {
239
+ l(
240
+ /* @__PURE__ */ o(
241
+ n,
242
+ {
243
+ classname: "steps-list",
244
+ list: [
245
+ "First step",
246
+ "Second step",
247
+ "<strong>Third step</strong>"
248
+ ],
249
+ type: "ordered"
250
+ }
251
+ )
252
+ );
253
+ const r = document.querySelector("ol");
254
+ t(r).toHaveClass("generic-list", "generic-list--ordered", "steps-list");
255
+ const a = document.querySelectorAll("li");
256
+ t(a).toHaveLength(3);
257
+ }), s("should update when props change", () => {
258
+ const { rerender: e } = l(
259
+ /* @__PURE__ */ o(n, { list: ["Item 1"], type: "unordered" })
260
+ );
261
+ t(document.querySelector("ul")).toBeInTheDocument(), t(document.querySelectorAll("li")).toHaveLength(1), e(
262
+ /* @__PURE__ */ o(n, { list: ["Item 1", "Item 2", "Item 3"], type: "ordered" })
263
+ ), t(document.querySelector("ol")).toBeInTheDocument(), t(document.querySelector("ul")).not.toBeInTheDocument(), t(document.querySelectorAll("li")).toHaveLength(3);
264
+ }), s("should handle classname changes", () => {
265
+ const { rerender: e } = l(
266
+ /* @__PURE__ */ o(n, { classname: "original", list: ["Item"] })
267
+ );
268
+ let r = document.querySelector("ul");
269
+ t(r).toHaveClass("original"), e(
270
+ /* @__PURE__ */ o(n, { classname: "updated", list: ["Item"] })
271
+ ), r = document.querySelector("ul"), t(r).toHaveClass("updated"), t(r).not.toHaveClass("original");
272
+ });
273
+ }), m("Component Structure", () => {
274
+ s("should have correct DOM hierarchy for unordered list", () => {
275
+ l(/* @__PURE__ */ o(n, { list: ["Item 1", "Item 2"] }));
276
+ const e = document.querySelector("ul"), r = e == null ? void 0 : e.querySelectorAll("li");
277
+ t(e).toBeInTheDocument(), t(r).toHaveLength(2), t(r == null ? void 0 : r[0].parentElement).toBe(e);
278
+ }), s("should have correct DOM hierarchy for ordered list", () => {
279
+ l(/* @__PURE__ */ o(n, { list: ["Item 1", "Item 2"], type: "ordered" }));
280
+ const e = document.querySelector("ol"), r = e == null ? void 0 : e.querySelectorAll("li");
281
+ t(e).toBeInTheDocument(), t(r).toHaveLength(2), t(r == null ? void 0 : r[0].parentElement).toBe(e);
282
+ }), s("should maintain list item order", () => {
283
+ l(/* @__PURE__ */ o(n, { list: ["First", "Second", "Third"] }));
284
+ const e = Array.from(document.querySelectorAll("li"));
285
+ t(e[0]).toHaveTextContent("First"), t(e[1]).toHaveTextContent("Second"), t(e[2]).toHaveTextContent("Third");
286
+ });
287
+ });
288
+ });