@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.
Files changed (121) 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/assets/ScheduleLayout.css +1 -1
  6. package/dist/{chevron-left-DRvpaLmK.mjs → chevron-left-D0UjbrKw.mjs} +1 -1
  7. package/dist/{chevron-right-C8yCnmfx.mjs → chevron-right-0ZF3LruR.mjs} +1 -1
  8. package/dist/components/ActionButton/ActionButton.test.js +209 -0
  9. package/dist/components/AdBlock/AdBlock.test.js +286 -0
  10. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +295 -0
  11. package/dist/components/AirDateFormatter/AirDateFormatter.test.js +192 -0
  12. package/dist/components/AnchorTag/AnchorTag.test.js +463 -0
  13. package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +295 -0
  14. package/dist/components/BasicGridModule/BasicGridModule.js +41 -37
  15. package/dist/components/BasicGridModule/BasicGridModule.test.js +227 -0
  16. package/dist/components/Button/Button.test.js +434 -0
  17. package/dist/components/Carousel/Carousel.js +2 -2
  18. package/dist/components/Carousel/Carousel.test.js +705 -0
  19. package/dist/components/CarouselSlide/CarouselSlide.test.js +378 -0
  20. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
  21. package/dist/components/CastInfoLayout/CastInfoLayout.test.js +294 -0
  22. package/dist/components/ChannelSearch/ChannelSearch.test.js +565 -0
  23. package/dist/components/ChoicesItem/ChoicesItem.test.js +428 -0
  24. package/dist/components/Concat/Concat.js +1 -1
  25. package/dist/components/Concat/Concat.test.js +115 -0
  26. package/dist/components/CtaBlock/CtaBlock.js +1 -1
  27. package/dist/components/CtaBlock/CtaBlock.test.js +226 -0
  28. package/dist/components/CustomDataList/CustomDataList.js +4 -4
  29. package/dist/components/CustomSelect/CustomSelect.js +86 -86
  30. package/dist/components/CustomSelect/CustomSelect.test.js +313 -0
  31. package/dist/components/DateNavigation/DateNavigation.js +10 -10
  32. package/dist/components/DateNavigation/DateNavigation.test.js +370 -0
  33. package/dist/components/DatePicker/DatePicker.js +1 -1
  34. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +288 -0
  35. package/dist/components/DrawerNavigation/DrawerNavigation.test.js +316 -0
  36. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +337 -0
  37. package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +358 -0
  38. package/dist/components/ErrorHandler/ErrorHandler.js +2 -2
  39. package/dist/components/ErrorHandler/ErrorHandler.test.js +158 -0
  40. package/dist/components/FeaturedList/FeaturedList.test.js +353 -0
  41. package/dist/components/Figure/Figure.js +1 -1
  42. package/dist/components/Figure/Figure.test.js +198 -0
  43. package/dist/components/FindUs/FindUs.test.js +499 -0
  44. package/dist/components/FooterNavigation/FooterNavigation.test.js +310 -0
  45. package/dist/components/GenericList/GenericList.js +1 -1
  46. package/dist/components/GenericList/GenericList.test.js +288 -0
  47. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +689 -0
  48. package/dist/components/GradientButton/GradientButton.d.ts +1 -1
  49. package/dist/components/GradientButton/GradientButton.js +33 -31
  50. package/dist/components/GradientButton/GradientButton.test.js +457 -0
  51. package/dist/components/GridList/GridList.test.js +371 -0
  52. package/dist/components/ImageCard/ImageCard.test.js +668 -0
  53. package/dist/components/ImageCard/ImageCardCore.js +28 -28
  54. package/dist/components/ImageCard/ImageCardCore.test.js +577 -0
  55. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +379 -0
  56. package/dist/components/InfoPanel/InfoPanel.js +1 -1
  57. package/dist/components/InlineNavigation/InlineNavigation.test.js +149 -0
  58. package/dist/components/Input/Input.js +1 -1
  59. package/dist/components/Input/Input.test.js +263 -0
  60. package/dist/components/InstructionsList/InstructionsList.js +11 -11
  61. package/dist/components/InstructionsList/InstructionsList.test.js +181 -0
  62. package/dist/components/LogoListItem/LogoListItem.test.js +303 -0
  63. package/dist/components/LogoNavigation/LogoNavigation.test.js +352 -0
  64. package/dist/components/ModalContainer/ModalContainer.js +2 -2
  65. package/dist/components/NavList/NavList.test.js +332 -0
  66. package/dist/components/Overlay/Overlay.js +24 -23
  67. package/dist/components/Overlay/Overlay.test.js +198 -0
  68. package/dist/components/PageHero/PageHero.test.js +241 -0
  69. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
  70. package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
  71. package/dist/components/ProgramAirdate/ProgramAirdate.test.js +414 -0
  72. package/dist/components/PromotionBlock/PromotionBlock.test.js +208 -0
  73. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +221 -0
  74. package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +349 -0
  75. package/dist/components/RescanInstructions/RescanInstructions.test.js +218 -0
  76. package/dist/components/ResponsiveImage/ResponsiveImage.test.js +264 -0
  77. package/dist/components/ResultsTable/ResultsTable.js +9 -2
  78. package/dist/components/ResultsTable/ResultsTable.test.js +402 -0
  79. package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
  80. package/dist/components/ResultsTableBody/ResultsTableBody.test.js +445 -0
  81. package/dist/components/ResultsTableHeader/ResultsTableHeader.js +37 -15
  82. package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +275 -0
  83. package/dist/components/ScheduleLayout/ScheduleContext.js +654 -626
  84. package/dist/components/ScheduleLayout/ScheduleLayout.js +1 -1
  85. package/dist/components/ScheduleLayout/useScheduleContext.js +5 -10
  86. package/dist/components/ScheduleList/ScheduleList.js +1 -1
  87. package/dist/components/SectionedContent/SectionedContent.js +1 -1
  88. package/dist/components/SectionedContent/SectionedContent.test.js +341 -0
  89. package/dist/components/Select/Select.js +24 -24
  90. package/dist/components/Select/Select.test.js +367 -0
  91. package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
  92. package/dist/components/ShowAboutContent/ShowAboutContent.test.js +535 -0
  93. package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +570 -0
  94. package/dist/components/SocialLinks/SocialLinks.js +1 -1
  95. package/dist/components/StringList/StringList.js +1 -1
  96. package/dist/components/StringList/StringList.test.js +311 -0
  97. package/dist/components/TabContent/TabContent.js +1 -1
  98. package/dist/components/TabContent/TabContent.test.js +274 -0
  99. package/dist/components/TabNavigation/TabNavigation.js +21 -21
  100. package/dist/components/TabNavigation/TabNavigation.test.js +535 -0
  101. package/dist/components/TabbedContent/TabbedContent.test.js +654 -0
  102. package/dist/components/TextArea/TextArea.js +1 -1
  103. package/dist/components/UpcomingList/UpcomingList.test.js +471 -0
  104. package/dist/{index-VjANCDXC.mjs → index-06PEPfBQ.mjs} +1 -1
  105. package/dist/index-BUN4jQ3m.mjs +3098 -0
  106. package/dist/index-BVxBrkZB.mjs +3 -0
  107. package/dist/{index-DC2JJV3a.mjs → index-D3kkcgee.mjs} +1 -1
  108. package/dist/{index-C-kn9Zhn.mjs → index-DzfYkULW.mjs} +2 -1
  109. package/dist/magic-string.es-uPKorP4O.mjs +663 -0
  110. package/dist/matchers-35e4d3bd-BBPNTlen.mjs +2404 -0
  111. package/dist/react.esm-DLSrfVwM.mjs +23410 -0
  112. package/dist/test/setupTests.d.ts +1 -0
  113. package/dist/test/setupTests.js +55 -0
  114. package/dist/{triangle-PcCcGXjr.mjs → triangle-C4z906Wf.mjs} +1 -1
  115. package/dist/useScheduleContext-D7FdzNxe.mjs +17 -0
  116. package/dist/utils/analytics.js +1 -1
  117. package/dist/utils/getOnNowProgram.js +10 -10
  118. package/dist/{x-C-QzJ-qD.mjs → x-Ck9Vk5Fo.mjs} +1 -1
  119. package/package.json +4 -1
  120. package/dist/ResultsTable.module-1zxhXaem.mjs +0 -14
  121. package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
@@ -0,0 +1,471 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { v as i, d as h, b as f, i as l, r, g as s, s as C } from "../../react.esm-DLSrfVwM.mjs";
3
+ import "../../index-BVxBrkZB.mjs";
4
+ import { UpcomingList as c } from "./UpcomingList.js";
5
+ const p = i.fn(), m = i.fn(), u = i.fn();
6
+ i.mock("../../utils/helpers", () => ({
7
+ getMinutesFromStr: (t) => p(t),
8
+ classes: (t) => u(t)
9
+ }));
10
+ i.mock("../../utils/date-helpers", () => ({
11
+ determineIfShowIsOnNow: (t, o) => m(t, o)
12
+ }));
13
+ i.mock("../Concat", () => ({
14
+ default: ({ list: t }) => /* @__PURE__ */ a("div", { "data-component": "Concat", "data-list": JSON.stringify(t), children: "Concat Component" })
15
+ }));
16
+ i.mock("../StringList", () => ({
17
+ default: ({ list: t, separatorType: o }) => /* @__PURE__ */ a(
18
+ "div",
19
+ {
20
+ "data-component": "StringList",
21
+ "data-list": JSON.stringify(t),
22
+ "data-separator": o,
23
+ children: "StringList Component"
24
+ }
25
+ )
26
+ }));
27
+ i.mock("../AirDateFormatter", () => ({
28
+ default: ({ airdateStr: t, separatorType: o }) => /* @__PURE__ */ a(
29
+ "div",
30
+ {
31
+ "data-airdate": t,
32
+ "data-component": "AirDateFormatter",
33
+ "data-separator": o,
34
+ children: "AirDateFormatter Component"
35
+ }
36
+ )
37
+ }));
38
+ i.mock("../ImageCard", () => ({
39
+ default: (t) => {
40
+ const { handleClicks: o, content: e, ...d } = t;
41
+ return /* @__PURE__ */ a(
42
+ "div",
43
+ {
44
+ "data-component": "ImageCard",
45
+ "data-has-content": e !== void 0 ? "true" : "false",
46
+ "data-has-handleclicks": o !== void 0 ? "true" : "false",
47
+ "data-props": JSON.stringify(d),
48
+ children: "ImageCard Component"
49
+ }
50
+ );
51
+ }
52
+ }));
53
+ const n = (t) => ({
54
+ id: 123,
55
+ airdate: "2023-02-02 06:00:00",
56
+ title: {
57
+ synopsis: "Test synopsis",
58
+ image: {
59
+ url: "https://example.com/image.jpg",
60
+ aspect_ratio: 16 / 9
61
+ },
62
+ video: {
63
+ brightcove_id: "video123"
64
+ },
65
+ episode_number: "301",
66
+ name: "Episode Name",
67
+ rating: "TV-14",
68
+ element_length: "01:00"
69
+ },
70
+ program: {
71
+ title: "Program Title"
72
+ },
73
+ ...t
74
+ });
75
+ h("UpcomingList", () => {
76
+ f(() => {
77
+ i.clearAllMocks(), u.mockImplementation((t) => t.filter(Boolean).join(" ")), p.mockReturnValue("60 min"), m.mockReturnValue(!1);
78
+ }), h("Basic Rendering", () => {
79
+ l("should render ul element with correct class", () => {
80
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector("ul");
81
+ s(e).toBeInTheDocument();
82
+ }), l("should render empty ul when list is empty", () => {
83
+ const { container: t } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: [] })), o = t.querySelector("ul");
84
+ s(o).toBeInTheDocument(), s(o == null ? void 0 : o.children).toHaveLength(0);
85
+ }), l("should render list items for each item in list", () => {
86
+ const t = [
87
+ n({ id: 1 }),
88
+ n({ id: 2 }),
89
+ n({ id: 3 })
90
+ ], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelectorAll("li");
91
+ s(e).toHaveLength(3);
92
+ }), l("should not render list items when list is empty", () => {
93
+ const { container: t } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: [] })), o = t.querySelectorAll("li");
94
+ s(o).toHaveLength(0);
95
+ });
96
+ }), h("List Item Structure", () => {
97
+ l("should render list item with correct key", () => {
98
+ const t = [n({ id: 456 })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector("li");
99
+ s(e).toBeInTheDocument();
100
+ }), l("should render airdate section in each list item", () => {
101
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="AirDateFormatter"]');
102
+ s(e).toBeInTheDocument();
103
+ }), l("should render ImageCard in each list item", () => {
104
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]');
105
+ s(e).toBeInTheDocument();
106
+ }), l("should apply classes helper to list item", () => {
107
+ const t = [n()];
108
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(u).toHaveBeenCalled();
109
+ });
110
+ }), h("AirDateFormatter Integration", () => {
111
+ l("should pass airdate to AirDateFormatter", () => {
112
+ const t = [n({ airdate: "2024-01-15 19:00:00" })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="AirDateFormatter"]');
113
+ s(e).toHaveAttribute("data-airdate", "2024-01-15 19:00:00");
114
+ }), l("should use line-break separator for AirDateFormatter", () => {
115
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="AirDateFormatter"]');
116
+ s(e).toHaveAttribute("data-separator", "line-break");
117
+ });
118
+ }), h("On Now Indicator", () => {
119
+ l('should render "On Now" when show is currently airing', () => {
120
+ m.mockReturnValue(!0);
121
+ const t = [n({
122
+ airdate: "2024-01-15 19:00:00",
123
+ title: {
124
+ ...n().title,
125
+ element_length: "01:00"
126
+ }
127
+ })];
128
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(C.getByText("On Now")).toBeInTheDocument();
129
+ }), l('should not render "On Now" when show is not currently airing', () => {
130
+ m.mockReturnValue(!1);
131
+ const t = [n()];
132
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(C.queryByText("On Now")).not.toBeInTheDocument();
133
+ }), l("should call determineIfShowIsOnNow with airdate and element_length", () => {
134
+ const t = [n({
135
+ airdate: "2024-01-15 19:00:00",
136
+ title: {
137
+ ...n().title,
138
+ element_length: "02:30"
139
+ }
140
+ })];
141
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(m).toHaveBeenCalledWith("2024-01-15 19:00:00", "02:30");
142
+ }), l('should not render "On Now" when element_length is missing', () => {
143
+ m.mockReturnValue(!0);
144
+ const t = [n({
145
+ title: {
146
+ ...n().title,
147
+ element_length: void 0
148
+ }
149
+ })];
150
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(C.queryByText("On Now")).not.toBeInTheDocument();
151
+ }), l('should have correct class on "On Now" div', () => {
152
+ m.mockReturnValue(!0);
153
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector(".upcoming-list__on-now");
154
+ s(e).toBeInTheDocument();
155
+ });
156
+ }), h("ImageCard Props Construction", () => {
157
+ l("should pass displayInline true to ImageCard", () => {
158
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
159
+ s(d.displayInline).toBe(!0);
160
+ }), l("should pass clampContentLines false to ImageCard", () => {
161
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
162
+ s(d.clampContentLines).toBe(!1);
163
+ }), l("should pass handleClicks to ImageCard", () => {
164
+ const t = i.fn(), o = [n()], { container: e } = r(/* @__PURE__ */ a(c, { handleClicks: t, list: o })), d = e.querySelector('[data-component="ImageCard"]');
165
+ s(d).toHaveAttribute("data-has-handleclicks", "true");
166
+ }), l("should pass item id to ImageCard", () => {
167
+ const t = [n({ id: 789 })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
168
+ s(d.id).toBe(789);
169
+ }), l("should pass empty title to ImageCard", () => {
170
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
171
+ s(d.title).toBe("");
172
+ }), l("should construct image object with correct properties", () => {
173
+ const t = [n({
174
+ title: {
175
+ ...n().title,
176
+ image: {
177
+ url: "https://example.com/custom.jpg",
178
+ aspect_ratio: 2.5
179
+ }
180
+ }
181
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
182
+ s(d.image.url).toBe("https://example.com/custom.jpg"), s(d.image.altText).toBe(""), s(d.image.aspectRatio).toBe(330 / 185);
183
+ });
184
+ }), h("CTA with Brightcove Video", () => {
185
+ l('should create "Watch Episode" CTA when brightcove_id exists', () => {
186
+ const t = [n({
187
+ title: {
188
+ ...n().title,
189
+ video: {
190
+ brightcove_id: "video456"
191
+ }
192
+ }
193
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
194
+ s(d.cta.label).toBe("Watch Episode"), s(d.cta.type).toBe("play-video");
195
+ }), l("should set relatedResourceId to brightcove_id", () => {
196
+ const t = [n({
197
+ title: {
198
+ ...n().title,
199
+ video: {
200
+ brightcove_id: "bc123"
201
+ }
202
+ }
203
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
204
+ s(d.cta.relatedResourceId).toBe("bc123");
205
+ }), l("should set CTA position to inline", () => {
206
+ const t = [n({
207
+ title: {
208
+ ...n().title,
209
+ video: {
210
+ brightcove_id: "video789"
211
+ }
212
+ }
213
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
214
+ s(d.cta.position).toBe("inline");
215
+ }), l("should set CTA href to empty string", () => {
216
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
217
+ s(d.cta.href).toBe("");
218
+ });
219
+ }), h("CTA without Brightcove Video", () => {
220
+ l("should create empty CTA when brightcove_id is missing", () => {
221
+ const t = [n({
222
+ title: {
223
+ ...n().title,
224
+ video: {
225
+ brightcove_id: ""
226
+ }
227
+ }
228
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
229
+ s(d.cta.label).toBe(""), s(d.cta.type).toBe(""), s(d.cta.href).toBe("");
230
+ }), l("should create empty CTA when brightcove_id is empty string", () => {
231
+ const t = [n({
232
+ title: {
233
+ ...n().title,
234
+ video: {
235
+ brightcove_id: ""
236
+ }
237
+ }
238
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
239
+ s(d.cta.label).toBe("");
240
+ });
241
+ }), h("Concat Content", () => {
242
+ l("should render Concat component in ImageCard content", () => {
243
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]');
244
+ s(e).toHaveAttribute("data-has-content", "true");
245
+ }), l("should include episode HTML in Concat list", () => {
246
+ const t = [n({
247
+ title: {
248
+ ...n().title,
249
+ episode_number: "405",
250
+ name: "Test Episode",
251
+ synopsis: "Test synopsis content"
252
+ }
253
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]');
254
+ s(e).toHaveAttribute("data-has-content", "true");
255
+ });
256
+ }), h("StringList Integration", () => {
257
+ l("should render StringList with runtime and rating when no video", () => {
258
+ p.mockReturnValue("45 min");
259
+ const t = [n({
260
+ title: {
261
+ ...n().title,
262
+ element_length: "00:45",
263
+ rating: "PG-13",
264
+ video: {
265
+ brightcove_id: ""
266
+ }
267
+ }
268
+ })];
269
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(p).toHaveBeenCalledWith("00:45");
270
+ }), l("should include nbsp when brightcove_id exists", () => {
271
+ const t = [n({
272
+ title: {
273
+ ...n().title,
274
+ video: {
275
+ brightcove_id: "video123"
276
+ }
277
+ }
278
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]');
279
+ s(e).toHaveAttribute("data-has-content", "true");
280
+ }), l("should use pipe separator for StringList", () => {
281
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]');
282
+ s(e).toHaveAttribute("data-has-content", "true");
283
+ }), l("should call getMinutesFromStr with element_length", () => {
284
+ const t = [n({
285
+ title: {
286
+ ...n().title,
287
+ element_length: "02:15"
288
+ }
289
+ })];
290
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(p).toHaveBeenCalledWith("02:15");
291
+ });
292
+ }), h("CSS Classes", () => {
293
+ l("should apply classes helper to list item", () => {
294
+ const t = [n()];
295
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(u).toHaveBeenCalled();
296
+ }), l("should apply classes helper to airdate div", () => {
297
+ const t = [n()];
298
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(u).toHaveBeenCalledWith(
299
+ s.arrayContaining([
300
+ s.anything(),
301
+ "upcoming-list__airdate"
302
+ ])
303
+ );
304
+ }), l("should apply classes helper to airdate-bg div", () => {
305
+ const t = [n()];
306
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(u).toHaveBeenCalledWith(
307
+ s.arrayContaining([
308
+ s.anything(),
309
+ "upcoming-list__airdate-bg"
310
+ ])
311
+ );
312
+ });
313
+ }), h("Default Props", () => {
314
+ l("should use default handleClicks when not provided", () => {
315
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: () => !0, list: t }));
316
+ s(o.querySelector("ul")).toBeInTheDocument();
317
+ });
318
+ }), h("Multiple Items", () => {
319
+ l("should render all items in list", () => {
320
+ const t = [
321
+ n({ id: 1 }),
322
+ n({ id: 2 }),
323
+ n({ id: 3 }),
324
+ n({ id: 4 }),
325
+ n({ id: 5 })
326
+ ], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelectorAll("li");
327
+ s(e).toHaveLength(5);
328
+ }), l("should call getMinutesFromStr for each item", () => {
329
+ const t = [
330
+ n({ id: 1 }),
331
+ n({ id: 2 }),
332
+ n({ id: 3 })
333
+ ];
334
+ r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), s(p).toHaveBeenCalledTimes(3);
335
+ }), l("should generate unique keys for each list item", () => {
336
+ const t = [
337
+ n({ id: 100 }),
338
+ n({ id: 200 }),
339
+ n({ id: 300 })
340
+ ], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelectorAll("li");
341
+ s(e).toHaveLength(3);
342
+ });
343
+ }), h("Edge Cases", () => {
344
+ l("should handle item with missing episode_number", () => {
345
+ const t = [n({
346
+ title: {
347
+ ...n().title,
348
+ episode_number: void 0
349
+ }
350
+ })];
351
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t }))).not.toThrow();
352
+ }), l("should handle item with empty string episode_number", () => {
353
+ const t = [n({
354
+ title: {
355
+ ...n().title,
356
+ episode_number: ""
357
+ }
358
+ })];
359
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t }))).not.toThrow();
360
+ }), l("should handle item with missing element_length", () => {
361
+ const t = [n({
362
+ title: {
363
+ ...n().title,
364
+ element_length: void 0
365
+ }
366
+ })];
367
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t }))).not.toThrow();
368
+ }), l("should handle item with empty synopsis", () => {
369
+ const t = [n({
370
+ title: {
371
+ ...n().title,
372
+ synopsis: ""
373
+ }
374
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]');
375
+ s(e).toHaveAttribute("data-has-content", "true");
376
+ }), l("should handle item with very long synopsis", () => {
377
+ const t = "Lorem ipsum ".repeat(100), o = [n({
378
+ title: {
379
+ ...n().title,
380
+ synopsis: t
381
+ }
382
+ })];
383
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: o }))).not.toThrow();
384
+ }), l("should handle item with special characters in name", () => {
385
+ const t = [n({
386
+ title: {
387
+ ...n().title,
388
+ name: "Episode & Special <Characters>"
389
+ }
390
+ })];
391
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t }))).not.toThrow();
392
+ }), l("should handle item with empty image url", () => {
393
+ const t = [n({
394
+ title: {
395
+ ...n().title,
396
+ image: {
397
+ url: "",
398
+ aspect_ratio: 1.7777777777777777
399
+ }
400
+ }
401
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
402
+ s(d.image.url).toBe("");
403
+ }), l("should handle item with zero aspect ratio", () => {
404
+ const t = [n({
405
+ title: {
406
+ ...n().title,
407
+ image: {
408
+ url: "https://example.com/image.jpg",
409
+ aspect_ratio: 0
410
+ }
411
+ }
412
+ })];
413
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t }))).not.toThrow();
414
+ }), l("should handle item with negative id", () => {
415
+ const t = [n({ id: -1 })];
416
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t }))).not.toThrow();
417
+ }), l("should handle large list of items", () => {
418
+ const t = Array.from(
419
+ { length: 50 },
420
+ (d, g) => n({ id: g })
421
+ ), { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelectorAll("li");
422
+ s(e).toHaveLength(50);
423
+ });
424
+ }), h("Type Safety", () => {
425
+ l("should accept valid UpcomingItem list", () => {
426
+ const t = [n()];
427
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t }))).not.toThrow();
428
+ }), l("should accept valid handleClicks function", () => {
429
+ const t = (e) => (s(e).toBeDefined(), !0), o = [n()];
430
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: t, list: o }))).not.toThrow();
431
+ }), l("should accept handleClicks that returns void", () => {
432
+ const t = (e) => {
433
+ s(e).toBeDefined();
434
+ }, o = [n()];
435
+ s(() => r(/* @__PURE__ */ a(c, { handleClicks: t, list: o }))).not.toThrow();
436
+ });
437
+ }), h("Integration Tests", () => {
438
+ l("should render complete upcoming list structure", () => {
439
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t }));
440
+ s(o.querySelector("ul")).toBeInTheDocument(), s(o.querySelector("li")).toBeInTheDocument(), s(o.querySelector('[data-component="AirDateFormatter"]')).toBeInTheDocument(), s(o.querySelector('[data-component="ImageCard"]')).toBeInTheDocument();
441
+ }), l("should pass all required props to child components", () => {
442
+ const t = [n()], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="ImageCard"]'), d = JSON.parse((e == null ? void 0 : e.getAttribute("data-props")) || "{}");
443
+ s(d.displayInline).toBeDefined(), s(d.clampContentLines).toBeDefined(), s(e).toHaveAttribute("data-has-content", "true"), s(d.cta).toBeDefined(), s(e).toHaveAttribute("data-has-handleclicks", "true"), s(d.id).toBeDefined(), s(d.image).toBeDefined(), s(d.title).toBeDefined();
444
+ }), l("should coordinate all components for complete item rendering", () => {
445
+ const t = [n({
446
+ id: 999,
447
+ airdate: "2024-01-15 20:00:00",
448
+ title: {
449
+ synopsis: "Integration test synopsis",
450
+ image: {
451
+ url: "https://example.com/int-test.jpg",
452
+ aspect_ratio: 1.5
453
+ },
454
+ video: {
455
+ brightcove_id: "video999"
456
+ },
457
+ episode_number: "101",
458
+ name: "Integration Test",
459
+ rating: "TV-PG",
460
+ element_length: "01:30"
461
+ },
462
+ program: {
463
+ title: "Test Program"
464
+ }
465
+ })], { container: o } = r(/* @__PURE__ */ a(c, { handleClicks: i.fn(), list: t })), e = o.querySelector('[data-component="AirDateFormatter"]');
466
+ s(e).toHaveAttribute("data-airdate", "2024-01-15 20:00:00");
467
+ const d = o.querySelector('[data-component="ImageCard"]'), g = JSON.parse((d == null ? void 0 : d.getAttribute("data-props")) || "{}");
468
+ s(g.id).toBe(999), s(g.cta.relatedResourceId).toBe("video999");
469
+ });
470
+ });
471
+ });
@@ -1,4 +1,4 @@
1
- import { g as Re } from "./_commonjsHelpers-C6fGbg64.mjs";
1
+ import { g as Re } from "./_commonjsHelpers-DaMA6jEr.mjs";
2
2
  import me from "react";
3
3
  var F = {}, L = {}, z = {}, I = {}, x = {}, W = {}, K;
4
4
  function ve() {