@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,535 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { v as m, d as g, b as S, i as a, r as c, g as e, s as h } from "../../react.esm-DLSrfVwM.mjs";
3
+ import "../../index-BVxBrkZB.mjs";
4
+ import { ShowAboutContent as r } from "./ShowAboutContent.js";
5
+ m.mock("../SectionedContent", () => ({
6
+ default: ({ sections: d }) => /* @__PURE__ */ n("div", { "data-sections": JSON.stringify(d), "data-testid": "sectioned-content", children: "SectionedContent Mock" })
7
+ }));
8
+ m.mock("../GenericList", () => ({
9
+ default: ({ list: d, classname: i }) => /* @__PURE__ */ n("ul", { "data-classname": i, "data-testid": "generic-list", children: d.map((s, o) => /* @__PURE__ */ n("li", { children: s }, o)) })
10
+ }));
11
+ m.mock("../SocialShareBlock", () => ({
12
+ default: ({ url: d, text: i, longtext: s }) => /* @__PURE__ */ n(
13
+ "div",
14
+ {
15
+ "data-longtext": s,
16
+ "data-testid": "social-share-block",
17
+ "data-text": i,
18
+ "data-url": d,
19
+ children: "SocialShareBlock Mock"
20
+ }
21
+ )
22
+ }));
23
+ const y = m.fn((d) => d.join(" "));
24
+ m.mock("../../utils/helpers", () => ({
25
+ classes: (d) => y(d)
26
+ }));
27
+ const u = m.fn((d) => d);
28
+ m.mock("html-react-parser", () => ({
29
+ default: (d) => u(d)
30
+ }));
31
+ g("ShowAboutContent", () => {
32
+ S(() => {
33
+ m.clearAllMocks();
34
+ });
35
+ const d = (s) => ({
36
+ name: "Test Show",
37
+ slug: "test-show",
38
+ title: "Test Show",
39
+ programType: "series",
40
+ series_synopsis: "This is a test show synopsis.",
41
+ director: "John Director",
42
+ creators: "Jane Creator, Bob Writer",
43
+ public_content: "<p>Award-winning show</p>",
44
+ rating: "TV-14",
45
+ logoImage: {
46
+ image: {
47
+ publicUrl: "https://example.com/logo.png",
48
+ altText: "Test Show Logo",
49
+ sources: [],
50
+ width: 100,
51
+ height: 100,
52
+ sizes: []
53
+ }
54
+ },
55
+ ...s
56
+ }), i = {
57
+ series: d(),
58
+ castStr: "Actor One, Actor Two, Actor Three",
59
+ showUpcoming: !1,
60
+ type: "series",
61
+ nextAirDates: []
62
+ };
63
+ g("Basic Rendering", () => {
64
+ a("should render SectionedContent", () => {
65
+ c(/* @__PURE__ */ n(r, { ...i })), e(h.getByTestId("sectioned-content")).toBeInTheDocument();
66
+ }), a("should render without social share by default", () => {
67
+ c(/* @__PURE__ */ n(r, { ...i })), e(h.queryByTestId("social-share-block")).not.toBeInTheDocument();
68
+ }), a("should not render upcoming content when showUpcoming is false", () => {
69
+ c(/* @__PURE__ */ n(r, { ...i, showUpcoming: !1 })), e(h.queryByText("Upcoming Airings")).not.toBeInTheDocument();
70
+ });
71
+ }), g("SectionedContent Sections", () => {
72
+ a("should create About section with series title", () => {
73
+ const s = d({ title: "My Custom Show" }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), p = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]")[0];
74
+ e(p.header.title).toBe("About My Custom Show"), e(p.header.type).toBe("primary");
75
+ }), a("should include series synopsis in About section content", () => {
76
+ const s = d({ series_synopsis: "Custom synopsis text" }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
77
+ e(l[0].content).toBe("Custom synopsis text");
78
+ }), a("should use empty string for About section when series_synopsis is undefined", () => {
79
+ const s = d({ series_synopsis: void 0 }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
80
+ e(l[0].content).toBe("");
81
+ }), a("should create Starring section with castStr", () => {
82
+ const { container: s } = c(/* @__PURE__ */ n(r, { ...i, castStr: "Star 1, Star 2" })), o = s.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((o == null ? void 0 : o.getAttribute("data-sections")) || "[]")[1];
83
+ e(l.header.title).toBe("Starring"), e(l.header.type).toBe("secondary"), e(l.content).toBe("<p>Star 1, Star 2</p>");
84
+ }), a("should use empty string for Starring section when castStr is empty", () => {
85
+ const { container: s } = c(/* @__PURE__ */ n(r, { ...i, castStr: "" })), o = s.querySelector('[data-testid="sectioned-content"]'), t = JSON.parse((o == null ? void 0 : o.getAttribute("data-sections")) || "[]");
86
+ e(t[1].content).toBe("");
87
+ }), a("should create Director section with director name", () => {
88
+ const s = d({ director: "Steven Spielberg" }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), p = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]")[2];
89
+ e(p.header.title).toBe("Director"), e(p.content).toBe("<p>Steven Spielberg</p>");
90
+ }), a("should use empty string for Director section when director is undefined", () => {
91
+ const s = d({ director: void 0 }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
92
+ e(l[2].content).toBe("");
93
+ }), a("should create Creators section with creators names", () => {
94
+ const s = d({ creators: "Creator A, Creator B" }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), p = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]")[3];
95
+ e(p.header.title).toBe("Creators"), e(p.content).toBe("<p>Creator A, Creator B</p>");
96
+ }), a("should use empty string for Creators section when creators is undefined", () => {
97
+ const s = d({ creators: void 0 }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
98
+ e(l[3].content).toBe("");
99
+ }), a("should create Public & Critical Acclaim section", () => {
100
+ const s = d({ public_content: "<p>Winner of 10 Emmy Awards</p>" }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), p = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]")[4];
101
+ e(p.header.title).toBe("Public & Critical Acclaim"), e(p.content).toBe("<p>Winner of 10 Emmy Awards</p>");
102
+ }), a("should use empty string for Public & Critical Acclaim when public_content is undefined", () => {
103
+ const s = d({ public_content: void 0 }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
104
+ e(l[4].content).toBe("");
105
+ }), a("should use nullish coalescing for public_content", () => {
106
+ const s = d({ public_content: null }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
107
+ e(l[4].content).toBe("");
108
+ }), a("should render all 5 sections", () => {
109
+ const { container: s } = c(/* @__PURE__ */ n(r, { ...i })), o = s.querySelector('[data-testid="sectioned-content"]'), t = JSON.parse((o == null ? void 0 : o.getAttribute("data-sections")) || "[]");
110
+ e(t).toHaveLength(5);
111
+ });
112
+ }), g("Social Share Block", () => {
113
+ a("should render SocialShareBlock when enabled", () => {
114
+ c(/* @__PURE__ */ n(r, { ...i, socialShare: {
115
+ enabled: !0,
116
+ url: "https://example.com/show",
117
+ text: "Check out this show",
118
+ longtext: "Check out this amazing show on our network"
119
+ } })), e(h.getByTestId("social-share-block")).toBeInTheDocument();
120
+ }), a("should not render SocialShareBlock when disabled", () => {
121
+ c(/* @__PURE__ */ n(r, { ...i, socialShare: {
122
+ enabled: !1,
123
+ url: "https://example.com/show",
124
+ text: "Check out this show",
125
+ longtext: "Check out this amazing show on our network"
126
+ } })), e(h.queryByTestId("social-share-block")).not.toBeInTheDocument();
127
+ }), a("should pass url to SocialShareBlock", () => {
128
+ c(/* @__PURE__ */ n(r, { ...i, socialShare: {
129
+ enabled: !0,
130
+ url: "https://custom.com/url",
131
+ text: "Text",
132
+ longtext: "Long text"
133
+ } }));
134
+ const o = h.getByTestId("social-share-block");
135
+ e(o).toHaveAttribute("data-url", "https://custom.com/url");
136
+ }), a("should pass text to SocialShareBlock", () => {
137
+ c(/* @__PURE__ */ n(r, { ...i, socialShare: {
138
+ enabled: !0,
139
+ url: "https://example.com",
140
+ text: "Custom text",
141
+ longtext: "Long text"
142
+ } }));
143
+ const o = h.getByTestId("social-share-block");
144
+ e(o).toHaveAttribute("data-text", "Custom text");
145
+ }), a("should pass longtext to SocialShareBlock", () => {
146
+ c(/* @__PURE__ */ n(r, { ...i, socialShare: {
147
+ enabled: !0,
148
+ url: "https://example.com",
149
+ text: "Text",
150
+ longtext: "Custom long text description"
151
+ } }));
152
+ const o = h.getByTestId("social-share-block");
153
+ e(o).toHaveAttribute("data-longtext", "Custom long text description");
154
+ }), a("should apply correct CSS classes to social share wrapper", () => {
155
+ const s = {
156
+ enabled: !0,
157
+ url: "https://example.com",
158
+ text: "Text",
159
+ longtext: "Long text"
160
+ }, { container: o } = c(/* @__PURE__ */ n(r, { ...i, socialShare: s })), t = o.querySelector(".show-about-content__social-share");
161
+ e(t).toBeInTheDocument();
162
+ }), a("should call classes helper for social share wrapper", () => {
163
+ c(/* @__PURE__ */ n(r, { ...i, socialShare: {
164
+ enabled: !0,
165
+ url: "https://example.com",
166
+ text: "Text",
167
+ longtext: "Long text"
168
+ } })), e(y).toHaveBeenCalledWith(
169
+ e.arrayContaining(["show-about-content__social-share"])
170
+ );
171
+ }), a("should use default empty socialShare when not provided", () => {
172
+ c(/* @__PURE__ */ n(r, { ...i })), e(h.queryByTestId("social-share-block")).not.toBeInTheDocument();
173
+ });
174
+ }), g("Upcoming Airings - With Air Dates", () => {
175
+ a("should render upcoming airings when showUpcoming is true and nextAirDates has items", () => {
176
+ c(/* @__PURE__ */ n(
177
+ r,
178
+ {
179
+ ...i,
180
+ showUpcoming: !0,
181
+ nextAirDates: ["2024-01-15 7:00 PM", "2024-01-16 8:00 PM"]
182
+ }
183
+ )), e(h.getByText("Upcoming Airings")).toBeInTheDocument();
184
+ }), a("should render GenericList with air dates", () => {
185
+ c(/* @__PURE__ */ n(
186
+ r,
187
+ {
188
+ ...i,
189
+ showUpcoming: !0,
190
+ nextAirDates: ["Date 1", "Date 2", "Date 3"]
191
+ }
192
+ ));
193
+ const s = h.getByTestId("generic-list");
194
+ e(s).toBeInTheDocument(), e(h.getByText("Date 1")).toBeInTheDocument(), e(h.getByText("Date 2")).toBeInTheDocument(), e(h.getByText("Date 3")).toBeInTheDocument();
195
+ }), a("should pass correct classname to GenericList", () => {
196
+ c(/* @__PURE__ */ n(
197
+ r,
198
+ {
199
+ ...i,
200
+ showUpcoming: !0,
201
+ nextAirDates: ["Date 1"]
202
+ }
203
+ ));
204
+ const s = h.getByTestId("generic-list");
205
+ e(s).toHaveAttribute("data-classname", "upcoming-airings__list");
206
+ }), a("should wrap GenericList in upcoming-airings div", () => {
207
+ const { container: s } = c(/* @__PURE__ */ n(
208
+ r,
209
+ {
210
+ ...i,
211
+ showUpcoming: !0,
212
+ nextAirDates: ["Date 1"]
213
+ }
214
+ )), o = s.querySelector(".upcoming-airings");
215
+ e(o).toBeInTheDocument();
216
+ }), a("should render h3 with h5 class for upcoming airings title", () => {
217
+ const { container: s } = c(/* @__PURE__ */ n(
218
+ r,
219
+ {
220
+ ...i,
221
+ showUpcoming: !0,
222
+ nextAirDates: ["Date 1"]
223
+ }
224
+ )), o = s.querySelector("h3.h5");
225
+ e(o).toBeInTheDocument(), e(o == null ? void 0 : o.textContent).toBe("Upcoming Airings");
226
+ });
227
+ }), g("Upcoming Airings - No Air Dates (Series)", () => {
228
+ a("should show series message when type is series and no air dates", () => {
229
+ c(/* @__PURE__ */ n(
230
+ r,
231
+ {
232
+ ...i,
233
+ showUpcoming: !0,
234
+ nextAirDates: [],
235
+ type: "series"
236
+ }
237
+ )), e(u).toHaveBeenCalledWith(
238
+ e.stringContaining("This show doesn't have any episodes scheduled")
239
+ );
240
+ }), a("should include link to schedule in series message", () => {
241
+ c(/* @__PURE__ */ n(
242
+ r,
243
+ {
244
+ ...i,
245
+ showUpcoming: !0,
246
+ nextAirDates: [],
247
+ type: "series"
248
+ }
249
+ )), e(u).toHaveBeenCalledWith(
250
+ e.stringContaining('<a href="/schedule" className="inline-anchor">full schedule</a>')
251
+ );
252
+ }), a("should render paragraph for series message", () => {
253
+ const { container: s } = c(/* @__PURE__ */ n(
254
+ r,
255
+ {
256
+ ...i,
257
+ showUpcoming: !0,
258
+ nextAirDates: [],
259
+ type: "series"
260
+ }
261
+ )), o = s.querySelector(".upcoming-airings"), t = o == null ? void 0 : o.querySelector("p");
262
+ e(t).toBeInTheDocument();
263
+ });
264
+ }), g("Upcoming Airings - No Air Dates (Film)", () => {
265
+ a("should show film message when type is film and no air dates", () => {
266
+ c(/* @__PURE__ */ n(
267
+ r,
268
+ {
269
+ ...i,
270
+ showUpcoming: !0,
271
+ nextAirDates: [],
272
+ type: "film"
273
+ }
274
+ )), e(u).toHaveBeenCalledWith(
275
+ e.stringContaining("This movie doesn't have any airings in the next two weeks")
276
+ );
277
+ }), a("should include link to schedule in film message", () => {
278
+ c(/* @__PURE__ */ n(
279
+ r,
280
+ {
281
+ ...i,
282
+ showUpcoming: !0,
283
+ nextAirDates: [],
284
+ type: "film"
285
+ }
286
+ )), e(u).toHaveBeenCalledWith(
287
+ e.stringContaining('<a href="/schedule" className="inline-anchor">full schedule</a>')
288
+ );
289
+ }), a("should render different message for film vs series", () => {
290
+ u.mockClear();
291
+ const { rerender: s } = c(/* @__PURE__ */ n(
292
+ r,
293
+ {
294
+ ...i,
295
+ showUpcoming: !0,
296
+ nextAirDates: [],
297
+ type: "series"
298
+ }
299
+ )), o = u.mock.calls.find(
300
+ (l) => l[0].includes("This show doesn't have")
301
+ );
302
+ u.mockClear(), s(/* @__PURE__ */ n(
303
+ r,
304
+ {
305
+ ...i,
306
+ showUpcoming: !0,
307
+ nextAirDates: [],
308
+ type: "film"
309
+ }
310
+ ));
311
+ const t = u.mock.calls.find(
312
+ (l) => l[0].includes("This movie doesn't have")
313
+ );
314
+ e(o).toBeDefined(), e(t).toBeDefined();
315
+ });
316
+ }), g("Upcoming Airings - Unknown Type", () => {
317
+ a("should show film message when type is unknown and no air dates", () => {
318
+ c(/* @__PURE__ */ n(
319
+ r,
320
+ {
321
+ ...i,
322
+ showUpcoming: !0,
323
+ nextAirDates: [],
324
+ type: "unknown"
325
+ }
326
+ )), e(u).toHaveBeenCalledWith(
327
+ e.stringContaining("This movie doesn't have any airings in the next two weeks")
328
+ );
329
+ });
330
+ }), g("Edge Cases", () => {
331
+ a("should handle very long series title", () => {
332
+ const s = d({ title: "A".repeat(200) }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
333
+ e(l[0].header.title).toContain("A".repeat(200));
334
+ }), a("should handle special characters in series title", () => {
335
+ const s = d({ title: 'Show <with> & "Special" Characters' }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
336
+ e(l[0].header.title).toBe('About Show <with> & "Special" Characters');
337
+ }), a("should handle empty castStr", () => {
338
+ const { container: s } = c(/* @__PURE__ */ n(r, { ...i, castStr: "" })), o = s.querySelector('[data-testid="sectioned-content"]'), t = JSON.parse((o == null ? void 0 : o.getAttribute("data-sections")) || "[]");
339
+ e(t[1].content).toBe("");
340
+ }), a("should handle very long castStr", () => {
341
+ const s = Array(50).fill("Actor Name").join(", "), { container: o } = c(/* @__PURE__ */ n(r, { ...i, castStr: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
342
+ e(l[1].content).toContain(s);
343
+ }), a("should handle large number of air dates", () => {
344
+ const s = Array.from({ length: 100 }, (l, p) => `Date ${p + 1}`);
345
+ c(/* @__PURE__ */ n(
346
+ r,
347
+ {
348
+ ...i,
349
+ showUpcoming: !0,
350
+ nextAirDates: s
351
+ }
352
+ ));
353
+ const t = h.getByTestId("generic-list").querySelectorAll("li");
354
+ e(t).toHaveLength(100);
355
+ }), a("should handle HTML in series_synopsis", () => {
356
+ const s = d({
357
+ series_synopsis: "<p>Synopsis with <strong>HTML</strong> tags</p>"
358
+ }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
359
+ e(l[0].content).toBe("<p>Synopsis with <strong>HTML</strong> tags</p>");
360
+ }), a("should handle unicode characters", () => {
361
+ const s = d({
362
+ title: "Show Title 🎬",
363
+ creators: "Creator 你好"
364
+ }), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
365
+ e(l[0].header.title).toBe("About Show Title 🎬"), e(l[3].content).toBe("<p>Creator 你好</p>");
366
+ }), a("should handle all optional fields missing", () => {
367
+ const s = d({
368
+ series_synopsis: void 0,
369
+ director: void 0,
370
+ creators: void 0,
371
+ public_content: void 0
372
+ }), { container: o } = c(/* @__PURE__ */ n(
373
+ r,
374
+ {
375
+ ...i,
376
+ castStr: "",
377
+ series: s
378
+ }
379
+ )), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
380
+ e(l[0].content).toBe(""), e(l[1].content).toBe(""), e(l[2].content).toBe(""), e(l[3].content).toBe(""), e(l[4].content).toBe("");
381
+ });
382
+ }), g("Type Safety", () => {
383
+ a("should accept valid Series object", () => {
384
+ const s = d(), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s }));
385
+ e(o.querySelector('[data-testid="sectioned-content"]')).toBeInTheDocument();
386
+ }), a("should accept series type", () => {
387
+ c(/* @__PURE__ */ n(r, { ...i, type: "series" })), e(h.queryByText("Upcoming Airings")).not.toBeInTheDocument();
388
+ }), a("should accept film type", () => {
389
+ c(/* @__PURE__ */ n(r, { ...i, type: "film" })), e(h.queryByText("Upcoming Airings")).not.toBeInTheDocument();
390
+ }), a("should accept unknown type", () => {
391
+ c(/* @__PURE__ */ n(r, { ...i, type: "unknown" })), e(h.queryByText("Upcoming Airings")).not.toBeInTheDocument();
392
+ }), a("should accept empty nextAirDates array", () => {
393
+ c(/* @__PURE__ */ n(r, { ...i, nextAirDates: [] })), e(h.queryByTestId("generic-list")).not.toBeInTheDocument();
394
+ }), a("should accept array of strings for nextAirDates", () => {
395
+ c(/* @__PURE__ */ n(
396
+ r,
397
+ {
398
+ ...i,
399
+ showUpcoming: !0,
400
+ nextAirDates: ["Date 1", "Date 2"]
401
+ }
402
+ )), e(h.getByTestId("generic-list")).toBeInTheDocument();
403
+ });
404
+ }), g("Integration Tests", () => {
405
+ a("should render complete component with all features", () => {
406
+ const s = d({
407
+ title: "Complete Show",
408
+ series_synopsis: "Full synopsis",
409
+ director: "Director Name",
410
+ creators: "Creators Names",
411
+ public_content: "<p>Awards</p>"
412
+ });
413
+ c(/* @__PURE__ */ n(
414
+ r,
415
+ {
416
+ showUpcoming: !0,
417
+ castStr: "Cast Members",
418
+ nextAirDates: ["Date 1", "Date 2"],
419
+ series: s,
420
+ socialShare: {
421
+ enabled: !0,
422
+ url: "https://example.com",
423
+ text: "Share text",
424
+ longtext: "Long share text"
425
+ },
426
+ type: "series"
427
+ }
428
+ )), e(h.getByTestId("sectioned-content")).toBeInTheDocument(), e(h.getByTestId("social-share-block")).toBeInTheDocument(), e(h.getByTestId("generic-list")).toBeInTheDocument(), e(h.getByText("Upcoming Airings")).toBeInTheDocument();
429
+ }), a("should coordinate SectionedContent sections correctly", () => {
430
+ const s = d(), { container: o } = c(/* @__PURE__ */ n(r, { ...i, series: s })), t = o.querySelector('[data-testid="sectioned-content"]'), l = JSON.parse((t == null ? void 0 : t.getAttribute("data-sections")) || "[]");
431
+ e(l[0].header.type).toBe("primary"), e(l[1].header.type).toBe("secondary"), e(l[2].header.type).toBe("secondary"), e(l[3].header.type).toBe("secondary"), e(l[4].header.type).toBe("secondary");
432
+ }), a("should render upcoming content based on air dates availability", () => {
433
+ const { rerender: s } = c(/* @__PURE__ */ n(
434
+ r,
435
+ {
436
+ ...i,
437
+ showUpcoming: !0,
438
+ nextAirDates: ["Date 1"]
439
+ }
440
+ ));
441
+ e(h.getByTestId("generic-list")).toBeInTheDocument(), s(/* @__PURE__ */ n(
442
+ r,
443
+ {
444
+ ...i,
445
+ showUpcoming: !0,
446
+ nextAirDates: []
447
+ }
448
+ )), e(h.queryByTestId("generic-list")).not.toBeInTheDocument();
449
+ }), a("should toggle social share visibility", () => {
450
+ const s = {
451
+ enabled: !0,
452
+ url: "https://example.com",
453
+ text: "Text",
454
+ longtext: "Long text"
455
+ }, { rerender: o } = c(/* @__PURE__ */ n(
456
+ r,
457
+ {
458
+ ...i,
459
+ socialShare: s
460
+ }
461
+ ));
462
+ e(h.getByTestId("social-share-block")).toBeInTheDocument(), o(/* @__PURE__ */ n(
463
+ r,
464
+ {
465
+ ...i,
466
+ socialShare: { ...s, enabled: !1 }
467
+ }
468
+ )), e(h.queryByTestId("social-share-block")).not.toBeInTheDocument();
469
+ });
470
+ }), g("Conditional Rendering Logic", () => {
471
+ a("should only render upcoming airings when showUpcoming is true", () => {
472
+ const { rerender: s } = c(/* @__PURE__ */ n(
473
+ r,
474
+ {
475
+ ...i,
476
+ nextAirDates: ["Date 1"],
477
+ showUpcoming: !1
478
+ }
479
+ ));
480
+ e(h.queryByText("Upcoming Airings")).not.toBeInTheDocument(), s(/* @__PURE__ */ n(
481
+ r,
482
+ {
483
+ ...i,
484
+ showUpcoming: !0,
485
+ nextAirDates: ["Date 1"]
486
+ }
487
+ )), e(h.getByText("Upcoming Airings")).toBeInTheDocument();
488
+ }), a("should render different content based on nextAirDates.length", () => {
489
+ const { rerender: s } = c(/* @__PURE__ */ n(
490
+ r,
491
+ {
492
+ ...i,
493
+ showUpcoming: !0,
494
+ nextAirDates: [],
495
+ type: "series"
496
+ }
497
+ ));
498
+ e(h.queryByTestId("generic-list")).not.toBeInTheDocument(), s(/* @__PURE__ */ n(
499
+ r,
500
+ {
501
+ ...i,
502
+ showUpcoming: !0,
503
+ nextAirDates: ["Date 1"],
504
+ type: "series"
505
+ }
506
+ )), e(h.getByTestId("generic-list")).toBeInTheDocument();
507
+ }), a("should render ternary based on type (series vs film)", () => {
508
+ u.mockClear(), c(/* @__PURE__ */ n(
509
+ r,
510
+ {
511
+ ...i,
512
+ showUpcoming: !0,
513
+ nextAirDates: [],
514
+ type: "series"
515
+ }
516
+ ));
517
+ const s = u.mock.calls.some(
518
+ (t) => t[0].includes("This show doesn't have")
519
+ );
520
+ e(s).toBe(!0), u.mockClear(), c(/* @__PURE__ */ n(
521
+ r,
522
+ {
523
+ ...i,
524
+ showUpcoming: !0,
525
+ nextAirDates: [],
526
+ type: "film"
527
+ }
528
+ ));
529
+ const o = u.mock.calls.some(
530
+ (t) => t[0].includes("This movie doesn't have")
531
+ );
532
+ e(o).toBe(!0);
533
+ });
534
+ });
535
+ });