@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,499 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { v as w, d as h, b as A, a as b, i as r, r as c, w as s, g as t, s as i } from "../../react.esm-DLSrfVwM.mjs";
3
+ import "../../index-BVxBrkZB.mjs";
4
+ import { FindUs as l } from "./FindUs.js";
5
+ w.mock("../ChannelSearch", () => ({
6
+ default: ({ network: d, baseApiUrl: a, allowStateSearch: o, allowZipcodeSearch: e, allowAutoScroll: u, autoScrollOffset: y, compactLayout: f, ad: p }) => /* @__PURE__ */ n(
7
+ "div",
8
+ {
9
+ "data-ad-campaign": p == null ? void 0 : p.campaign,
10
+ "data-ad-content": p == null ? void 0 : p.content,
11
+ "data-ad-medium": p == null ? void 0 : p.medium,
12
+ "data-ad-source": p == null ? void 0 : p.source,
13
+ "data-allow-auto-scroll": u,
14
+ "data-allow-state-search": o,
15
+ "data-allow-zipcode-search": e,
16
+ "data-auto-scroll-offset": y,
17
+ "data-base-api-url": a,
18
+ "data-compact-layout": f,
19
+ "data-network": d.brand_name,
20
+ "data-testid": "channel-search",
21
+ children: "ChannelSearch Mock"
22
+ }
23
+ )
24
+ }));
25
+ w.mock("../RescanInstructions", () => ({
26
+ default: ({ brandName: d }) => /* @__PURE__ */ n("div", { "data-brand-name": d, "data-testid": "rescan-instructions", children: "RescanInstructions Mock" })
27
+ }));
28
+ w.mock("../DeviceAndPlatformLists", () => ({
29
+ default: ({ platformResources: d, numberOfColumns: a }) => /* @__PURE__ */ n(
30
+ "div",
31
+ {
32
+ "data-columns": a,
33
+ "data-platforms-size": d.size,
34
+ "data-testid": "device-platform-lists",
35
+ children: "DeviceAndPlatformLists Mock"
36
+ }
37
+ )
38
+ }));
39
+ w.mock("../../error-boundries/GeneralErrorBoundry", () => ({
40
+ default: ({ children: d, errorMessage: a, errorTitle: o }) => /* @__PURE__ */ n("div", { "data-error-message": a, "data-error-title": o, "data-testid": "error-boundary", children: d })
41
+ }));
42
+ const m = w.fn();
43
+ w.mock("../../utils/getViewingPlatforms", () => ({
44
+ getViewingPlatforms: (...d) => m(...d)
45
+ }));
46
+ h("FindUs", () => {
47
+ let d;
48
+ const a = {
49
+ brand_name: "Test Network",
50
+ slug: "test-network",
51
+ platformsSlug: "test-platforms"
52
+ }, o = "https://api.test.com";
53
+ A(() => {
54
+ d = document.createElement("div"), d.id = "root", document.body.appendChild(d), w.clearAllMocks(), m.mockResolvedValue(/* @__PURE__ */ new Map([
55
+ ["platform1", { name: "Platform 1" }],
56
+ ["platform2", { name: "Platform 2" }]
57
+ ])), Object.defineProperty(window, "innerWidth", {
58
+ writable: !0,
59
+ configurable: !0,
60
+ value: 1024
61
+ });
62
+ }), b(() => {
63
+ document.body.removeChild(d), w.clearAllTimers();
64
+ }), h("Basic Rendering", () => {
65
+ r("should render section element", async () => {
66
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
67
+ const e = document.querySelector("section");
68
+ t(e).toBeInTheDocument();
69
+ });
70
+ }), r("should apply find-us CSS class", async () => {
71
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
72
+ const e = document.querySelector("section");
73
+ t(e).toHaveClass("find-us");
74
+ });
75
+ }), r("should apply compact layout class by default", async () => {
76
+ const { container: e } = c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a }));
77
+ await s(() => {
78
+ const u = e.querySelector("section");
79
+ t(u == null ? void 0 : u.className).toContain("find-us--compact");
80
+ });
81
+ }), r("should not apply compact layout class when compactLayout is false", async () => {
82
+ const { container: e } = c(/* @__PURE__ */ n(l, { baseApiUrl: o, compactLayout: !1, network: a }));
83
+ await s(() => {
84
+ const u = e.querySelector("section");
85
+ t(u == null ? void 0 : u.className).not.toContain("find-us--compact");
86
+ });
87
+ });
88
+ }), h("Platforms Fetching", () => {
89
+ r("should fetch platforms on mount", async () => {
90
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
91
+ t(m).toHaveBeenCalledWith({
92
+ network: "test-platforms",
93
+ platformsApiUrl: "https://api.scrippscloud.com/viewing-platforms/v1"
94
+ });
95
+ });
96
+ }), r("should use custom platformsApiUrl when provided", async () => {
97
+ const e = "https://custom-api.test.com/platforms";
98
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a, platformsApiUrl: e })), await s(() => {
99
+ t(m).toHaveBeenCalledWith({
100
+ network: "test-platforms",
101
+ platformsApiUrl: e
102
+ });
103
+ });
104
+ }), r("should render DeviceAndPlatformLists when platforms are loaded", async () => {
105
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
106
+ t(i.getByTestId("device-platform-lists")).toBeInTheDocument();
107
+ });
108
+ }), r("should pass platforms to DeviceAndPlatformLists", async () => {
109
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
110
+ const e = i.getByTestId("device-platform-lists");
111
+ t(e).toHaveAttribute("data-platforms-size", "2");
112
+ });
113
+ }), r("should pass numberOfColumns to DeviceAndPlatformLists when provided", async () => {
114
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a, numberOfColumns: 3 })), await s(() => {
115
+ const e = i.getByTestId("device-platform-lists");
116
+ t(e).toHaveAttribute("data-columns", "3");
117
+ });
118
+ });
119
+ }), h("Error Handling", () => {
120
+ r("should handle platforms fetch error", async () => {
121
+ m.mockResolvedValue({ error: "Fetch failed" });
122
+ const e = w.spyOn(console, "error").mockImplementation(() => {
123
+ });
124
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
125
+ t(e).toHaveBeenCalledWith(
126
+ "An error occured while fetching the platforms:",
127
+ { error: "Fetch failed" }
128
+ );
129
+ }), await s(() => {
130
+ t(i.getByText(/We couldn't find any viewing platforms for Test Network/i)).toBeInTheDocument();
131
+ }), e.mockRestore();
132
+ }), r("should display error message when platforms size is 0", async () => {
133
+ m.mockResolvedValue(/* @__PURE__ */ new Map()), c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
134
+ t(i.getByText(/We couldn't find any viewing platforms for Test Network/i)).toBeInTheDocument();
135
+ });
136
+ }), r("should wrap sections in GeneralErrorBoundary", async () => {
137
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
138
+ const e = i.getAllByTestId("error-boundary");
139
+ t(e.length).toBeGreaterThan(0);
140
+ });
141
+ });
142
+ }), h("ChannelSearch and RescanInstructions - Compact Layout", () => {
143
+ r("should render RescanInstructions when showChannelSearchAndRescan is true", async () => {
144
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
145
+ t(i.getByTestId("rescan-instructions")).toBeInTheDocument();
146
+ });
147
+ }), r("should pass brandName to RescanInstructions", async () => {
148
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
149
+ const e = i.getByTestId("rescan-instructions");
150
+ t(e).toHaveAttribute("data-brand-name", "Test Network");
151
+ });
152
+ }), r("should render ChannelSearch in compact layout", async () => {
153
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
154
+ const e = i.getAllByTestId("channel-search");
155
+ t(e.length).toBeGreaterThan(0);
156
+ });
157
+ }), r("should display compact layout header in compact mode", async () => {
158
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
159
+ t(i.getByText("Digital Antenna")).toBeInTheDocument(), t(i.getByText("(Over-the-Air Broadcast)")).toBeInTheDocument();
160
+ });
161
+ }), r("should not display compact header when not compact", async () => {
162
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, compactLayout: !1, network: a })), await s(() => {
163
+ t(i.queryByText("Digital Antenna")).not.toBeInTheDocument();
164
+ });
165
+ });
166
+ }), h("ChannelSearch and RescanInstructions - Non-Compact Layout", () => {
167
+ r("should render ChannelSearch in non-compact layout", async () => {
168
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, compactLayout: !1, network: a })), await s(() => {
169
+ t(i.getByTestId("channel-search")).toBeInTheDocument();
170
+ });
171
+ }), r("should not render ChannelSearch when showChannelSearchAndRescan is false", async () => {
172
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a, showChannelSearchAndRescan: !1 })), await s(() => {
173
+ t(i.queryByTestId("channel-search")).not.toBeInTheDocument();
174
+ });
175
+ }), r("should not render RescanInstructions when showChannelSearchAndRescan is false", async () => {
176
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a, showChannelSearchAndRescan: !1 })), await s(() => {
177
+ t(i.queryByTestId("rescan-instructions")).not.toBeInTheDocument();
178
+ });
179
+ });
180
+ }), h("ChannelSearch Props", () => {
181
+ r("should pass network to ChannelSearch", async () => {
182
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
183
+ const e = i.getAllByTestId("channel-search")[0];
184
+ t(e).toHaveAttribute("data-network", "Test Network");
185
+ });
186
+ }), r("should pass baseApiUrl to ChannelSearch", async () => {
187
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
188
+ const e = i.getAllByTestId("channel-search")[0];
189
+ t(e).toHaveAttribute("data-base-api-url", o);
190
+ });
191
+ }), r("should pass allowStateSearch to ChannelSearch", async () => {
192
+ c(/* @__PURE__ */ n(
193
+ l,
194
+ {
195
+ compactLayout: !0,
196
+ allowStateSearch: !1,
197
+ baseApiUrl: o,
198
+ network: a
199
+ }
200
+ )), await s(() => {
201
+ const e = i.getAllByTestId("channel-search")[0];
202
+ t(e).toHaveAttribute("data-allow-state-search", "false");
203
+ });
204
+ }), r("should pass allowZipcodeSearch to ChannelSearch", async () => {
205
+ c(/* @__PURE__ */ n(
206
+ l,
207
+ {
208
+ compactLayout: !0,
209
+ allowZipcodeSearch: !1,
210
+ baseApiUrl: o,
211
+ network: a
212
+ }
213
+ )), await s(() => {
214
+ const e = i.getAllByTestId("channel-search")[0];
215
+ t(e).toHaveAttribute("data-allow-zipcode-search", "false");
216
+ });
217
+ }), r("should pass allowAutoScroll to ChannelSearch", async () => {
218
+ c(/* @__PURE__ */ n(
219
+ l,
220
+ {
221
+ compactLayout: !0,
222
+ allowAutoScroll: !1,
223
+ baseApiUrl: o,
224
+ network: a
225
+ }
226
+ )), await s(() => {
227
+ const e = i.getAllByTestId("channel-search")[0];
228
+ t(e).toHaveAttribute("data-allow-auto-scroll", "false");
229
+ });
230
+ }), r("should pass compactLayout to ChannelSearch", async () => {
231
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
232
+ const e = i.getAllByTestId("channel-search")[0];
233
+ t(e).toHaveAttribute("data-compact-layout", "true");
234
+ });
235
+ }), r("should pass autoScrollOffset to ChannelSearch", async () => {
236
+ c(/* @__PURE__ */ n(
237
+ l,
238
+ {
239
+ compactLayout: !0,
240
+ autoScrollOffset: 50,
241
+ baseApiUrl: o,
242
+ network: a
243
+ }
244
+ )), await s(() => {
245
+ const e = i.getAllByTestId("channel-search")[0];
246
+ t(e).toHaveAttribute("data-auto-scroll-offset", "50");
247
+ });
248
+ });
249
+ }), h("Ad Props", () => {
250
+ r("should use default ad values when not provided", async () => {
251
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, compactLayout: !1, network: a })), await s(() => {
252
+ const e = i.getByTestId("channel-search");
253
+ t(e).toHaveAttribute("data-ad-campaign", ""), t(e).toHaveAttribute("data-ad-source", ""), t(e).toHaveAttribute("data-ad-medium", "referral"), t(e).toHaveAttribute("data-ad-content", "learn_more");
254
+ });
255
+ }), r("should pass custom ad values to ChannelSearch", async () => {
256
+ c(/* @__PURE__ */ n(
257
+ l,
258
+ {
259
+ ad: {
260
+ campaign: "test-campaign",
261
+ source: "test-source",
262
+ medium: "test-medium",
263
+ content: "test-content"
264
+ },
265
+ baseApiUrl: o,
266
+ compactLayout: !1,
267
+ network: a
268
+ }
269
+ )), await s(() => {
270
+ const u = i.getByTestId("channel-search");
271
+ t(u).toHaveAttribute("data-ad-campaign", "test-campaign"), t(u).toHaveAttribute("data-ad-source", "test-source"), t(u).toHaveAttribute("data-ad-medium", "test-medium"), t(u).toHaveAttribute("data-ad-content", "test-content");
272
+ });
273
+ }), r("should handle partial ad object with defaults", async () => {
274
+ c(/* @__PURE__ */ n(
275
+ l,
276
+ {
277
+ ad: {
278
+ campaign: "partial-campaign"
279
+ },
280
+ baseApiUrl: o,
281
+ compactLayout: !1,
282
+ network: a
283
+ }
284
+ )), await s(() => {
285
+ const u = i.getByTestId("channel-search");
286
+ t(u).toHaveAttribute("data-ad-campaign", "partial-campaign"), t(u).toHaveAttribute("data-ad-medium", "referral"), t(u).toHaveAttribute("data-ad-content", "learn_more");
287
+ });
288
+ });
289
+ }), h("Auto Scroll Offset", () => {
290
+ r("should use default autoScrollOffset", async () => {
291
+ c(/* @__PURE__ */ n(
292
+ l,
293
+ {
294
+ compactLayout: !0,
295
+ autoScrollOffset: 25,
296
+ baseApiUrl: o,
297
+ network: a
298
+ }
299
+ )), await s(() => {
300
+ const e = i.getAllByTestId("channel-search")[0];
301
+ t(e).toHaveAttribute("data-auto-scroll-offset", "25");
302
+ });
303
+ }), r("should set autoScrollOffset to 0 when allowAutoScroll is false", async () => {
304
+ c(/* @__PURE__ */ n(
305
+ l,
306
+ {
307
+ compactLayout: !0,
308
+ allowAutoScroll: !1,
309
+ baseApiUrl: o,
310
+ network: a
311
+ }
312
+ )), await s(() => {
313
+ const e = i.getAllByTestId("channel-search")[0];
314
+ t(e).toHaveAttribute("data-auto-scroll-offset", "0");
315
+ });
316
+ }), r("should pass custom autoScrollOffset value", async () => {
317
+ c(/* @__PURE__ */ n(
318
+ l,
319
+ {
320
+ compactLayout: !0,
321
+ autoScrollOffset: 100,
322
+ baseApiUrl: o,
323
+ network: a
324
+ }
325
+ )), await s(() => {
326
+ const e = i.getAllByTestId("channel-search")[0];
327
+ t(e).toHaveAttribute("data-auto-scroll-offset", "100");
328
+ });
329
+ });
330
+ }), h("Default Props", () => {
331
+ r("should use default platformsApiUrl", async () => {
332
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
333
+ t(m).toHaveBeenCalledWith(
334
+ t.objectContaining({
335
+ platformsApiUrl: "https://api.scrippscloud.com/viewing-platforms/v1"
336
+ })
337
+ );
338
+ });
339
+ }), r("should use default allowStateSearch (true)", async () => {
340
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
341
+ const e = i.getAllByTestId("channel-search")[0];
342
+ t(e).toHaveAttribute("data-allow-state-search", "true");
343
+ });
344
+ }), r("should use default allowZipcodeSearch (true)", async () => {
345
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
346
+ const e = i.getAllByTestId("channel-search")[0];
347
+ t(e).toHaveAttribute("data-allow-zipcode-search", "true");
348
+ });
349
+ }), r("should use default allowAutoScroll (true)", async () => {
350
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
351
+ const e = i.getAllByTestId("channel-search")[0];
352
+ t(e).toHaveAttribute("data-allow-auto-scroll", "true");
353
+ });
354
+ }), r("should use default autoScrollOffset (25)", async () => {
355
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
356
+ const e = i.getAllByTestId("channel-search")[0];
357
+ t(e).toHaveAttribute("data-auto-scroll-offset", "25");
358
+ });
359
+ }), r("should use default compactLayout (true)", async () => {
360
+ const { container: e } = c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a }));
361
+ await s(() => {
362
+ const u = e.querySelector("section");
363
+ t(u == null ? void 0 : u.className).toContain("find-us--compact");
364
+ });
365
+ }), r("should use default showChannelSearchAndRescan (true)", async () => {
366
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
367
+ t(i.getByTestId("rescan-instructions")).toBeInTheDocument();
368
+ });
369
+ });
370
+ }), h("CSS Classes", () => {
371
+ r("should apply grid-wrapper class", async () => {
372
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
373
+ const e = document.querySelector(".findus__grid-wrapper");
374
+ t(e).toBeInTheDocument();
375
+ });
376
+ }), r("should apply full-width class when showChannelSearchAndRescan is false", async () => {
377
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a, showChannelSearchAndRescan: !1 })), await s(() => {
378
+ const e = document.querySelector(".findus__grid-wrapper--full-width");
379
+ t(e).toBeInTheDocument();
380
+ });
381
+ }), r("should not apply full-width class when showChannelSearchAndRescan is true", async () => {
382
+ c(/* @__PURE__ */ n(l, { showChannelSearchAndRescan: !0, baseApiUrl: o, network: a })), await s(() => {
383
+ const e = document.querySelector(".findus__grid-wrapper--full-width");
384
+ t(e).not.toBeInTheDocument();
385
+ });
386
+ }), r("should apply findus__column class", async () => {
387
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
388
+ const e = document.querySelector(".findus__column");
389
+ t(e).toBeInTheDocument();
390
+ });
391
+ }), r("should apply channel-search__header class in compact layout", async () => {
392
+ c(/* @__PURE__ */ n(l, { compactLayout: !0, baseApiUrl: o, network: a })), await s(() => {
393
+ const e = document.querySelector(".channel-search__header");
394
+ t(e).toBeInTheDocument();
395
+ });
396
+ }), r("should apply find-us__channel-search-section class in non-compact layout", async () => {
397
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, compactLayout: !1, network: a })), await s(() => {
398
+ const e = document.querySelector(".find-us__channel-search-section");
399
+ t(e).toBeInTheDocument();
400
+ });
401
+ });
402
+ }), h("Integration", () => {
403
+ r("should render complete component with all features", async () => {
404
+ c(
405
+ /* @__PURE__ */ n(
406
+ l,
407
+ {
408
+ allowAutoScroll: !0,
409
+ allowStateSearch: !0,
410
+ allowZipcodeSearch: !0,
411
+ compactLayout: !0,
412
+ showChannelSearchAndRescan: !0,
413
+ ad: {
414
+ campaign: "test-campaign",
415
+ source: "test-source",
416
+ medium: "test-medium",
417
+ content: "test-content"
418
+ },
419
+ autoScrollOffset: 30,
420
+ baseApiUrl: o,
421
+ network: a,
422
+ numberOfColumns: 4,
423
+ platformsApiUrl: "https://custom-api.test.com"
424
+ }
425
+ )
426
+ ), await s(() => {
427
+ t(i.getByTestId("channel-search")).toBeInTheDocument(), t(i.getByTestId("rescan-instructions")).toBeInTheDocument(), t(i.getByTestId("device-platform-lists")).toBeInTheDocument();
428
+ }), await s(() => {
429
+ const u = i.getByTestId("device-platform-lists");
430
+ t(u).toHaveAttribute("data-columns", "4");
431
+ });
432
+ }), r("should handle platforms loading and display", async () => {
433
+ const e = /* @__PURE__ */ new Map([
434
+ ["platform1", { name: "Platform 1" }],
435
+ ["platform2", { name: "Platform 2" }],
436
+ ["platform3", { name: "Platform 3" }]
437
+ ]);
438
+ m.mockResolvedValue(e), c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
439
+ const u = i.getByTestId("device-platform-lists");
440
+ t(u).toHaveAttribute("data-platforms-size", "3");
441
+ });
442
+ }), r("should render minimal configuration", async () => {
443
+ c(
444
+ /* @__PURE__ */ n(
445
+ l,
446
+ {
447
+ baseApiUrl: o,
448
+ compactLayout: !1,
449
+ network: a,
450
+ showChannelSearchAndRescan: !1
451
+ }
452
+ )
453
+ ), await s(() => {
454
+ t(i.queryByTestId("channel-search")).not.toBeInTheDocument(), t(i.queryByTestId("rescan-instructions")).not.toBeInTheDocument(), t(i.getByTestId("device-platform-lists")).toBeInTheDocument();
455
+ });
456
+ });
457
+ }), h("Edge Cases", () => {
458
+ r("should handle empty network brand name", async () => {
459
+ const e = { ...a, brand_name: "" };
460
+ c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: e })), await s(() => {
461
+ const u = i.getByTestId("rescan-instructions");
462
+ t(u).toHaveAttribute("data-brand-name", "");
463
+ });
464
+ }), r("should handle platforms that resolve to empty Map", async () => {
465
+ m.mockResolvedValue(/* @__PURE__ */ new Map()), c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), await s(() => {
466
+ t(i.getByText(/We couldn't find any viewing platforms for Test Network/i)).toBeInTheDocument();
467
+ });
468
+ }), r("should handle very large autoScrollOffset", async () => {
469
+ c(/* @__PURE__ */ n(
470
+ l,
471
+ {
472
+ compactLayout: !0,
473
+ autoScrollOffset: 9999,
474
+ baseApiUrl: o,
475
+ network: a
476
+ }
477
+ )), await s(() => {
478
+ const e = i.getAllByTestId("channel-search")[0];
479
+ t(e).toHaveAttribute("data-auto-scroll-offset", "9999");
480
+ });
481
+ }), r("should handle zero autoScrollOffset", async () => {
482
+ c(/* @__PURE__ */ n(
483
+ l,
484
+ {
485
+ compactLayout: !0,
486
+ autoScrollOffset: 0,
487
+ baseApiUrl: o,
488
+ network: a
489
+ }
490
+ )), await s(() => {
491
+ const e = i.getAllByTestId("channel-search")[0];
492
+ t(e).toHaveAttribute("data-auto-scroll-offset", "0");
493
+ });
494
+ }), r("should not render DeviceAndPlatformLists before platforms are loaded", () => {
495
+ m.mockImplementation(() => new Promise(() => {
496
+ })), c(/* @__PURE__ */ n(l, { baseApiUrl: o, network: a })), t(i.queryByTestId("device-platform-lists")).not.toBeInTheDocument();
497
+ });
498
+ });
499
+ });