@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.
- package/dist/{Form.module-Cd8qH2rj.mjs → Form.module-CarfWK5T.mjs} +1 -1
- package/dist/ResultsTable.module-wcNUQEKe.mjs +14 -0
- package/dist/_commonjsHelpers-DaMA6jEr.mjs +8 -0
- package/dist/assets/ResultsTable.css +1 -1
- package/dist/{chevron-left-DRvpaLmK.mjs → chevron-left-D0UjbrKw.mjs} +1 -1
- package/dist/{chevron-right-C8yCnmfx.mjs → chevron-right-0ZF3LruR.mjs} +1 -1
- package/dist/components/ActionButton/ActionButton.test.js +209 -0
- package/dist/components/AdBlock/AdBlock.test.js +286 -0
- package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +295 -0
- package/dist/components/AirDateFormatter/AirDateFormatter.test.js +192 -0
- package/dist/components/AnchorTag/AnchorTag.test.js +463 -0
- package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +295 -0
- package/dist/components/BasicGridModule/BasicGridModule.js +41 -37
- package/dist/components/BasicGridModule/BasicGridModule.test.js +227 -0
- package/dist/components/Button/Button.test.js +434 -0
- package/dist/components/Carousel/Carousel.js +2 -2
- package/dist/components/Carousel/Carousel.test.js +705 -0
- package/dist/components/CarouselSlide/CarouselSlide.test.js +378 -0
- package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
- package/dist/components/CastInfoLayout/CastInfoLayout.test.js +294 -0
- package/dist/components/ChannelSearch/ChannelSearch.test.js +565 -0
- package/dist/components/ChoicesItem/ChoicesItem.test.js +428 -0
- package/dist/components/Concat/Concat.js +1 -1
- package/dist/components/Concat/Concat.test.js +115 -0
- package/dist/components/CtaBlock/CtaBlock.js +1 -1
- package/dist/components/CtaBlock/CtaBlock.test.js +226 -0
- package/dist/components/CustomDataList/CustomDataList.js +4 -4
- package/dist/components/CustomSelect/CustomSelect.js +86 -86
- package/dist/components/CustomSelect/CustomSelect.test.js +313 -0
- package/dist/components/DateNavigation/DateNavigation.js +10 -10
- package/dist/components/DateNavigation/DateNavigation.test.js +370 -0
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +288 -0
- package/dist/components/DrawerNavigation/DrawerNavigation.test.js +316 -0
- package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +337 -0
- package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +358 -0
- package/dist/components/ErrorHandler/ErrorHandler.js +2 -2
- package/dist/components/ErrorHandler/ErrorHandler.test.js +158 -0
- package/dist/components/FeaturedList/FeaturedList.test.js +353 -0
- package/dist/components/Figure/Figure.js +1 -1
- package/dist/components/Figure/Figure.test.js +198 -0
- package/dist/components/FindUs/FindUs.test.js +499 -0
- package/dist/components/FooterNavigation/FooterNavigation.test.js +310 -0
- package/dist/components/GenericList/GenericList.js +1 -1
- package/dist/components/GenericList/GenericList.test.js +288 -0
- package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +689 -0
- package/dist/components/GradientButton/GradientButton.d.ts +1 -1
- package/dist/components/GradientButton/GradientButton.js +33 -31
- package/dist/components/GradientButton/GradientButton.test.js +457 -0
- package/dist/components/GridList/GridList.test.js +371 -0
- package/dist/components/ImageCard/ImageCard.test.js +668 -0
- package/dist/components/ImageCard/ImageCardCore.js +28 -28
- package/dist/components/ImageCard/ImageCardCore.test.js +577 -0
- package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +379 -0
- package/dist/components/InfoPanel/InfoPanel.js +1 -1
- package/dist/components/InlineNavigation/InlineNavigation.test.js +149 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.test.js +263 -0
- package/dist/components/InstructionsList/InstructionsList.js +11 -11
- package/dist/components/InstructionsList/InstructionsList.test.js +181 -0
- package/dist/components/LogoListItem/LogoListItem.test.js +303 -0
- package/dist/components/LogoNavigation/LogoNavigation.test.js +352 -0
- package/dist/components/ModalContainer/ModalContainer.js +2 -2
- package/dist/components/NavList/NavList.test.js +332 -0
- package/dist/components/Overlay/Overlay.js +24 -23
- package/dist/components/Overlay/Overlay.test.js +198 -0
- package/dist/components/PageHero/PageHero.test.js +241 -0
- package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
- package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
- package/dist/components/ProgramAirdate/ProgramAirdate.test.js +414 -0
- package/dist/components/PromotionBlock/PromotionBlock.test.js +208 -0
- package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +221 -0
- package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +349 -0
- package/dist/components/RescanInstructions/RescanInstructions.test.js +218 -0
- package/dist/components/ResponsiveImage/ResponsiveImage.test.js +264 -0
- package/dist/components/ResultsTable/ResultsTable.js +9 -2
- package/dist/components/ResultsTable/ResultsTable.test.js +402 -0
- package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
- package/dist/components/ResultsTableBody/ResultsTableBody.test.js +445 -0
- package/dist/components/ResultsTableHeader/ResultsTableHeader.js +37 -15
- package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +275 -0
- package/dist/components/ScheduleLayout/ScheduleContext.js +654 -626
- package/dist/components/ScheduleLayout/ScheduleLayout.js +1 -1
- package/dist/components/ScheduleLayout/useScheduleContext.js +5 -10
- package/dist/components/ScheduleList/ScheduleList.js +1 -1
- package/dist/components/SectionedContent/SectionedContent.js +1 -1
- package/dist/components/SectionedContent/SectionedContent.test.js +341 -0
- package/dist/components/Select/Select.js +24 -24
- package/dist/components/Select/Select.test.js +367 -0
- package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
- package/dist/components/ShowAboutContent/ShowAboutContent.test.js +535 -0
- package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +570 -0
- package/dist/components/SocialLinks/SocialLinks.js +1 -1
- package/dist/components/StringList/StringList.js +1 -1
- package/dist/components/StringList/StringList.test.js +311 -0
- package/dist/components/TabContent/TabContent.js +1 -1
- package/dist/components/TabContent/TabContent.test.js +274 -0
- package/dist/components/TabNavigation/TabNavigation.js +21 -21
- package/dist/components/TabNavigation/TabNavigation.test.js +535 -0
- package/dist/components/TabbedContent/TabbedContent.test.js +654 -0
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/UpcomingList/UpcomingList.test.js +471 -0
- package/dist/{index-VjANCDXC.mjs → index-06PEPfBQ.mjs} +1 -1
- package/dist/index-BUN4jQ3m.mjs +3098 -0
- package/dist/index-BVxBrkZB.mjs +3 -0
- package/dist/{index-DC2JJV3a.mjs → index-D3kkcgee.mjs} +1 -1
- package/dist/{index-C-kn9Zhn.mjs → index-DzfYkULW.mjs} +2 -1
- package/dist/magic-string.es-uPKorP4O.mjs +663 -0
- package/dist/matchers-35e4d3bd-BBPNTlen.mjs +2404 -0
- package/dist/react.esm-DLSrfVwM.mjs +23410 -0
- package/dist/test/setupTests.d.ts +1 -0
- package/dist/test/setupTests.js +55 -0
- package/dist/{triangle-PcCcGXjr.mjs → triangle-C4z906Wf.mjs} +1 -1
- package/dist/useScheduleContext-D7FdzNxe.mjs +17 -0
- package/dist/utils/analytics.js +1 -1
- package/dist/utils/getOnNowProgram.js +10 -10
- package/dist/{x-C-QzJ-qD.mjs → x-Ck9Vk5Fo.mjs} +1 -1
- package/package.json +4 -1
- package/dist/ResultsTable.module-1zxhXaem.mjs +0 -14
- package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import { jsxs as y, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { v as I, d as E, b as _, a as k, i as m, r as l, w as s, g as t, s as p } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import "../../index-BVxBrkZB.mjs";
|
|
4
|
+
import { GetAirdateWrapper as n } from "./GetAirdateWrapper.js";
|
|
5
|
+
const a = I.fn();
|
|
6
|
+
I.mock("../../hooks/useGetUpcoming", () => ({
|
|
7
|
+
default: (u) => a(u)
|
|
8
|
+
}));
|
|
9
|
+
const T = I.fn();
|
|
10
|
+
I.mock("../../utils/helpers", () => ({
|
|
11
|
+
convert12to24: (u) => T(u)
|
|
12
|
+
}));
|
|
13
|
+
I.mock("../AirDateFormatter", () => ({
|
|
14
|
+
default: ({ airdateStr: u, separatorType: o }) => /* @__PURE__ */ y(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
"data-airdate": u,
|
|
18
|
+
"data-separator": o,
|
|
19
|
+
"data-testid": "air-date-formatter",
|
|
20
|
+
children: [
|
|
21
|
+
"AirDateFormatter: ",
|
|
22
|
+
u
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}));
|
|
27
|
+
I.mock("../StringList", () => ({
|
|
28
|
+
default: ({ list: u, separatorType: o }) => /* @__PURE__ */ i(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
"data-items-count": u.length,
|
|
32
|
+
"data-separator": o,
|
|
33
|
+
"data-testid": "string-list",
|
|
34
|
+
children: u.map(
|
|
35
|
+
(r, c) => /* @__PURE__ */ i("div", { "data-testid": `string-list-item-${c}`, children: r }, c)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}));
|
|
40
|
+
E("GetAirdateWrapper", () => {
|
|
41
|
+
let u;
|
|
42
|
+
const o = "https://api.test.com/schedule", r = "test-network", c = (e) => ({
|
|
43
|
+
program_id: "12345",
|
|
44
|
+
title_name: "Test Episode",
|
|
45
|
+
start_date_parse: "2024-01-15",
|
|
46
|
+
start_time: "8:00 PM",
|
|
47
|
+
episode_number: "S01E05",
|
|
48
|
+
title_code: "TE0105",
|
|
49
|
+
program_class: "Series",
|
|
50
|
+
...e
|
|
51
|
+
});
|
|
52
|
+
_(() => {
|
|
53
|
+
u = document.createElement("div"), u.id = "root", document.body.appendChild(u), I.clearAllMocks(), T.mockReturnValue("20:00"), a.mockResolvedValue([]);
|
|
54
|
+
}), k(() => {
|
|
55
|
+
document.body.removeChild(u);
|
|
56
|
+
}), E("Basic Rendering", () => {
|
|
57
|
+
m("should render empty fragment when no airdate data", async () => {
|
|
58
|
+
a.mockResolvedValue([]);
|
|
59
|
+
const { container: e } = l(
|
|
60
|
+
/* @__PURE__ */ i(
|
|
61
|
+
n,
|
|
62
|
+
{
|
|
63
|
+
NETWORK: r,
|
|
64
|
+
SCHEDULE_ENDPOINT: o,
|
|
65
|
+
programId: "12345"
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
);
|
|
69
|
+
await s(() => {
|
|
70
|
+
t(e.firstChild).toBeNull();
|
|
71
|
+
});
|
|
72
|
+
}), m("should render empty fragment when programId is empty string", async () => {
|
|
73
|
+
const { container: e } = l(
|
|
74
|
+
/* @__PURE__ */ i(
|
|
75
|
+
n,
|
|
76
|
+
{
|
|
77
|
+
NETWORK: r,
|
|
78
|
+
SCHEDULE_ENDPOINT: o,
|
|
79
|
+
programId: ""
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
await s(() => {
|
|
84
|
+
t(e.firstChild).toBeNull();
|
|
85
|
+
});
|
|
86
|
+
}), m("should render AirDateFormatter when airdate is available", async () => {
|
|
87
|
+
const e = c();
|
|
88
|
+
a.mockResolvedValue([e]), l(
|
|
89
|
+
/* @__PURE__ */ i(
|
|
90
|
+
n,
|
|
91
|
+
{
|
|
92
|
+
NETWORK: r,
|
|
93
|
+
SCHEDULE_ENDPOINT: o,
|
|
94
|
+
programId: "12345"
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
), await s(() => {
|
|
98
|
+
t(p.getByTestId("air-date-formatter")).toBeInTheDocument();
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}), E("Hook Integration", () => {
|
|
102
|
+
m("should call useGetUpcoming with correct parameters", async () => {
|
|
103
|
+
a.mockResolvedValue([]), l(
|
|
104
|
+
/* @__PURE__ */ i(
|
|
105
|
+
n,
|
|
106
|
+
{
|
|
107
|
+
NETWORK: r,
|
|
108
|
+
SCHEDULE_ENDPOINT: o,
|
|
109
|
+
programId: "12345",
|
|
110
|
+
programType: "series"
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
), await s(() => {
|
|
114
|
+
t(a).toHaveBeenCalledWith({
|
|
115
|
+
programId: "12345",
|
|
116
|
+
programType: "series",
|
|
117
|
+
SCHEDULE_ENDPOINT: o,
|
|
118
|
+
NETWORK: r
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}), m("should convert numeric programId to string", async () => {
|
|
122
|
+
a.mockResolvedValue([]), l(
|
|
123
|
+
/* @__PURE__ */ i(
|
|
124
|
+
n,
|
|
125
|
+
{
|
|
126
|
+
NETWORK: r,
|
|
127
|
+
SCHEDULE_ENDPOINT: o,
|
|
128
|
+
programId: 12345
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
), await s(() => {
|
|
132
|
+
t(a).toHaveBeenCalledWith(
|
|
133
|
+
t.objectContaining({
|
|
134
|
+
programId: "12345"
|
|
135
|
+
})
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
}), m("should pass undefined programType when type is unknown", async () => {
|
|
139
|
+
a.mockResolvedValue([]), l(
|
|
140
|
+
/* @__PURE__ */ i(
|
|
141
|
+
n,
|
|
142
|
+
{
|
|
143
|
+
NETWORK: r,
|
|
144
|
+
SCHEDULE_ENDPOINT: o,
|
|
145
|
+
programId: "12345",
|
|
146
|
+
programType: "unknown"
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
), await s(() => {
|
|
150
|
+
t(a).toHaveBeenCalledWith(
|
|
151
|
+
t.objectContaining({
|
|
152
|
+
programType: void 0
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
});
|
|
156
|
+
}), m("should pass film programType correctly", async () => {
|
|
157
|
+
a.mockResolvedValue([]), l(
|
|
158
|
+
/* @__PURE__ */ i(
|
|
159
|
+
n,
|
|
160
|
+
{
|
|
161
|
+
NETWORK: r,
|
|
162
|
+
SCHEDULE_ENDPOINT: o,
|
|
163
|
+
programId: "12345",
|
|
164
|
+
programType: "film"
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
), await s(() => {
|
|
168
|
+
t(a).toHaveBeenCalledWith(
|
|
169
|
+
t.objectContaining({
|
|
170
|
+
programType: "film"
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}), E("Airdate Formatting", () => {
|
|
176
|
+
m("should format airdate with date and converted time", async () => {
|
|
177
|
+
const e = c({
|
|
178
|
+
start_date_parse: "2024-01-15",
|
|
179
|
+
start_time: "8:00 PM"
|
|
180
|
+
});
|
|
181
|
+
a.mockResolvedValue([e]), T.mockReturnValue("20:00"), l(
|
|
182
|
+
/* @__PURE__ */ i(
|
|
183
|
+
n,
|
|
184
|
+
{
|
|
185
|
+
NETWORK: r,
|
|
186
|
+
SCHEDULE_ENDPOINT: o,
|
|
187
|
+
programId: "12345"
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
), await s(() => {
|
|
191
|
+
const d = p.getByTestId("air-date-formatter");
|
|
192
|
+
t(d).toHaveAttribute("data-airdate", "2024-01-15 20:00");
|
|
193
|
+
});
|
|
194
|
+
}), m("should call convert12to24 with start_time", async () => {
|
|
195
|
+
const e = c({
|
|
196
|
+
start_time: "8:00 PM"
|
|
197
|
+
});
|
|
198
|
+
a.mockResolvedValue([e]), l(
|
|
199
|
+
/* @__PURE__ */ i(
|
|
200
|
+
n,
|
|
201
|
+
{
|
|
202
|
+
NETWORK: r,
|
|
203
|
+
SCHEDULE_ENDPOINT: o,
|
|
204
|
+
programId: "12345"
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
), await s(() => {
|
|
208
|
+
t(T).toHaveBeenCalledWith("8:00 PM");
|
|
209
|
+
});
|
|
210
|
+
}), m("should pass separatorType to AirDateFormatter", async () => {
|
|
211
|
+
const e = c();
|
|
212
|
+
a.mockResolvedValue([e]), l(
|
|
213
|
+
/* @__PURE__ */ i(
|
|
214
|
+
n,
|
|
215
|
+
{
|
|
216
|
+
NETWORK: r,
|
|
217
|
+
SCHEDULE_ENDPOINT: o,
|
|
218
|
+
programId: "12345",
|
|
219
|
+
separatorType: "line-break"
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
), await s(() => {
|
|
223
|
+
const d = p.getByTestId("air-date-formatter");
|
|
224
|
+
t(d).toHaveAttribute("data-separator", "line-break");
|
|
225
|
+
});
|
|
226
|
+
}), m("should use default pipe separator", async () => {
|
|
227
|
+
const e = c();
|
|
228
|
+
a.mockResolvedValue([e]), l(
|
|
229
|
+
/* @__PURE__ */ i(
|
|
230
|
+
n,
|
|
231
|
+
{
|
|
232
|
+
NETWORK: r,
|
|
233
|
+
SCHEDULE_ENDPOINT: o,
|
|
234
|
+
programId: "12345"
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
), await s(() => {
|
|
238
|
+
const d = p.getByTestId("air-date-formatter");
|
|
239
|
+
t(d).toHaveAttribute("data-separator", "pipe");
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
}), E("Episode Information", () => {
|
|
243
|
+
m("should not include episode when includeEpisode is false", async () => {
|
|
244
|
+
const e = c();
|
|
245
|
+
a.mockResolvedValue([e]), l(
|
|
246
|
+
/* @__PURE__ */ i(
|
|
247
|
+
n,
|
|
248
|
+
{
|
|
249
|
+
NETWORK: r,
|
|
250
|
+
SCHEDULE_ENDPOINT: o,
|
|
251
|
+
includeEpisode: !1,
|
|
252
|
+
programId: "12345"
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
), await s(() => {
|
|
256
|
+
t(p.queryByTestId("string-list")).not.toBeInTheDocument(), t(p.getByTestId("air-date-formatter")).toBeInTheDocument();
|
|
257
|
+
});
|
|
258
|
+
}), m("should include episode when includeEpisode is true", async () => {
|
|
259
|
+
const e = c({
|
|
260
|
+
episode_number: "S01E05",
|
|
261
|
+
title_name: "Test Episode"
|
|
262
|
+
});
|
|
263
|
+
a.mockResolvedValue([e]), l(
|
|
264
|
+
/* @__PURE__ */ i(
|
|
265
|
+
n,
|
|
266
|
+
{
|
|
267
|
+
includeEpisode: !0,
|
|
268
|
+
NETWORK: r,
|
|
269
|
+
SCHEDULE_ENDPOINT: o,
|
|
270
|
+
programId: "12345"
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
), await s(() => {
|
|
274
|
+
t(p.getByTestId("string-list")).toBeInTheDocument();
|
|
275
|
+
});
|
|
276
|
+
}), m("should format episode with episode_number when available", async () => {
|
|
277
|
+
const e = c({
|
|
278
|
+
episode_number: "S01E05",
|
|
279
|
+
title_name: "The Great Episode"
|
|
280
|
+
});
|
|
281
|
+
a.mockResolvedValue([e]), l(
|
|
282
|
+
/* @__PURE__ */ i(
|
|
283
|
+
n,
|
|
284
|
+
{
|
|
285
|
+
includeEpisode: !0,
|
|
286
|
+
NETWORK: r,
|
|
287
|
+
SCHEDULE_ENDPOINT: o,
|
|
288
|
+
programId: "12345"
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
), await s(() => {
|
|
292
|
+
const d = p.getByTestId("string-list-item-1");
|
|
293
|
+
t(d).toHaveTextContent("S01E05: The Great Episode");
|
|
294
|
+
});
|
|
295
|
+
}), m("should use title_code when episode_number is not available", async () => {
|
|
296
|
+
const e = c({
|
|
297
|
+
episode_number: void 0,
|
|
298
|
+
title_code: "ABC0105",
|
|
299
|
+
title_name: "Episode Title"
|
|
300
|
+
});
|
|
301
|
+
a.mockResolvedValue([e]), l(
|
|
302
|
+
/* @__PURE__ */ i(
|
|
303
|
+
n,
|
|
304
|
+
{
|
|
305
|
+
includeEpisode: !0,
|
|
306
|
+
NETWORK: r,
|
|
307
|
+
SCHEDULE_ENDPOINT: o,
|
|
308
|
+
programId: "12345"
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
), await s(() => {
|
|
312
|
+
const d = p.getByTestId("string-list-item-1");
|
|
313
|
+
t(d).toHaveTextContent("0105: Episode Title");
|
|
314
|
+
});
|
|
315
|
+
}), m("should render StringList with pipe separator when includeEpisode is true", async () => {
|
|
316
|
+
const e = c();
|
|
317
|
+
a.mockResolvedValue([e]), l(
|
|
318
|
+
/* @__PURE__ */ i(
|
|
319
|
+
n,
|
|
320
|
+
{
|
|
321
|
+
includeEpisode: !0,
|
|
322
|
+
NETWORK: r,
|
|
323
|
+
SCHEDULE_ENDPOINT: o,
|
|
324
|
+
programId: "12345"
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
), await s(() => {
|
|
328
|
+
const d = p.getByTestId("string-list");
|
|
329
|
+
t(d).toHaveAttribute("data-separator", "pipe");
|
|
330
|
+
});
|
|
331
|
+
}), m("should include AirDateFormatter in StringList", async () => {
|
|
332
|
+
const e = c();
|
|
333
|
+
a.mockResolvedValue([e]), l(
|
|
334
|
+
/* @__PURE__ */ i(
|
|
335
|
+
n,
|
|
336
|
+
{
|
|
337
|
+
includeEpisode: !0,
|
|
338
|
+
NETWORK: r,
|
|
339
|
+
SCHEDULE_ENDPOINT: o,
|
|
340
|
+
programId: "12345"
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
), await s(() => {
|
|
344
|
+
const d = p.getByTestId("string-list-item-0");
|
|
345
|
+
t(d.querySelector('[data-testid="air-date-formatter"]')).toBeInTheDocument();
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
}), E("DetermineSeasonEpStr Function", () => {
|
|
349
|
+
m("should extract numeric portion from title_code starting with letters", async () => {
|
|
350
|
+
const e = c({
|
|
351
|
+
episode_number: void 0,
|
|
352
|
+
title_code: "ABC0105",
|
|
353
|
+
title_name: "Test"
|
|
354
|
+
});
|
|
355
|
+
a.mockResolvedValue([e]), l(
|
|
356
|
+
/* @__PURE__ */ i(
|
|
357
|
+
n,
|
|
358
|
+
{
|
|
359
|
+
includeEpisode: !0,
|
|
360
|
+
NETWORK: r,
|
|
361
|
+
SCHEDULE_ENDPOINT: o,
|
|
362
|
+
programId: "12345"
|
|
363
|
+
}
|
|
364
|
+
)
|
|
365
|
+
), await s(() => {
|
|
366
|
+
t(p.getByTestId("string-list-item-1")).toHaveTextContent("0105: Test");
|
|
367
|
+
});
|
|
368
|
+
}), m("should handle title_code with multiple letter prefix", async () => {
|
|
369
|
+
const e = c({
|
|
370
|
+
episode_number: void 0,
|
|
371
|
+
title_code: "LONGPREFIX123",
|
|
372
|
+
title_name: "Test"
|
|
373
|
+
});
|
|
374
|
+
a.mockResolvedValue([e]), l(
|
|
375
|
+
/* @__PURE__ */ i(
|
|
376
|
+
n,
|
|
377
|
+
{
|
|
378
|
+
includeEpisode: !0,
|
|
379
|
+
NETWORK: r,
|
|
380
|
+
SCHEDULE_ENDPOINT: o,
|
|
381
|
+
programId: "12345"
|
|
382
|
+
}
|
|
383
|
+
)
|
|
384
|
+
), await s(() => {
|
|
385
|
+
t(p.getByTestId("string-list-item-1")).toHaveTextContent("123: Test");
|
|
386
|
+
});
|
|
387
|
+
}), m("should handle title_code starting with numbers", async () => {
|
|
388
|
+
const e = c({
|
|
389
|
+
episode_number: void 0,
|
|
390
|
+
title_code: "0105ABC",
|
|
391
|
+
title_name: "Test"
|
|
392
|
+
});
|
|
393
|
+
a.mockResolvedValue([e]), l(
|
|
394
|
+
/* @__PURE__ */ i(
|
|
395
|
+
n,
|
|
396
|
+
{
|
|
397
|
+
includeEpisode: !0,
|
|
398
|
+
NETWORK: r,
|
|
399
|
+
SCHEDULE_ENDPOINT: o,
|
|
400
|
+
programId: "12345"
|
|
401
|
+
}
|
|
402
|
+
)
|
|
403
|
+
), await s(() => {
|
|
404
|
+
t(p.getByTestId("string-list-item-1")).toHaveTextContent("0105ABC: Test");
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
}), E("Default Props", () => {
|
|
408
|
+
m("should use series as default programType", async () => {
|
|
409
|
+
a.mockResolvedValue([]), l(
|
|
410
|
+
/* @__PURE__ */ i(
|
|
411
|
+
n,
|
|
412
|
+
{
|
|
413
|
+
NETWORK: r,
|
|
414
|
+
SCHEDULE_ENDPOINT: o,
|
|
415
|
+
programId: "12345"
|
|
416
|
+
}
|
|
417
|
+
)
|
|
418
|
+
), await s(() => {
|
|
419
|
+
t(a).toHaveBeenCalledWith(
|
|
420
|
+
t.objectContaining({
|
|
421
|
+
programType: "series"
|
|
422
|
+
})
|
|
423
|
+
);
|
|
424
|
+
});
|
|
425
|
+
}), m("should use pipe as default separatorType", async () => {
|
|
426
|
+
const e = c();
|
|
427
|
+
a.mockResolvedValue([e]), l(
|
|
428
|
+
/* @__PURE__ */ i(
|
|
429
|
+
n,
|
|
430
|
+
{
|
|
431
|
+
NETWORK: r,
|
|
432
|
+
SCHEDULE_ENDPOINT: o,
|
|
433
|
+
programId: "12345"
|
|
434
|
+
}
|
|
435
|
+
)
|
|
436
|
+
), await s(() => {
|
|
437
|
+
const d = p.getByTestId("air-date-formatter");
|
|
438
|
+
t(d).toHaveAttribute("data-separator", "pipe");
|
|
439
|
+
});
|
|
440
|
+
}), m("should use false as default includeEpisode", async () => {
|
|
441
|
+
const e = c();
|
|
442
|
+
a.mockResolvedValue([e]), l(
|
|
443
|
+
/* @__PURE__ */ i(
|
|
444
|
+
n,
|
|
445
|
+
{
|
|
446
|
+
NETWORK: r,
|
|
447
|
+
SCHEDULE_ENDPOINT: o,
|
|
448
|
+
programId: "12345"
|
|
449
|
+
}
|
|
450
|
+
)
|
|
451
|
+
), await s(() => {
|
|
452
|
+
t(p.queryByTestId("string-list")).not.toBeInTheDocument();
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
}), E("Edge Cases", () => {
|
|
456
|
+
m("should handle empty results array", async () => {
|
|
457
|
+
a.mockResolvedValue([]);
|
|
458
|
+
const { container: e } = l(
|
|
459
|
+
/* @__PURE__ */ i(
|
|
460
|
+
n,
|
|
461
|
+
{
|
|
462
|
+
NETWORK: r,
|
|
463
|
+
SCHEDULE_ENDPOINT: o,
|
|
464
|
+
programId: "12345"
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
);
|
|
468
|
+
await s(() => {
|
|
469
|
+
t(e.firstChild).toBeNull();
|
|
470
|
+
});
|
|
471
|
+
}), m("should handle multiple results and use first item", async () => {
|
|
472
|
+
const e = [
|
|
473
|
+
c({ start_date_parse: "2024-01-15", start_time: "8:00 PM" }),
|
|
474
|
+
c({ start_date_parse: "2024-01-20", start_time: "9:00 PM" })
|
|
475
|
+
];
|
|
476
|
+
a.mockResolvedValue(e), T.mockReturnValue("20:00"), l(
|
|
477
|
+
/* @__PURE__ */ i(
|
|
478
|
+
n,
|
|
479
|
+
{
|
|
480
|
+
NETWORK: r,
|
|
481
|
+
SCHEDULE_ENDPOINT: o,
|
|
482
|
+
programId: "12345"
|
|
483
|
+
}
|
|
484
|
+
)
|
|
485
|
+
), await s(() => {
|
|
486
|
+
const d = p.getByTestId("air-date-formatter");
|
|
487
|
+
t(d).toHaveAttribute("data-airdate", "2024-01-15 20:00");
|
|
488
|
+
});
|
|
489
|
+
}), m("should handle different separator types", async () => {
|
|
490
|
+
const e = c();
|
|
491
|
+
a.mockResolvedValue([e]);
|
|
492
|
+
const d = [
|
|
493
|
+
"pipe",
|
|
494
|
+
"line-break",
|
|
495
|
+
"single-line-break",
|
|
496
|
+
"none",
|
|
497
|
+
void 0
|
|
498
|
+
];
|
|
499
|
+
for (const g of d) {
|
|
500
|
+
const { unmount: N } = l(
|
|
501
|
+
/* @__PURE__ */ i(
|
|
502
|
+
n,
|
|
503
|
+
{
|
|
504
|
+
NETWORK: r,
|
|
505
|
+
SCHEDULE_ENDPOINT: o,
|
|
506
|
+
programId: "12345",
|
|
507
|
+
separatorType: g
|
|
508
|
+
}
|
|
509
|
+
)
|
|
510
|
+
);
|
|
511
|
+
await s(() => {
|
|
512
|
+
const h = p.getByTestId("air-date-formatter");
|
|
513
|
+
t(h).toHaveAttribute("data-separator", g || "pipe");
|
|
514
|
+
}), N();
|
|
515
|
+
}
|
|
516
|
+
}), m("should handle missing title_name in episode", async () => {
|
|
517
|
+
const e = c({
|
|
518
|
+
episode_number: "S01E05",
|
|
519
|
+
title_name: ""
|
|
520
|
+
});
|
|
521
|
+
a.mockResolvedValue([e]), l(
|
|
522
|
+
/* @__PURE__ */ i(
|
|
523
|
+
n,
|
|
524
|
+
{
|
|
525
|
+
includeEpisode: !0,
|
|
526
|
+
NETWORK: r,
|
|
527
|
+
SCHEDULE_ENDPOINT: o,
|
|
528
|
+
programId: "12345"
|
|
529
|
+
}
|
|
530
|
+
)
|
|
531
|
+
), await s(() => {
|
|
532
|
+
const d = p.getByTestId("string-list-item-1");
|
|
533
|
+
t(d).toHaveTextContent("S01E05:");
|
|
534
|
+
});
|
|
535
|
+
}), m("should handle special characters in episode title", async () => {
|
|
536
|
+
const e = c({
|
|
537
|
+
episode_number: "S01E05",
|
|
538
|
+
title_name: "The Hero's Journey & Adventure"
|
|
539
|
+
});
|
|
540
|
+
a.mockResolvedValue([e]), l(
|
|
541
|
+
/* @__PURE__ */ i(
|
|
542
|
+
n,
|
|
543
|
+
{
|
|
544
|
+
includeEpisode: !0,
|
|
545
|
+
NETWORK: r,
|
|
546
|
+
SCHEDULE_ENDPOINT: o,
|
|
547
|
+
programId: "12345"
|
|
548
|
+
}
|
|
549
|
+
)
|
|
550
|
+
), await s(() => {
|
|
551
|
+
const d = p.getByTestId("string-list-item-1");
|
|
552
|
+
t(d).toHaveTextContent("S01E05: The Hero's Journey & Adventure");
|
|
553
|
+
});
|
|
554
|
+
}), m("should handle zero as programId", async () => {
|
|
555
|
+
a.mockResolvedValue([]), l(
|
|
556
|
+
/* @__PURE__ */ i(
|
|
557
|
+
n,
|
|
558
|
+
{
|
|
559
|
+
NETWORK: r,
|
|
560
|
+
SCHEDULE_ENDPOINT: o,
|
|
561
|
+
programId: 0
|
|
562
|
+
}
|
|
563
|
+
)
|
|
564
|
+
), await s(() => {
|
|
565
|
+
t(a).toHaveBeenCalledWith(
|
|
566
|
+
t.objectContaining({
|
|
567
|
+
programId: "0"
|
|
568
|
+
})
|
|
569
|
+
);
|
|
570
|
+
});
|
|
571
|
+
});
|
|
572
|
+
}), E("Integration", () => {
|
|
573
|
+
m("should render complete component with all features", async () => {
|
|
574
|
+
const e = c({
|
|
575
|
+
start_date_parse: "2024-01-15",
|
|
576
|
+
start_time: "8:00 PM",
|
|
577
|
+
episode_number: "S02E10",
|
|
578
|
+
title_name: "The Final Episode"
|
|
579
|
+
});
|
|
580
|
+
a.mockResolvedValue([e]), T.mockReturnValue("20:00"), l(
|
|
581
|
+
/* @__PURE__ */ i(
|
|
582
|
+
n,
|
|
583
|
+
{
|
|
584
|
+
includeEpisode: !0,
|
|
585
|
+
NETWORK: r,
|
|
586
|
+
SCHEDULE_ENDPOINT: o,
|
|
587
|
+
programId: 12345,
|
|
588
|
+
programType: "series",
|
|
589
|
+
separatorType: "line-break"
|
|
590
|
+
}
|
|
591
|
+
)
|
|
592
|
+
), await s(() => {
|
|
593
|
+
const d = p.getByTestId("string-list");
|
|
594
|
+
t(d).toBeInTheDocument(), t(d).toHaveAttribute("data-separator", "pipe"), t(d).toHaveAttribute("data-items-count", "2");
|
|
595
|
+
}), await s(() => {
|
|
596
|
+
const d = p.getByTestId("air-date-formatter");
|
|
597
|
+
t(d).toHaveAttribute("data-airdate", "2024-01-15 20:00"), t(d).toHaveAttribute("data-separator", "line-break");
|
|
598
|
+
}), await s(() => {
|
|
599
|
+
const d = p.getByTestId("string-list-item-1");
|
|
600
|
+
t(d).toHaveTextContent("S02E10: The Final Episode");
|
|
601
|
+
});
|
|
602
|
+
}), m("should update when results change", async () => {
|
|
603
|
+
const e = c({
|
|
604
|
+
start_date_parse: "2024-01-15",
|
|
605
|
+
start_time: "8:00 PM"
|
|
606
|
+
});
|
|
607
|
+
a.mockResolvedValue([e]), T.mockReturnValue("20:00");
|
|
608
|
+
const { rerender: d } = l(
|
|
609
|
+
/* @__PURE__ */ i(
|
|
610
|
+
n,
|
|
611
|
+
{
|
|
612
|
+
NETWORK: r,
|
|
613
|
+
SCHEDULE_ENDPOINT: o,
|
|
614
|
+
programId: "12345"
|
|
615
|
+
}
|
|
616
|
+
)
|
|
617
|
+
);
|
|
618
|
+
await s(() => {
|
|
619
|
+
t(p.getByTestId("air-date-formatter")).toBeInTheDocument();
|
|
620
|
+
});
|
|
621
|
+
const g = c({
|
|
622
|
+
start_date_parse: "2024-01-20",
|
|
623
|
+
start_time: "9:00 PM"
|
|
624
|
+
});
|
|
625
|
+
a.mockResolvedValue([g]), T.mockReturnValue("21:00"), d(
|
|
626
|
+
/* @__PURE__ */ i(
|
|
627
|
+
n,
|
|
628
|
+
{
|
|
629
|
+
NETWORK: r,
|
|
630
|
+
SCHEDULE_ENDPOINT: o,
|
|
631
|
+
programId: "12345"
|
|
632
|
+
}
|
|
633
|
+
)
|
|
634
|
+
), await s(() => {
|
|
635
|
+
t(p.getByTestId("air-date-formatter")).toBeInTheDocument();
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
}), E("Program Types", () => {
|
|
639
|
+
m("should handle series program type", async () => {
|
|
640
|
+
a.mockResolvedValue([]), l(
|
|
641
|
+
/* @__PURE__ */ i(
|
|
642
|
+
n,
|
|
643
|
+
{
|
|
644
|
+
NETWORK: r,
|
|
645
|
+
SCHEDULE_ENDPOINT: o,
|
|
646
|
+
programId: "12345",
|
|
647
|
+
programType: "series"
|
|
648
|
+
}
|
|
649
|
+
)
|
|
650
|
+
), await s(() => {
|
|
651
|
+
t(a).toHaveBeenCalledWith(
|
|
652
|
+
t.objectContaining({ programType: "series" })
|
|
653
|
+
);
|
|
654
|
+
});
|
|
655
|
+
}), m("should handle film program type", async () => {
|
|
656
|
+
a.mockResolvedValue([]), l(
|
|
657
|
+
/* @__PURE__ */ i(
|
|
658
|
+
n,
|
|
659
|
+
{
|
|
660
|
+
NETWORK: r,
|
|
661
|
+
SCHEDULE_ENDPOINT: o,
|
|
662
|
+
programId: "12345",
|
|
663
|
+
programType: "film"
|
|
664
|
+
}
|
|
665
|
+
)
|
|
666
|
+
), await s(() => {
|
|
667
|
+
t(a).toHaveBeenCalledWith(
|
|
668
|
+
t.objectContaining({ programType: "film" })
|
|
669
|
+
);
|
|
670
|
+
});
|
|
671
|
+
}), m("should handle unknown program type", async () => {
|
|
672
|
+
a.mockResolvedValue([]), l(
|
|
673
|
+
/* @__PURE__ */ i(
|
|
674
|
+
n,
|
|
675
|
+
{
|
|
676
|
+
NETWORK: r,
|
|
677
|
+
SCHEDULE_ENDPOINT: o,
|
|
678
|
+
programId: "12345",
|
|
679
|
+
programType: "unknown"
|
|
680
|
+
}
|
|
681
|
+
)
|
|
682
|
+
), await s(() => {
|
|
683
|
+
t(a).toHaveBeenCalledWith(
|
|
684
|
+
t.objectContaining({ programType: void 0 })
|
|
685
|
+
);
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
});
|
|
689
|
+
});
|
|
@@ -12,5 +12,5 @@ type GradientButtonProps = {
|
|
|
12
12
|
hoverGradientEndColor?: string;
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
};
|
|
15
|
-
export declare function GradientButton({ type, label, onClick, varient, size, classname, href, gradientStartColor, gradientEndColor, ...attributes }: GradientButtonProps): JSX.Element;
|
|
15
|
+
export declare function GradientButton({ type, label, onClick, varient, size, classname, href, gradientStartColor, gradientEndColor, hoverGradientStartColor, hoverGradientEndColor, ...attributes }: GradientButtonProps): JSX.Element;
|
|
16
16
|
export default GradientButton;
|