@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,428 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { v as a, d as u, b as k, i as d, r as h, g as s, s as m } from "../../react.esm-DLSrfVwM.mjs";
3
+ import { u as g } from "../../index-BUN4jQ3m.mjs";
4
+ import { C as o } from "../../ChoicesItem-CT9fXB0I.mjs";
5
+ const C = a.fn((i) => i.filter(Boolean).join(" "));
6
+ a.mock("../../utils/helpers", () => ({
7
+ classes: (i) => C(i)
8
+ }));
9
+ a.mock("./../CustomSelect/CustomSelect.module.scss", () => ({
10
+ default: {
11
+ "custom-select__item--selected": "custom-select__item--selected-module",
12
+ "custom-select__item--highlighted": "custom-select__item--highlighted-module"
13
+ }
14
+ }));
15
+ u("ChoicesItem Component", () => {
16
+ k(() => {
17
+ a.clearAllMocks();
18
+ });
19
+ const i = (e) => ({
20
+ id: "choice-1",
21
+ parent_id: null,
22
+ label: "Test Choice",
23
+ value: "test-value",
24
+ subcategories: [],
25
+ status: "normal",
26
+ selected: !1,
27
+ ...e
28
+ });
29
+ u("Basic Rendering", () => {
30
+ d("renders li element", () => {
31
+ const e = i(), t = a.fn(), { container: c } = h(
32
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
33
+ );
34
+ s(c.querySelector("li")).toBeInTheDocument();
35
+ }), d("renders choice label as text content", () => {
36
+ const e = i({ label: "My Choice Label" }), t = a.fn();
37
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(m.getByText("My Choice Label")).toBeInTheDocument();
38
+ }), d("sets id attribute from item.id", () => {
39
+ const e = i({ id: "choice-123" }), t = a.fn(), { container: c } = h(
40
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
41
+ ), n = c.querySelector("li");
42
+ s(n).toHaveAttribute("id", "choice-123");
43
+ }), d("returns JSX.Element", () => {
44
+ const e = i(), t = a.fn(), c = h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }));
45
+ s(c.container.firstChild).toBeInstanceOf(HTMLElement);
46
+ });
47
+ }), u("Click Handling", () => {
48
+ d("calls handleOnClick when clicked", async () => {
49
+ const e = g.setup(), t = i({ id: "choice-1" }), c = a.fn();
50
+ h(/* @__PURE__ */ l(o, { handleOnClick: c, item: t }));
51
+ const n = m.getByText("Test Choice");
52
+ await e.click(n), s(c).toHaveBeenCalledTimes(1);
53
+ }), d("passes item.id as string to handleOnClick", async () => {
54
+ const e = g.setup(), t = i({ id: "choice-abc" }), c = a.fn();
55
+ h(/* @__PURE__ */ l(o, { handleOnClick: c, item: t }));
56
+ const n = m.getByText("Test Choice");
57
+ await e.click(n), s(c).toHaveBeenCalledWith("choice-abc");
58
+ }), d("handles numeric id by casting to string", async () => {
59
+ const e = g.setup(), t = i({ id: 42 }), c = a.fn();
60
+ h(/* @__PURE__ */ l(o, { handleOnClick: c, item: t }));
61
+ const n = m.getByText("Test Choice");
62
+ await e.click(n), s(c).toHaveBeenCalledWith(42);
63
+ }), d("calls handleOnClick on each click", async () => {
64
+ const e = g.setup(), t = i(), c = a.fn();
65
+ h(/* @__PURE__ */ l(o, { handleOnClick: c, item: t }));
66
+ const n = m.getByText("Test Choice");
67
+ await e.click(n), await e.click(n), await e.click(n), s(c).toHaveBeenCalledTimes(3);
68
+ }), d("handleOnClick receives consistent id on multiple clicks", async () => {
69
+ const e = g.setup(), t = i({ id: "same-id" }), c = a.fn();
70
+ h(/* @__PURE__ */ l(o, { handleOnClick: c, item: t }));
71
+ const n = m.getByText("Test Choice");
72
+ await e.click(n), await e.click(n), s(c).toHaveBeenNthCalledWith(1, "same-id"), s(c).toHaveBeenNthCalledWith(2, "same-id");
73
+ });
74
+ }), u("Status Classes - Selected", () => {
75
+ d("applies selected classes when status is selected", () => {
76
+ const e = i({ status: "selected" }), t = a.fn(), { container: c } = h(
77
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
78
+ ), n = c.querySelector("li");
79
+ s(n).toHaveClass("custom-select__item--selected-module"), s(n).toHaveClass("custom-select__item--selected");
80
+ }), d("does not apply highlighted classes when status is selected", () => {
81
+ const e = i({ status: "selected" }), t = a.fn(), { container: c } = h(
82
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
83
+ ), n = c.querySelector("li");
84
+ s(n).not.toHaveClass("custom-select__item--highlighted-module"), s(n).not.toHaveClass("custom-select__item--highlighted");
85
+ }), d("calls classes helper with selected class strings", () => {
86
+ const e = i({ status: "selected" }), t = a.fn();
87
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(C).toHaveBeenCalledWith([
88
+ "custom-select__item--selected-module custom-select__item--selected",
89
+ ""
90
+ ]);
91
+ });
92
+ }), u("Status Classes - Highlighted", () => {
93
+ d("applies highlighted classes when status is highlighted", () => {
94
+ const e = i({ status: "highlighted" }), t = a.fn(), { container: c } = h(
95
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
96
+ ), n = c.querySelector("li");
97
+ s(n).toHaveClass("custom-select__item--highlighted-module"), s(n).toHaveClass("custom-select__item--highlighted");
98
+ }), d("does not apply selected classes when status is highlighted", () => {
99
+ const e = i({ status: "highlighted" }), t = a.fn(), { container: c } = h(
100
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
101
+ ), n = c.querySelector("li");
102
+ s(n).not.toHaveClass("custom-select__item--selected-module"), s(n).not.toHaveClass("custom-select__item--selected");
103
+ }), d("calls classes helper with highlighted class strings", () => {
104
+ const e = i({ status: "highlighted" }), t = a.fn();
105
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(C).toHaveBeenCalledWith([
106
+ "",
107
+ "custom-select__item--highlighted-module custom-select__item--highlighted"
108
+ ]);
109
+ });
110
+ }), u("Status Classes - Normal", () => {
111
+ d("does not apply selected or highlighted classes when status is normal", () => {
112
+ const e = i({ status: "normal" }), t = a.fn(), { container: c } = h(
113
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
114
+ ), n = c.querySelector("li");
115
+ s(n == null ? void 0 : n.className).toBe("");
116
+ }), d("calls classes helper with empty strings for normal status", () => {
117
+ const e = i({ status: "normal" }), t = a.fn();
118
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(C).toHaveBeenCalledWith(["", ""]);
119
+ });
120
+ }), u("Status Classes - Filtered", () => {
121
+ d("does not apply selected or highlighted classes when status is filtered", () => {
122
+ const e = i({ status: "filtered" }), t = a.fn(), { container: c } = h(
123
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
124
+ ), n = c.querySelector("li");
125
+ s(n == null ? void 0 : n.className).toBe("");
126
+ }), d("calls classes helper with empty strings for filtered status", () => {
127
+ const e = i({ status: "filtered" }), t = a.fn();
128
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(C).toHaveBeenCalledWith(["", ""]);
129
+ });
130
+ }), u("Status Classes - Active", () => {
131
+ d("does not apply selected or highlighted classes when status is active", () => {
132
+ const e = i({ status: "active" }), t = a.fn(), { container: c } = h(
133
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
134
+ ), n = c.querySelector("li");
135
+ s(n == null ? void 0 : n.className).toBe("");
136
+ }), d("calls classes helper with empty strings for active status", () => {
137
+ const e = i({ status: "active" }), t = a.fn();
138
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(C).toHaveBeenCalledWith(["", ""]);
139
+ });
140
+ }), u("Choice Properties", () => {
141
+ d("handles string id", () => {
142
+ const e = i({ id: "string-id" }), t = a.fn(), { container: c } = h(
143
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
144
+ );
145
+ s(c.querySelector("li")).toHaveAttribute("id", "string-id");
146
+ }), d("handles number id", () => {
147
+ const e = i({ id: 123 }), t = a.fn(), { container: c } = h(
148
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
149
+ );
150
+ s(c.querySelector("li")).toHaveAttribute("id", "123");
151
+ }), d("renders different labels correctly", () => {
152
+ const e = i({ label: "Different Label" }), t = a.fn();
153
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(m.getByText("Different Label")).toBeInTheDocument();
154
+ }), d("renders empty label", () => {
155
+ const e = i({ label: "" }), t = a.fn(), { container: c } = h(
156
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
157
+ ), n = c.querySelector("li");
158
+ s(n == null ? void 0 : n.textContent).toBe("");
159
+ }), d("renders label with special characters", () => {
160
+ const e = i({ label: 'Label & <tag> "quoted"' }), t = a.fn();
161
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(m.getByText('Label & <tag> "quoted"')).toBeInTheDocument();
162
+ }), d("renders very long label", () => {
163
+ const e = "A".repeat(1e3), t = i({ label: e }), c = a.fn();
164
+ h(/* @__PURE__ */ l(o, { handleOnClick: c, item: t })), s(m.getByText(e)).toBeInTheDocument();
165
+ }), d("handles choice with value property", () => {
166
+ const e = i({ value: "custom-value" }), t = a.fn();
167
+ s(
168
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
169
+ ).not.toThrow();
170
+ }), d("handles choice without value property", () => {
171
+ const e = i({ value: void 0 }), t = a.fn();
172
+ s(
173
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
174
+ ).not.toThrow();
175
+ }), d("handles choice with parent_id", () => {
176
+ const e = i({ parent_id: "parent-123" }), t = a.fn();
177
+ s(
178
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
179
+ ).not.toThrow();
180
+ }), d("handles choice with null parent_id", () => {
181
+ const e = i({ parent_id: null }), t = a.fn();
182
+ s(
183
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
184
+ ).not.toThrow();
185
+ }), d("handles choice with subcategories", () => {
186
+ const e = i({
187
+ subcategories: [
188
+ i({ id: "sub-1", label: "Subcategory 1" }),
189
+ i({ id: "sub-2", label: "Subcategory 2" })
190
+ ]
191
+ }), t = a.fn();
192
+ s(
193
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
194
+ ).not.toThrow();
195
+ }), d("handles choice with empty subcategories", () => {
196
+ const e = i({ subcategories: [] }), t = a.fn();
197
+ s(
198
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
199
+ ).not.toThrow();
200
+ }), d("handles choice with selected property true", () => {
201
+ const e = i({ selected: !0 }), t = a.fn();
202
+ s(
203
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
204
+ ).not.toThrow();
205
+ }), d("handles choice with selected property false", () => {
206
+ const e = i({ selected: !1 }), t = a.fn();
207
+ s(
208
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
209
+ ).not.toThrow();
210
+ });
211
+ }), u("Disabled Prop", () => {
212
+ d("accepts disabled prop as true", () => {
213
+ const e = i(), t = a.fn();
214
+ s(
215
+ () => h(/* @__PURE__ */ l(o, { disabled: !0, handleOnClick: t, item: e }))
216
+ ).not.toThrow();
217
+ }), d("accepts disabled prop as false", () => {
218
+ const e = i(), t = a.fn();
219
+ s(
220
+ () => h(/* @__PURE__ */ l(o, { disabled: !1, handleOnClick: t, item: e }))
221
+ ).not.toThrow();
222
+ }), d("accepts disabled prop as undefined", () => {
223
+ const e = i(), t = a.fn();
224
+ s(
225
+ () => h(/* @__PURE__ */ l(o, { disabled: void 0, handleOnClick: t, item: e }))
226
+ ).not.toThrow();
227
+ }), d("disabled prop does not affect click handling", async () => {
228
+ const e = g.setup(), t = i(), c = a.fn();
229
+ h(/* @__PURE__ */ l(o, { disabled: !0, handleOnClick: c, item: t }));
230
+ const n = m.getByText("Test Choice");
231
+ await e.click(n), s(c).toHaveBeenCalled();
232
+ }), d("disabled prop does not add disabled attribute", () => {
233
+ const e = i(), t = a.fn(), { container: c } = h(
234
+ /* @__PURE__ */ l(o, { disabled: !0, handleOnClick: t, item: e })
235
+ ), n = c.querySelector("li");
236
+ s(n).not.toHaveAttribute("disabled");
237
+ }), d("disabled prop does not affect className", () => {
238
+ const e = i({ status: "selected" }), t = a.fn(), { container: c } = h(
239
+ /* @__PURE__ */ l(o, { disabled: !0, handleOnClick: t, item: e })
240
+ ), n = c.querySelector("li");
241
+ s(n).toHaveClass("custom-select__item--selected-module"), s(n).toHaveClass("custom-select__item--selected");
242
+ });
243
+ }), u("Type Safety", () => {
244
+ d("accepts valid Choice object", () => {
245
+ const e = i(), t = a.fn();
246
+ s(
247
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
248
+ ).not.toThrow();
249
+ }), d("accepts handleOnClick with correct signature", () => {
250
+ const e = i(), t = (c) => {
251
+ console.warn(c);
252
+ };
253
+ s(
254
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
255
+ ).not.toThrow();
256
+ }), d("accepts all valid status values", () => {
257
+ const e = [
258
+ "selected",
259
+ "highlighted",
260
+ "normal",
261
+ "filtered",
262
+ "active"
263
+ ], t = a.fn();
264
+ e.forEach((c) => {
265
+ const n = i({ status: c });
266
+ s(
267
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: n }))
268
+ ).not.toThrow();
269
+ });
270
+ }), d("accepts both string and number id types", () => {
271
+ const e = a.fn(), t = i({ id: "string-id" });
272
+ s(
273
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: e, item: t }))
274
+ ).not.toThrow();
275
+ const c = i({ id: 42 });
276
+ s(
277
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: e, item: c }))
278
+ ).not.toThrow();
279
+ }), d("accepts optional disabled prop", () => {
280
+ const e = i(), t = a.fn();
281
+ s(
282
+ () => h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }))
283
+ ).not.toThrow(), s(
284
+ () => h(/* @__PURE__ */ l(o, { disabled: !0, handleOnClick: t, item: e }))
285
+ ).not.toThrow();
286
+ });
287
+ }), u("Integration Scenarios", () => {
288
+ d("renders selected item with specific label and id", () => {
289
+ const e = i({
290
+ id: "selected-choice",
291
+ label: "Selected Option",
292
+ status: "selected"
293
+ }), t = a.fn(), { container: c } = h(
294
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
295
+ ), n = c.querySelector("li");
296
+ s(n).toHaveAttribute("id", "selected-choice"), s(m.getByText("Selected Option")).toBeInTheDocument(), s(n).toHaveClass("custom-select__item--selected-module");
297
+ }), d("renders highlighted item and handles click", async () => {
298
+ const e = g.setup(), t = i({
299
+ id: "highlighted-choice",
300
+ label: "Highlighted Option",
301
+ status: "highlighted"
302
+ }), c = a.fn(), { container: n } = h(
303
+ /* @__PURE__ */ l(o, { handleOnClick: c, item: t })
304
+ ), r = n.querySelector("li");
305
+ s(r).toHaveClass("custom-select__item--highlighted-module"), await e.click(r), s(c).toHaveBeenCalledWith("highlighted-choice");
306
+ }), d("switches between status classes on re-render", () => {
307
+ const e = i({ status: "normal" }), t = a.fn(), { container: c, rerender: n } = h(
308
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
309
+ );
310
+ let r = c.querySelector("li");
311
+ s(r == null ? void 0 : r.className).toBe("");
312
+ const p = { ...e, status: "selected" };
313
+ n(/* @__PURE__ */ l(o, { handleOnClick: t, item: p })), r = c.querySelector("li"), s(r).toHaveClass("custom-select__item--selected-module");
314
+ const f = { ...e, status: "highlighted" };
315
+ n(/* @__PURE__ */ l(o, { handleOnClick: t, item: f })), r = c.querySelector("li"), s(r).toHaveClass("custom-select__item--highlighted-module"), s(r).not.toHaveClass("custom-select__item--selected-module");
316
+ }), d("works in list context with multiple items", () => {
317
+ var r;
318
+ const e = [
319
+ i({ id: "1", label: "Option 1", status: "normal" }),
320
+ i({ id: "2", label: "Option 2", status: "selected" }),
321
+ i({ id: "3", label: "Option 3", status: "highlighted" })
322
+ ], t = a.fn(), { container: c } = h(
323
+ /* @__PURE__ */ l("ul", { children: e.map(
324
+ (p) => /* @__PURE__ */ l(
325
+ o,
326
+ {
327
+ handleOnClick: t,
328
+ item: p
329
+ },
330
+ p.id
331
+ )
332
+ ) })
333
+ ), n = c.querySelectorAll("li");
334
+ s(n).toHaveLength(3), s((r = n[0]) == null ? void 0 : r.className).toBe(""), s(n[1]).toHaveClass("custom-select__item--selected-module"), s(n[2]).toHaveClass("custom-select__item--highlighted-module");
335
+ }), d("handles real-world choice with all properties", async () => {
336
+ const e = g.setup(), t = {
337
+ id: "category-electronics",
338
+ parent_id: "category-root",
339
+ label: "Electronics",
340
+ value: "electronics",
341
+ subcategories: [
342
+ i({ id: "phones", label: "Phones" }),
343
+ i({ id: "laptops", label: "Laptops" })
344
+ ],
345
+ status: "highlighted",
346
+ selected: !1
347
+ }, c = a.fn(), { container: n } = h(
348
+ /* @__PURE__ */ l(o, { handleOnClick: c, item: t })
349
+ );
350
+ s(m.getByText("Electronics")).toBeInTheDocument();
351
+ const r = n.querySelector("li");
352
+ s(r).toHaveAttribute("id", "category-electronics"), s(r).toHaveClass("custom-select__item--highlighted-module"), await e.click(r), s(c).toHaveBeenCalledWith("category-electronics");
353
+ });
354
+ }), u("Edge Cases", () => {
355
+ d("handles label with only whitespace", () => {
356
+ const e = i({ label: " " }), t = a.fn(), { container: c } = h(
357
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
358
+ ), n = c.querySelector("li");
359
+ s(n == null ? void 0 : n.textContent).toBe(" ");
360
+ }), d("handles label with newlines", () => {
361
+ const e = i({ label: `Line 1
362
+ Line 2` }), t = a.fn(), { container: c } = h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), n = c.querySelector("li");
363
+ s(n == null ? void 0 : n.textContent).toBe(`Line 1
364
+ Line 2`);
365
+ }), d("handles zero as id", () => {
366
+ const e = i({ id: 0 }), t = a.fn(), { container: c } = h(
367
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
368
+ );
369
+ s(c.querySelector("li")).toHaveAttribute("id", "0");
370
+ }), d("handles empty string as id", () => {
371
+ const e = i({ id: "" }), t = a.fn(), { container: c } = h(
372
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
373
+ );
374
+ s(c.querySelector("li")).toHaveAttribute("id", "");
375
+ }), d("handles negative number as id", () => {
376
+ const e = i({ id: -1 }), t = a.fn(), { container: c } = h(
377
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
378
+ );
379
+ s(c.querySelector("li")).toHaveAttribute("id", "-1");
380
+ }), d("handles id with special characters", () => {
381
+ const e = i({ id: "choice-@#$%" }), t = a.fn(), { container: c } = h(
382
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
383
+ );
384
+ s(c.querySelector("li")).toHaveAttribute("id", "choice-@#$%");
385
+ }), d("handles rapid clicks", async () => {
386
+ const e = g.setup(), t = i(), c = a.fn();
387
+ h(/* @__PURE__ */ l(o, { handleOnClick: c, item: t }));
388
+ const n = m.getByText("Test Choice");
389
+ await e.click(n), await e.click(n), await e.click(n), await e.click(n), await e.click(n), s(c).toHaveBeenCalledTimes(5);
390
+ }), d("calls handleOnClick even if handler has side effects", async () => {
391
+ const e = g.setup(), t = i();
392
+ let c = 0;
393
+ const n = a.fn(() => {
394
+ c++;
395
+ });
396
+ h(/* @__PURE__ */ l(o, { handleOnClick: n, item: t }));
397
+ const r = m.getByText("Test Choice");
398
+ await e.click(r), s(n).toHaveBeenCalled(), s(c).toBe(1);
399
+ }), d("handles very large numeric id", () => {
400
+ const e = i({ id: 9007199254740991 }), t = a.fn(), { container: c } = h(
401
+ /* @__PURE__ */ l(o, { handleOnClick: t, item: e })
402
+ );
403
+ s(c.querySelector("li")).toHaveAttribute("id", "9007199254740991");
404
+ }), d("handles label with HTML entities", () => {
405
+ const e = i({ label: "&lt;tag&gt; &amp; &quot;text&quot;" }), t = a.fn();
406
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(m.getByText("&lt;tag&gt; &amp; &quot;text&quot;")).toBeInTheDocument();
407
+ }), d("handles unicode characters in label", () => {
408
+ const e = i({ label: "😀 Hello 世界 Привет" }), t = a.fn();
409
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(m.getByText("😀 Hello 世界 Привет")).toBeInTheDocument();
410
+ });
411
+ }), u("Classes Helper Integration", () => {
412
+ d("calls classes helper with correct array structure", () => {
413
+ const e = i({ status: "normal" }), t = a.fn();
414
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(C).toHaveBeenCalledWith(s.any(Array)), s(C).toHaveBeenCalledWith(s.arrayContaining([
415
+ s.any(String),
416
+ s.any(String)
417
+ ]));
418
+ }), d("classes helper receives two elements", () => {
419
+ const e = i({ status: "selected" }), t = a.fn();
420
+ h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e }));
421
+ const c = C.mock.calls[0][0];
422
+ s(c).toHaveLength(2);
423
+ }), d("classes helper called once per render", () => {
424
+ const e = i(), t = a.fn();
425
+ C.mockClear(), h(/* @__PURE__ */ l(o, { handleOnClick: t, item: e })), s(C).toHaveBeenCalledTimes(1);
426
+ });
427
+ });
428
+ });
@@ -1,6 +1,6 @@
1
1
  import { jsx as a, Fragment as n } from "react/jsx-runtime";
2
2
  import { Fragment as o } from "react";
3
- import { p as e } from "../../index-VjANCDXC.mjs";
3
+ import { p as e } from "../../index-06PEPfBQ.mjs";
4
4
  function s({ list: t }) {
5
5
  return /* @__PURE__ */ a(n, { children: t.map((r) => /* @__PURE__ */ a(o, { children: typeof r == "string" && r !== "" ? e(r) : r }, `react-frag-${Math.round(Math.random() * 1e7)}`)) });
6
6
  }
@@ -0,0 +1,115 @@
1
+ import { jsx as n, jsxs as d } from "react/jsx-runtime";
2
+ import { d as a, i as l, r as s, g as t, s as r } from "../../react.esm-DLSrfVwM.mjs";
3
+ import "../../index-BVxBrkZB.mjs";
4
+ import { Concat as i } from "./Concat.js";
5
+ a("Concat", () => {
6
+ a("Basic Rendering", () => {
7
+ l("should render an empty fragment when list is empty", () => {
8
+ const { container: e } = s(/* @__PURE__ */ n(i, { list: [] }));
9
+ t(e.firstChild).toBeNull();
10
+ }), l("should render a single string element", () => {
11
+ s(/* @__PURE__ */ n(i, { list: ["Hello World"] })), t(r.getByText("Hello World")).toBeInTheDocument();
12
+ }), l("should render multiple string elements", () => {
13
+ const { container: e } = s(/* @__PURE__ */ n(i, { list: ["First", "Second", "Third"] }));
14
+ t(e.textContent).toContain("First"), t(e.textContent).toContain("Second"), t(e.textContent).toContain("Third");
15
+ }), l("should render a single JSX element", () => {
16
+ s(/* @__PURE__ */ n(i, { list: [/* @__PURE__ */ n("div", { children: "JSX Content" })] })), t(r.getByText("JSX Content")).toBeInTheDocument();
17
+ }), l("should render multiple JSX elements", () => {
18
+ s(/* @__PURE__ */ n(i, { list: [
19
+ /* @__PURE__ */ n("div", { children: "First JSX" }, "1"),
20
+ /* @__PURE__ */ n("span", { children: "Second JSX" }, "2")
21
+ ] })), t(r.getByText("First JSX")).toBeInTheDocument(), t(r.getByText("Second JSX")).toBeInTheDocument();
22
+ });
23
+ }), a("Mixed Content", () => {
24
+ l("should render mixed string and JSX elements", () => {
25
+ const e = [
26
+ "String content",
27
+ /* @__PURE__ */ n("div", { children: "JSX content" }, "1"),
28
+ "Another string"
29
+ ], { container: o } = s(/* @__PURE__ */ n(i, { list: e }));
30
+ t(o.textContent).toContain("String content"), t(r.getByText("JSX content")).toBeInTheDocument(), t(o.textContent).toContain("Another string");
31
+ }), l("should handle null values in the list", () => {
32
+ const e = [
33
+ "First",
34
+ null,
35
+ "Second",
36
+ null
37
+ ], { container: o } = s(/* @__PURE__ */ n(i, { list: e }));
38
+ t(o.textContent).toContain("First"), t(o.textContent).toContain("Second");
39
+ }), l("should handle empty strings", () => {
40
+ const e = [
41
+ "Valid content",
42
+ "",
43
+ "More content"
44
+ ], { container: o } = s(/* @__PURE__ */ n(i, { list: e }));
45
+ t(o.textContent).toContain("Valid content"), t(o.textContent).toContain("More content");
46
+ }), l("should handle all empty strings", () => {
47
+ const { container: e } = s(/* @__PURE__ */ n(i, { list: ["", "", ""] }));
48
+ t(e.textContent).toBe("");
49
+ });
50
+ }), a("HTML Parsing", () => {
51
+ l("should parse HTML strings", () => {
52
+ s(/* @__PURE__ */ n(i, { list: ["<strong>Bold text</strong>"] }));
53
+ const e = r.getByText("Bold text");
54
+ t(e.tagName).toBe("STRONG");
55
+ }), l("should parse complex HTML strings", () => {
56
+ s(/* @__PURE__ */ n(i, { list: ["<div><span>Nested</span> <em>content</em></div>"] })), t(r.getByText("Nested")).toBeInTheDocument(), t(r.getByText("content")).toBeInTheDocument();
57
+ }), l("should handle multiple HTML strings", () => {
58
+ s(/* @__PURE__ */ n(i, { list: [
59
+ "<p>First paragraph</p>",
60
+ "<p>Second paragraph</p>"
61
+ ] })), t(r.getByText("First paragraph")).toBeInTheDocument(), t(r.getByText("Second paragraph")).toBeInTheDocument();
62
+ }), l("should parse HTML with attributes", () => {
63
+ s(/* @__PURE__ */ n(i, { list: ['<a href="https://example.com">Link text</a>'] }));
64
+ const o = r.getByText("Link text");
65
+ t(o.tagName).toBe("A"), t(o).toHaveAttribute("href", "https://example.com");
66
+ }), l("should handle mixed HTML and plain text strings", () => {
67
+ const e = [
68
+ "Plain text",
69
+ "<strong>Bold text</strong>",
70
+ "More plain text"
71
+ ], { container: o } = s(/* @__PURE__ */ n(i, { list: e }));
72
+ t(o.textContent).toContain("Plain text"), t(r.getByText("Bold text")).toBeInTheDocument(), t(o.textContent).toContain("More plain text");
73
+ });
74
+ }), a("Complex Scenarios", () => {
75
+ l("should handle mixed strings, HTML, JSX, and null values", () => {
76
+ const e = [
77
+ "Plain string",
78
+ "<em>HTML string</em>",
79
+ /* @__PURE__ */ n("div", { children: "JSX element" }, "1"),
80
+ null,
81
+ "",
82
+ "Another string"
83
+ ], { container: o } = s(/* @__PURE__ */ n(i, { list: e }));
84
+ t(o.textContent).toContain("Plain string"), t(r.getByText("HTML string")).toBeInTheDocument(), t(r.getByText("JSX element")).toBeInTheDocument(), t(o.textContent).toContain("Another string");
85
+ }), l("should render nested JSX components", () => {
86
+ s(/* @__PURE__ */ n(i, { list: [/* @__PURE__ */ d("div", { children: [
87
+ /* @__PURE__ */ n("span", { children: "Nested" }),
88
+ /* @__PURE__ */ n("strong", { children: "Component" })
89
+ ] })] })), t(r.getByText("Nested")).toBeInTheDocument(), t(r.getByText("Component")).toBeInTheDocument();
90
+ }), l("should handle list with only null values", () => {
91
+ const { container: e } = s(/* @__PURE__ */ n(i, { list: [null, null, null] }));
92
+ t(e.textContent).toBe("");
93
+ }), l("should render special characters in strings", () => {
94
+ const e = [
95
+ "Text with & ampersand",
96
+ "Text with < and >",
97
+ 'Text with "quotes"'
98
+ ], { container: o } = s(/* @__PURE__ */ n(i, { list: e }));
99
+ t(o.textContent).toContain("Text with & ampersand"), t(o.textContent).toContain("Text with < and >"), t(o.textContent).toContain('Text with "quotes"');
100
+ });
101
+ }), a("Edge Cases", () => {
102
+ l("should handle very long lists", () => {
103
+ const e = Array.from({ length: 100 }, (h, c) => `Item ${c + 1}`), { container: o } = s(/* @__PURE__ */ n(i, { list: e }));
104
+ t(o.textContent).toContain("Item 1"), t(o.textContent).toContain("Item 50"), t(o.textContent).toContain("Item 100");
105
+ }), l("should handle strings with only whitespace", () => {
106
+ const e = [" ", `
107
+ `, " "];
108
+ s(/* @__PURE__ */ n(i, { list: e }));
109
+ const { container: o } = s(/* @__PURE__ */ n(i, { list: e }));
110
+ t(o.textContent).toMatch(/\s+/);
111
+ }), l("should handle HTML entities", () => {
112
+ s(/* @__PURE__ */ n(i, { list: ["<p>&copy; 2024 &mdash; Test &amp; Co.</p>"] })), t(r.getByText(/© 2024 — Test & Co./)).toBeInTheDocument();
113
+ });
114
+ });
115
+ });
@@ -1,5 +1,5 @@
1
1
  import { jsxs as h, jsx as l } from "react/jsx-runtime";
2
- import { p as s } from "../../index-VjANCDXC.mjs";
2
+ import { p as s } from "../../index-06PEPfBQ.mjs";
3
3
  import { classes as m } from "../../utils/helpers.js";
4
4
  import { l as b } from "../../logger-C0N7U0YY.mjs";
5
5
  import { GradientButton as u } from "../GradientButton/GradientButton.js";