@scrippsproduct/networks-ui-library 1.1.9 → 1.1.10-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,241 @@
|
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { v as d, d as r, b as g, i as l, r as s, g as t, s as i } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import { PageHero as n } from "./PageHero.js";
|
|
4
|
+
import { l as h } from "../../logger-C0N7U0YY.mjs";
|
|
5
|
+
d.mock("../../settings", () => {
|
|
6
|
+
const { lazy: e } = require("react"), a = ({ children: u, title: m }) => /* @__PURE__ */ o("div", { "data-testid": "mock-image-only-hero", "data-title": m, children: u }), c = ({ children: u, title: m }) => /* @__PURE__ */ o("div", { "data-testid": "mock-ion-show-hero", "data-title": m, children: u }), y = ({ children: u, title: m, description: C }) => /* @__PURE__ */ o("div", { "data-description": C, "data-testid": "mock-content-hero", "data-title": m, children: u });
|
|
7
|
+
return {
|
|
8
|
+
pageHeroLayoutsMap: /* @__PURE__ */ new Map([
|
|
9
|
+
["ImageOnlyHero", e(() => Promise.resolve({ default: a }))],
|
|
10
|
+
["IONShowHero", e(() => Promise.resolve({ default: c }))],
|
|
11
|
+
["ContentHero", e(() => Promise.resolve({ default: y }))]
|
|
12
|
+
])
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
d.mock("@scrippsproduct/console-logger", () => ({
|
|
16
|
+
default: {
|
|
17
|
+
setComponent: d.fn(),
|
|
18
|
+
warn: d.fn(),
|
|
19
|
+
error: d.fn(),
|
|
20
|
+
info: d.fn(),
|
|
21
|
+
debug: d.fn()
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
d.mock("../../utils/helpers", () => ({
|
|
25
|
+
classes: (e) => e.filter(Boolean).join(" ")
|
|
26
|
+
}));
|
|
27
|
+
d.mock("./PageHero.module.scss", () => ({
|
|
28
|
+
default: {
|
|
29
|
+
"page-hero": "page-hero-module"
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
r("PageHero", () => {
|
|
33
|
+
g(() => {
|
|
34
|
+
d.clearAllMocks();
|
|
35
|
+
}), r("Basic Rendering", () => {
|
|
36
|
+
l("should render section element", () => {
|
|
37
|
+
const { container: e } = s(/* @__PURE__ */ o(n, {})), a = e.querySelector("section");
|
|
38
|
+
t(a).toBeInTheDocument();
|
|
39
|
+
}), l("should apply page-hero class", () => {
|
|
40
|
+
const { container: e } = s(/* @__PURE__ */ o(n, {})), a = e.querySelector("section");
|
|
41
|
+
t(a).toHaveClass("page-hero");
|
|
42
|
+
}), l("should apply SCSS module class", () => {
|
|
43
|
+
const { container: e } = s(/* @__PURE__ */ o(n, {})), a = e.querySelector("section");
|
|
44
|
+
t(a).toHaveClass("page-hero-module");
|
|
45
|
+
});
|
|
46
|
+
}), r("Layout Component Loading", () => {
|
|
47
|
+
l("should render ImageOnlyHero layout when specified", async () => {
|
|
48
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero" }));
|
|
49
|
+
const e = await i.findByTestId("mock-image-only-hero");
|
|
50
|
+
t(e).toBeInTheDocument();
|
|
51
|
+
}), l("should render IONShowHero layout when specified", async () => {
|
|
52
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "IONShowHero" }));
|
|
53
|
+
const e = await i.findByTestId("mock-ion-show-hero");
|
|
54
|
+
t(e).toBeInTheDocument();
|
|
55
|
+
}), l("should render ContentHero layout when specified", async () => {
|
|
56
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ContentHero" }));
|
|
57
|
+
const e = await i.findByTestId("mock-content-hero");
|
|
58
|
+
t(e).toBeInTheDocument();
|
|
59
|
+
}), l("should warn when layout component not found", () => {
|
|
60
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "NonExistentLayout" })), t(h.warn).toHaveBeenCalledWith(
|
|
61
|
+
"No layout found for PageHero layoutComponent: NonExistentLayout"
|
|
62
|
+
);
|
|
63
|
+
}), l("should warn with empty string layout component", () => {
|
|
64
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "" })), t(h.warn).toHaveBeenCalledWith(
|
|
65
|
+
"No layout found for PageHero layoutComponent: "
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
}), r("Layout Props", () => {
|
|
69
|
+
l("should pass layoutProps to layout component", async () => {
|
|
70
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero", layoutProps: { title: "Test Title" } }));
|
|
71
|
+
const a = await i.findByTestId("mock-image-only-hero");
|
|
72
|
+
t(a).toHaveAttribute("data-title", "Test Title");
|
|
73
|
+
}), l("should pass multiple layoutProps to layout component", async () => {
|
|
74
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ContentHero", layoutProps: {
|
|
75
|
+
title: "Test Title",
|
|
76
|
+
description: "Test Description"
|
|
77
|
+
} }));
|
|
78
|
+
const a = await i.findByTestId("mock-content-hero");
|
|
79
|
+
t(a).toHaveAttribute("data-title", "Test Title"), t(a).toHaveAttribute("data-description", "Test Description");
|
|
80
|
+
}), l("should handle empty layoutProps object", async () => {
|
|
81
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero", layoutProps: {} }));
|
|
82
|
+
const e = await i.findByTestId("mock-image-only-hero");
|
|
83
|
+
t(e).toBeInTheDocument();
|
|
84
|
+
}), l("should use default empty object when layoutProps not provided", async () => {
|
|
85
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero" }));
|
|
86
|
+
const e = await i.findByTestId("mock-image-only-hero");
|
|
87
|
+
t(e).toBeInTheDocument();
|
|
88
|
+
});
|
|
89
|
+
}), r("Children Rendering", () => {
|
|
90
|
+
l("should render children inside layout component", async () => {
|
|
91
|
+
s(
|
|
92
|
+
/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero", children: /* @__PURE__ */ o("p", { children: "Test Child" }) })
|
|
93
|
+
);
|
|
94
|
+
const e = await i.findByTestId("mock-image-only-hero");
|
|
95
|
+
t(e).toHaveTextContent("Test Child");
|
|
96
|
+
}), l("should render multiple children inside layout component", async () => {
|
|
97
|
+
s(
|
|
98
|
+
/* @__PURE__ */ p(n, { layoutComponent: "ContentHero", children: [
|
|
99
|
+
/* @__PURE__ */ o("h1", { children: "Title" }),
|
|
100
|
+
/* @__PURE__ */ o("p", { children: "Description" })
|
|
101
|
+
] })
|
|
102
|
+
);
|
|
103
|
+
const e = await i.findByTestId("mock-content-hero");
|
|
104
|
+
t(e).toHaveTextContent("Title"), t(e).toHaveTextContent("Description");
|
|
105
|
+
}), l("should render children without layout when no layoutComponent", () => {
|
|
106
|
+
s(
|
|
107
|
+
/* @__PURE__ */ o(n, { children: /* @__PURE__ */ o("p", { "data-testid": "direct-child", children: "Direct Child" }) })
|
|
108
|
+
);
|
|
109
|
+
const e = i.getByTestId("direct-child");
|
|
110
|
+
t(e).toBeInTheDocument();
|
|
111
|
+
}), l("should render children directly when layout not found", () => {
|
|
112
|
+
s(
|
|
113
|
+
/* @__PURE__ */ o(n, { layoutComponent: "NonExistentLayout", children: /* @__PURE__ */ o("p", { "data-testid": "fallback-child", children: "Fallback Child" }) })
|
|
114
|
+
);
|
|
115
|
+
const e = i.getByTestId("fallback-child");
|
|
116
|
+
t(e).toBeInTheDocument();
|
|
117
|
+
}), l("should render nothing when no layout and no children", () => {
|
|
118
|
+
const { container: e } = s(/* @__PURE__ */ o(n, {})), a = e.querySelector("section");
|
|
119
|
+
t(a == null ? void 0 : a.textContent).toBe("");
|
|
120
|
+
}), l("should render nothing when layout not found and no children", () => {
|
|
121
|
+
const { container: e } = s(/* @__PURE__ */ o(n, { layoutComponent: "NonExistentLayout" })), a = e.querySelector("section");
|
|
122
|
+
t(a == null ? void 0 : a.textContent).toBe("");
|
|
123
|
+
});
|
|
124
|
+
}), r("Layout Component Changes", () => {
|
|
125
|
+
l("should update layout when layoutComponent prop changes", async () => {
|
|
126
|
+
const { rerender: e } = s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero" })), a = await i.findByTestId("mock-image-only-hero");
|
|
127
|
+
t(a).toBeInTheDocument(), e(/* @__PURE__ */ o(n, { layoutComponent: "IONShowHero" }));
|
|
128
|
+
const c = await i.findByTestId("mock-ion-show-hero");
|
|
129
|
+
t(c).toBeInTheDocument();
|
|
130
|
+
}), l("should clear layout when changed to invalid component", async () => {
|
|
131
|
+
const { rerender: e } = s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero" }));
|
|
132
|
+
await i.findByTestId("mock-image-only-hero"), e(/* @__PURE__ */ o(n, { layoutComponent: "InvalidLayout" })), t(i.queryByTestId("mock-image-only-hero")).not.toBeInTheDocument();
|
|
133
|
+
}), l("should handle changing from valid to empty layout component", async () => {
|
|
134
|
+
const { rerender: e } = s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero" }));
|
|
135
|
+
await i.findByTestId("mock-image-only-hero"), e(/* @__PURE__ */ o(n, { layoutComponent: "" })), t(i.queryByTestId("mock-image-only-hero")).not.toBeInTheDocument();
|
|
136
|
+
});
|
|
137
|
+
}), r("Default Props", () => {
|
|
138
|
+
l("should use empty string as default layoutComponent", () => {
|
|
139
|
+
s(/* @__PURE__ */ o(n, {})), t(h.warn).toHaveBeenCalledWith(
|
|
140
|
+
"No layout found for PageHero layoutComponent: "
|
|
141
|
+
);
|
|
142
|
+
}), l("should use empty object as default layoutProps", async () => {
|
|
143
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero" }));
|
|
144
|
+
const e = await i.findByTestId("mock-image-only-hero");
|
|
145
|
+
t(e).toBeInTheDocument();
|
|
146
|
+
}), l("should handle undefined children", () => {
|
|
147
|
+
const { container: e } = s(/* @__PURE__ */ o(n, {})), a = e.querySelector("section");
|
|
148
|
+
t(a == null ? void 0 : a.textContent).toBe("");
|
|
149
|
+
});
|
|
150
|
+
}), r("Edge Cases", () => {
|
|
151
|
+
l("should handle layoutComponent with special characters", () => {
|
|
152
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "Layout-With-Dashes" })), t(h.warn).toHaveBeenCalledWith(
|
|
153
|
+
"No layout found for PageHero layoutComponent: Layout-With-Dashes"
|
|
154
|
+
);
|
|
155
|
+
}), l("should handle very long layoutComponent name", () => {
|
|
156
|
+
const e = "VeryLongLayoutComponentNameThatExceedsNormalLength";
|
|
157
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: e })), t(h.warn).toHaveBeenCalledWith(
|
|
158
|
+
`No layout found for PageHero layoutComponent: ${e}`
|
|
159
|
+
);
|
|
160
|
+
}), l("should handle layoutProps with null values", async () => {
|
|
161
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero", layoutProps: { title: null } }));
|
|
162
|
+
const a = await i.findByTestId("mock-image-only-hero");
|
|
163
|
+
t(a).toBeInTheDocument();
|
|
164
|
+
}), l("should handle layoutProps with undefined values", async () => {
|
|
165
|
+
s(/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero", layoutProps: { title: void 0 } }));
|
|
166
|
+
const a = await i.findByTestId("mock-image-only-hero");
|
|
167
|
+
t(a).toBeInTheDocument();
|
|
168
|
+
}), l("should handle complex nested children", async () => {
|
|
169
|
+
s(
|
|
170
|
+
/* @__PURE__ */ o(n, { layoutComponent: "ContentHero", children: /* @__PURE__ */ p("div", { children: [
|
|
171
|
+
/* @__PURE__ */ o("h1", { children: "Title" }),
|
|
172
|
+
/* @__PURE__ */ p("div", { children: [
|
|
173
|
+
/* @__PURE__ */ o("p", { children: "Nested content" }),
|
|
174
|
+
/* @__PURE__ */ p("ul", { children: [
|
|
175
|
+
/* @__PURE__ */ o("li", { children: "Item 1" }),
|
|
176
|
+
/* @__PURE__ */ o("li", { children: "Item 2" })
|
|
177
|
+
] })
|
|
178
|
+
] })
|
|
179
|
+
] }) })
|
|
180
|
+
);
|
|
181
|
+
const e = await i.findByTestId("mock-content-hero");
|
|
182
|
+
t(e).toHaveTextContent("Title"), t(e).toHaveTextContent("Nested content"), t(e).toHaveTextContent("Item 1"), t(e).toHaveTextContent("Item 2");
|
|
183
|
+
});
|
|
184
|
+
}), r("Integration", () => {
|
|
185
|
+
l("should handle complete workflow with layout and children", async () => {
|
|
186
|
+
const e = {
|
|
187
|
+
title: "Hero Title",
|
|
188
|
+
description: "Hero Description"
|
|
189
|
+
}, { container: a } = s(
|
|
190
|
+
/* @__PURE__ */ o(
|
|
191
|
+
n,
|
|
192
|
+
{
|
|
193
|
+
layoutComponent: "ContentHero",
|
|
194
|
+
layoutProps: e,
|
|
195
|
+
children: /* @__PURE__ */ o("div", { "data-testid": "hero-content", children: /* @__PURE__ */ o("p", { children: "Content inside hero" }) })
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
), c = a.querySelector("section");
|
|
199
|
+
t(c).toBeInTheDocument(), t(c).toHaveClass("page-hero"), t(c).toHaveClass("page-hero-module");
|
|
200
|
+
const y = await i.findByTestId("mock-content-hero");
|
|
201
|
+
t(y).toHaveAttribute("data-title", "Hero Title"), t(y).toHaveAttribute("data-description", "Hero Description");
|
|
202
|
+
const u = i.getByTestId("hero-content");
|
|
203
|
+
t(u).toBeInTheDocument(), t(y).toContainElement(u);
|
|
204
|
+
}), l("should handle fallback rendering when layout not found", () => {
|
|
205
|
+
const { container: e } = s(
|
|
206
|
+
/* @__PURE__ */ o(n, { layoutComponent: "InvalidLayout", children: /* @__PURE__ */ o("div", { "data-testid": "fallback-content", children: /* @__PURE__ */ o("p", { children: "Fallback content" }) }) })
|
|
207
|
+
);
|
|
208
|
+
t(h.warn).toHaveBeenCalled();
|
|
209
|
+
const a = e.querySelector("section");
|
|
210
|
+
t(a).toBeInTheDocument();
|
|
211
|
+
const c = i.getByTestId("fallback-content");
|
|
212
|
+
t(c).toBeInTheDocument();
|
|
213
|
+
}), l("should handle switching between layouts with same children", async () => {
|
|
214
|
+
const e = /* @__PURE__ */ o("p", { "data-testid": "persistent-child", children: "Persistent Child" }), { rerender: a } = s(
|
|
215
|
+
/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero", children: e })
|
|
216
|
+
), c = await i.findByTestId("mock-image-only-hero");
|
|
217
|
+
t(c).toBeInTheDocument(), t(i.getByTestId("persistent-child")).toBeInTheDocument(), a(
|
|
218
|
+
/* @__PURE__ */ o(n, { layoutComponent: "ContentHero", children: e })
|
|
219
|
+
);
|
|
220
|
+
const y = await i.findByTestId("mock-content-hero");
|
|
221
|
+
t(y).toBeInTheDocument(), t(i.getByTestId("persistent-child")).toBeInTheDocument();
|
|
222
|
+
});
|
|
223
|
+
}), r("Accessibility", () => {
|
|
224
|
+
l("should render semantic section element", () => {
|
|
225
|
+
const { container: e } = s(/* @__PURE__ */ o(n, {})), a = e.querySelector("section");
|
|
226
|
+
t(a).toBeInTheDocument();
|
|
227
|
+
}), l("should maintain semantic structure with layout", async () => {
|
|
228
|
+
s(
|
|
229
|
+
/* @__PURE__ */ o(n, { layoutComponent: "ContentHero", children: /* @__PURE__ */ o("h1", { children: "Main Heading" }) })
|
|
230
|
+
);
|
|
231
|
+
const e = await i.findByRole("heading", { level: 1 });
|
|
232
|
+
t(e).toBeInTheDocument();
|
|
233
|
+
}), l("should preserve children accessibility features", async () => {
|
|
234
|
+
s(
|
|
235
|
+
/* @__PURE__ */ o(n, { layoutComponent: "ImageOnlyHero", children: /* @__PURE__ */ o("button", { "aria-label": "Close", children: "X" }) })
|
|
236
|
+
);
|
|
237
|
+
const e = await i.findByLabelText("Close");
|
|
238
|
+
t(e).toBeInTheDocument();
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as n, jsx as r, Fragment as f } from "react/jsx-runtime";
|
|
2
|
-
import { p as P } from "../../../../index-
|
|
2
|
+
import { p as P } from "../../../../index-06PEPfBQ.mjs";
|
|
3
3
|
import { classes as a } from "../../../../utils/helpers.js";
|
|
4
4
|
import { AirDateFormatter as N } from "../../../AirDateFormatter/AirDateFormatter.js";
|
|
5
5
|
import { GetAirdateWrapper as v } from "../../../GetAirdateWrapper/GetAirdateWrapper.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { p as X } from "../../index-
|
|
2
|
+
import { p as X } from "../../index-06PEPfBQ.mjs";
|
|
3
3
|
import { classes as d } from "../../utils/helpers.js";
|
|
4
4
|
import { Concat as Z } from "../Concat/Concat.js";
|
|
5
5
|
import { CtaBlock as Y } from "../CtaBlock/CtaBlock.js";
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { v as m, d as c, b as p, i as s, r as n, g as r, s as d } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import { ProgramAirdate as l } from "./ProgramAirdate.js";
|
|
4
|
+
m.mock("html-react-parser", () => ({
|
|
5
|
+
default: (t) => t
|
|
6
|
+
}));
|
|
7
|
+
m.mock("date-fns", () => ({
|
|
8
|
+
format: m.fn((t, i) => i === "h" ? "10" : i === ":mm" ? ":30" : i === "H" ? "22" : "10:30"),
|
|
9
|
+
sub: m.fn((t, i) => {
|
|
10
|
+
const o = new Date(t);
|
|
11
|
+
return o.setHours(o.getHours() - i.hours), o;
|
|
12
|
+
})
|
|
13
|
+
}));
|
|
14
|
+
m.mock("../Concat/index.ts", () => ({
|
|
15
|
+
default: ({ list: t }) => /* @__PURE__ */ a("div", { "data-testid": "concat", children: t.map((i, o) => typeof i == "string" ? /* @__PURE__ */ a("span", { children: i }, o) : /* @__PURE__ */ a("span", { children: i }, o)) })
|
|
16
|
+
}));
|
|
17
|
+
m.mock("../CtaBlock/index.ts", () => ({
|
|
18
|
+
default: ({ content: t, cta: i, btnFlatColors: o, ctaButtonStyle: e }) => /* @__PURE__ */ a(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
"data-bg-color": o.bgColor,
|
|
22
|
+
"data-button-style": e,
|
|
23
|
+
"data-href": i.href,
|
|
24
|
+
"data-label": i.label,
|
|
25
|
+
"data-testid": "cta-block",
|
|
26
|
+
children: t
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
}));
|
|
30
|
+
m.mock("../StringList/index.ts", () => ({
|
|
31
|
+
default: ({ list: t, separatorType: i }) => /* @__PURE__ */ a("span", { "data-separator": i, "data-testid": "string-list", children: t.filter(Boolean).join(" | ") })
|
|
32
|
+
}));
|
|
33
|
+
m.mock("../../utils/helpers", () => ({
|
|
34
|
+
classes: (t) => t.filter(Boolean).join(" ")
|
|
35
|
+
}));
|
|
36
|
+
m.mock("./ProgramAirdate.module.scss", () => ({
|
|
37
|
+
default: {
|
|
38
|
+
"program-airdate": "program-airdate-module",
|
|
39
|
+
"program-airdate__descriptor": "program-airdate__descriptor-module",
|
|
40
|
+
"program-airdate__logo": "program-airdate__logo-module",
|
|
41
|
+
"program-airdate--missing-logo": "program-airdate--missing-logo-module",
|
|
42
|
+
"program-airdate__logo-image": "program-airdate__logo-image-module"
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
c("ProgramAirdate", () => {
|
|
46
|
+
const t = {
|
|
47
|
+
id: "1",
|
|
48
|
+
slug: "test-episode",
|
|
49
|
+
title_code: "TEST001",
|
|
50
|
+
start_date_parse: "2024-01-15",
|
|
51
|
+
start_time: "10:30 PM",
|
|
52
|
+
title_name: "Test Episode",
|
|
53
|
+
name: "Test Program",
|
|
54
|
+
airdate: "2024-01-15 22:30:00",
|
|
55
|
+
program_class: "Episode",
|
|
56
|
+
primary_color: "#ff0000",
|
|
57
|
+
secondary_color: "#00ff00",
|
|
58
|
+
episode: {
|
|
59
|
+
name: "The First Episode",
|
|
60
|
+
title: "The First Episode",
|
|
61
|
+
season: 1,
|
|
62
|
+
number: 5,
|
|
63
|
+
series: {
|
|
64
|
+
slug: "test-series",
|
|
65
|
+
name: "Test Series",
|
|
66
|
+
primary_color: "#ff0000",
|
|
67
|
+
secondary_color: "#00ff00",
|
|
68
|
+
logo: {
|
|
69
|
+
black: {
|
|
70
|
+
url: "https://example.com/logo.png",
|
|
71
|
+
aspect_ratio: 1.5
|
|
72
|
+
},
|
|
73
|
+
aspect_ratio: 1.5
|
|
74
|
+
},
|
|
75
|
+
image: {
|
|
76
|
+
url: "https://example.com/series.jpg"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, i = {
|
|
81
|
+
id: "2",
|
|
82
|
+
slug: "test-film",
|
|
83
|
+
title_code: "FILM001",
|
|
84
|
+
start_date_parse: "2024-01-16",
|
|
85
|
+
start_time: "8:00 PM",
|
|
86
|
+
title_name: "Test Film",
|
|
87
|
+
name: "Test Film",
|
|
88
|
+
airdate: "2024-01-16 20:00:00",
|
|
89
|
+
program_class: "Film",
|
|
90
|
+
primary_color: "#0000ff",
|
|
91
|
+
secondary_color: "#ffff00"
|
|
92
|
+
};
|
|
93
|
+
p(() => {
|
|
94
|
+
m.clearAllMocks();
|
|
95
|
+
}), c("Basic Rendering - Episode", () => {
|
|
96
|
+
s("should render program-airdate container", () => {
|
|
97
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".program-airdate");
|
|
98
|
+
r(e).toBeInTheDocument();
|
|
99
|
+
}), s("should apply SCSS module class", () => {
|
|
100
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".program-airdate");
|
|
101
|
+
r(e).toHaveClass("program-airdate-module");
|
|
102
|
+
}), s("should render descriptor text", () => {
|
|
103
|
+
const { container: o } = n(
|
|
104
|
+
/* @__PURE__ */ a(l, { brand: "Test Network", program: t })
|
|
105
|
+
), e = o.querySelector(".program-airdate__descriptor-module");
|
|
106
|
+
r(e).toHaveTextContent("Now Playing on Test Network");
|
|
107
|
+
}), s("should render logo container", () => {
|
|
108
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".program-airdate__logo-module");
|
|
109
|
+
r(e).toBeInTheDocument();
|
|
110
|
+
}), s("should render CtaBlock component", () => {
|
|
111
|
+
n(/* @__PURE__ */ a(l, { program: t }));
|
|
112
|
+
const o = d.getByTestId("cta-block");
|
|
113
|
+
r(o).toBeInTheDocument();
|
|
114
|
+
});
|
|
115
|
+
}), c("Basic Rendering - Film", () => {
|
|
116
|
+
s("should render program-airdate container for film", () => {
|
|
117
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: i })), e = o.querySelector(".program-airdate");
|
|
118
|
+
r(e).toBeInTheDocument();
|
|
119
|
+
}), s("should render descriptor for film", () => {
|
|
120
|
+
const { container: o } = n(
|
|
121
|
+
/* @__PURE__ */ a(l, { brand: "Movie Channel", program: i })
|
|
122
|
+
), e = o.querySelector(".program-airdate__descriptor-module");
|
|
123
|
+
r(e).toHaveTextContent("Now Playing on Movie Channel");
|
|
124
|
+
}), s("should apply missing-logo class for film", () => {
|
|
125
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: i })), e = o.querySelector(".program-airdate__logo-module");
|
|
126
|
+
r(e).toHaveClass("program-airdate--missing-logo-module");
|
|
127
|
+
});
|
|
128
|
+
}), c("Type Descriptors", () => {
|
|
129
|
+
s('should display "Now Playing on" for on-now type', () => {
|
|
130
|
+
const { container: o } = n(
|
|
131
|
+
/* @__PURE__ */ a(l, { brand: "Network", program: t, type: "on-now" })
|
|
132
|
+
), e = o.querySelector(".program-airdate__descriptor-module");
|
|
133
|
+
r(e).toHaveTextContent("Now Playing on Network");
|
|
134
|
+
}), s('should display "Playing Tomorrow on" for on-tomorrow type', () => {
|
|
135
|
+
const { container: o } = n(
|
|
136
|
+
/* @__PURE__ */ a(l, { brand: "Network", program: t, type: "on-tomorrow" })
|
|
137
|
+
), e = o.querySelector(".program-airdate__descriptor-module");
|
|
138
|
+
r(e).toHaveTextContent("Playing Tomorrow on Network");
|
|
139
|
+
}), s('should display "Coming Soon on" for upcoming type', () => {
|
|
140
|
+
const { container: o } = n(
|
|
141
|
+
/* @__PURE__ */ a(l, { brand: "Network", program: t, type: "upcoming" })
|
|
142
|
+
), e = o.querySelector(".program-airdate__descriptor-module");
|
|
143
|
+
r(e).toHaveTextContent("Coming Soon on Network");
|
|
144
|
+
});
|
|
145
|
+
}), c("Episode Numbering", () => {
|
|
146
|
+
s("should display season and episode number", () => {
|
|
147
|
+
n(/* @__PURE__ */ a(l, { program: t }));
|
|
148
|
+
const o = d.getByTestId("string-list");
|
|
149
|
+
r(o).toHaveTextContent("S1 E5");
|
|
150
|
+
}), s("should display only episode number when season is null", () => {
|
|
151
|
+
const o = {
|
|
152
|
+
...t,
|
|
153
|
+
episode: {
|
|
154
|
+
...t.episode,
|
|
155
|
+
season: null,
|
|
156
|
+
number: 10
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
n(/* @__PURE__ */ a(l, { program: o }));
|
|
160
|
+
const e = d.getByTestId("string-list");
|
|
161
|
+
r(e).toHaveTextContent("E10");
|
|
162
|
+
}), s("should display only season number when episode is null", () => {
|
|
163
|
+
const o = {
|
|
164
|
+
...t,
|
|
165
|
+
episode: {
|
|
166
|
+
...t.episode,
|
|
167
|
+
season: 3,
|
|
168
|
+
number: null
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
n(/* @__PURE__ */ a(l, { program: o }));
|
|
172
|
+
const e = d.getByTestId("string-list");
|
|
173
|
+
r(e).toHaveTextContent("S3");
|
|
174
|
+
}), s("should not display episode number when both are null", () => {
|
|
175
|
+
const o = {
|
|
176
|
+
...t,
|
|
177
|
+
episode: {
|
|
178
|
+
...t.episode,
|
|
179
|
+
season: null,
|
|
180
|
+
number: null
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
n(/* @__PURE__ */ a(l, { program: o }));
|
|
184
|
+
const e = d.getByTestId("string-list");
|
|
185
|
+
r(e.textContent).not.toMatch(/S\d+/), r(e.textContent).not.toMatch(/E\d+/);
|
|
186
|
+
});
|
|
187
|
+
}), c("Logo Rendering - Gradient Style", () => {
|
|
188
|
+
s("should render with gradient style by default", () => {
|
|
189
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".program-airdate__logo-module");
|
|
190
|
+
r(e).toHaveAttribute("data-style", "gradient");
|
|
191
|
+
}), s("should apply CSS custom properties for gradient", () => {
|
|
192
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".program-airdate"), g = e == null ? void 0 : e.getAttribute("style");
|
|
193
|
+
r(g).toContain("--pa-logo-image"), r(g).toContain("--pa-gradient");
|
|
194
|
+
}), s("should render screen reader text for logo", () => {
|
|
195
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".sr-only");
|
|
196
|
+
r(e).toHaveTextContent("Test Series");
|
|
197
|
+
}), s("should not render img tag for gradient style", () => {
|
|
198
|
+
const { container: o } = n(
|
|
199
|
+
/* @__PURE__ */ a(l, { logoStyle: "gradient", program: t })
|
|
200
|
+
), e = o.querySelector(".program-airdate__logo-image-module");
|
|
201
|
+
r(e).not.toBeInTheDocument();
|
|
202
|
+
});
|
|
203
|
+
}), c("Logo Rendering - Non-Gradient Style", () => {
|
|
204
|
+
s("should render img tag for non-gradient style", () => {
|
|
205
|
+
const { container: o } = n(
|
|
206
|
+
/* @__PURE__ */ a(l, { logoStyle: "standard", program: t })
|
|
207
|
+
), e = o.querySelector(".program-airdate__logo-image-module");
|
|
208
|
+
r(e).toBeInTheDocument();
|
|
209
|
+
}), s("should set correct src for logo image", () => {
|
|
210
|
+
const { container: o } = n(
|
|
211
|
+
/* @__PURE__ */ a(l, { logoStyle: "standard", program: t })
|
|
212
|
+
), e = o.querySelector(".program-airdate__logo-image-module");
|
|
213
|
+
r(e).toHaveAttribute("src", "https://example.com/logo.png");
|
|
214
|
+
}), s("should set alt text for logo image", () => {
|
|
215
|
+
const { container: o } = n(
|
|
216
|
+
/* @__PURE__ */ a(l, { logoStyle: "standard", program: t })
|
|
217
|
+
), e = o.querySelector(".program-airdate__logo-image-module");
|
|
218
|
+
r(e).toHaveAttribute("alt", "Test Series");
|
|
219
|
+
});
|
|
220
|
+
}), c("useLogo Prop", () => {
|
|
221
|
+
s("should show logo when useLogo is true", () => {
|
|
222
|
+
const { container: o } = n(
|
|
223
|
+
/* @__PURE__ */ a(l, { useLogo: !0, logoStyle: "standard", program: t })
|
|
224
|
+
), e = o.querySelector(".program-airdate__logo-image-module");
|
|
225
|
+
r(e).toBeInTheDocument();
|
|
226
|
+
}), s("should hide logo when useLogo is false", () => {
|
|
227
|
+
const { container: o } = n(
|
|
228
|
+
/* @__PURE__ */ a(l, { logoStyle: "standard", program: t, useLogo: !1 })
|
|
229
|
+
), e = o.querySelector(".program-airdate__logo-image-module");
|
|
230
|
+
r(e).not.toBeInTheDocument();
|
|
231
|
+
}), s("should show series name text when useLogo is false", () => {
|
|
232
|
+
const { container: o } = n(
|
|
233
|
+
/* @__PURE__ */ a(l, { program: t, useLogo: !1 })
|
|
234
|
+
), e = o.querySelector(".program-airdate__logo-module");
|
|
235
|
+
r(e).toHaveTextContent("Test Series");
|
|
236
|
+
});
|
|
237
|
+
}), c("Button Styles", () => {
|
|
238
|
+
s("should use flat button style by default", () => {
|
|
239
|
+
n(/* @__PURE__ */ a(l, { program: t }));
|
|
240
|
+
const o = d.getByTestId("cta-block");
|
|
241
|
+
r(o).toHaveAttribute("data-button-style", "flat");
|
|
242
|
+
}), s("should use gradient button style when specified", () => {
|
|
243
|
+
n(/* @__PURE__ */ a(l, { buttonStyle: "gradient", program: t }));
|
|
244
|
+
const o = d.getByTestId("cta-block");
|
|
245
|
+
r(o).toHaveAttribute("data-button-style", "gradient");
|
|
246
|
+
});
|
|
247
|
+
}), c("useSeriesColors Prop", () => {
|
|
248
|
+
s("should use series colors when useSeriesColors is true", () => {
|
|
249
|
+
n(/* @__PURE__ */ a(l, { useSeriesColors: !0, program: t }));
|
|
250
|
+
const o = d.getByTestId("cta-block");
|
|
251
|
+
r(o).toHaveAttribute("data-bg-color", "#ff0000");
|
|
252
|
+
}), s("should use theme colors when useSeriesColors is false", () => {
|
|
253
|
+
n(/* @__PURE__ */ a(l, { program: t, useSeriesColors: !1 }));
|
|
254
|
+
const o = d.getByTestId("cta-block");
|
|
255
|
+
r(o).toHaveAttribute("data-bg-color", "var(--theme-color-400)");
|
|
256
|
+
});
|
|
257
|
+
}), c("CTA Href", () => {
|
|
258
|
+
s("should pass href to CTA block", () => {
|
|
259
|
+
n(
|
|
260
|
+
/* @__PURE__ */ a(
|
|
261
|
+
l,
|
|
262
|
+
{
|
|
263
|
+
href: "/schedule",
|
|
264
|
+
program: t
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
);
|
|
268
|
+
const o = d.getByTestId("cta-block");
|
|
269
|
+
r(o).toHaveAttribute("data-href", "/schedule");
|
|
270
|
+
}), s("should use empty href by default", () => {
|
|
271
|
+
n(/* @__PURE__ */ a(l, { program: t }));
|
|
272
|
+
const o = d.getByTestId("cta-block");
|
|
273
|
+
r(o).toHaveAttribute("data-href", "");
|
|
274
|
+
}), s("should show Full Schedule label", () => {
|
|
275
|
+
n(/* @__PURE__ */ a(l, { program: t }));
|
|
276
|
+
const o = d.getByTestId("cta-block");
|
|
277
|
+
r(o).toHaveAttribute("data-label", "Full Schedule");
|
|
278
|
+
});
|
|
279
|
+
}), c("Default Props", () => {
|
|
280
|
+
s("should use empty string for brand by default", () => {
|
|
281
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".program-airdate__descriptor-module");
|
|
282
|
+
r(e == null ? void 0 : e.textContent).toContain("Now Playing on"), r(e == null ? void 0 : e.textContent).not.toMatch(/\w+$/);
|
|
283
|
+
}), s("should use on-now type by default", () => {
|
|
284
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".program-airdate__descriptor-module");
|
|
285
|
+
r(e == null ? void 0 : e.textContent).toContain("Now Playing on");
|
|
286
|
+
}), s("should use flat button style by default", () => {
|
|
287
|
+
n(/* @__PURE__ */ a(l, { program: t }));
|
|
288
|
+
const o = d.getByTestId("cta-block");
|
|
289
|
+
r(o).toHaveAttribute("data-button-style", "flat");
|
|
290
|
+
}), s("should use gradient logo style by default", () => {
|
|
291
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: t })), e = o.querySelector(".program-airdate__logo-module");
|
|
292
|
+
r(e).toHaveAttribute("data-style", "gradient");
|
|
293
|
+
}), s("should use logo by default", () => {
|
|
294
|
+
const { container: o } = n(
|
|
295
|
+
/* @__PURE__ */ a(l, { logoStyle: "standard", program: t })
|
|
296
|
+
), e = o.querySelector(".program-airdate__logo-image-module");
|
|
297
|
+
r(e).toBeInTheDocument();
|
|
298
|
+
}), s("should use series colors by default", () => {
|
|
299
|
+
n(/* @__PURE__ */ a(l, { program: t }));
|
|
300
|
+
const o = d.getByTestId("cta-block");
|
|
301
|
+
r(o).toHaveAttribute("data-bg-color", "#ff0000");
|
|
302
|
+
}), s("should use empty href by default", () => {
|
|
303
|
+
n(/* @__PURE__ */ a(l, { program: t }));
|
|
304
|
+
const o = d.getByTestId("cta-block");
|
|
305
|
+
r(o).toHaveAttribute("data-href", "");
|
|
306
|
+
});
|
|
307
|
+
}), c("Film Rendering", () => {
|
|
308
|
+
s("should render film name in logo section", () => {
|
|
309
|
+
const { container: o } = n(/* @__PURE__ */ a(l, { program: i })), e = o.querySelector(".program-airdate__logo-module");
|
|
310
|
+
r(e).toHaveTextContent("Test Film");
|
|
311
|
+
}), s("should use film colors for CTA", () => {
|
|
312
|
+
n(/* @__PURE__ */ a(l, { program: i }));
|
|
313
|
+
const o = d.getByTestId("cta-block");
|
|
314
|
+
r(o).toHaveAttribute("data-bg-color", "#0000ff");
|
|
315
|
+
}), s("should not render gradient for film", () => {
|
|
316
|
+
n(/* @__PURE__ */ a(l, { buttonStyle: "gradient", program: i }));
|
|
317
|
+
const o = d.getByTestId("cta-block");
|
|
318
|
+
r(o).toBeInTheDocument();
|
|
319
|
+
});
|
|
320
|
+
}), c("Edge Cases", () => {
|
|
321
|
+
s("should handle missing airdate gracefully", () => {
|
|
322
|
+
const o = {
|
|
323
|
+
...t,
|
|
324
|
+
airdate: void 0
|
|
325
|
+
}, { container: e } = n(/* @__PURE__ */ a(l, { program: o }));
|
|
326
|
+
r(e.querySelector(".program-airdate")).toBeInTheDocument();
|
|
327
|
+
}), s("should handle program without episode object", () => {
|
|
328
|
+
const o = {
|
|
329
|
+
...t,
|
|
330
|
+
program_class: "Special",
|
|
331
|
+
episode: void 0
|
|
332
|
+
}, { container: e } = n(/* @__PURE__ */ a(l, { program: o }));
|
|
333
|
+
r(e.querySelector(".program-airdate")).toBeInTheDocument();
|
|
334
|
+
}), s("should handle missing series logo", () => {
|
|
335
|
+
const o = {
|
|
336
|
+
...t,
|
|
337
|
+
episode: {
|
|
338
|
+
...t.episode,
|
|
339
|
+
series: {
|
|
340
|
+
...t.episode.series,
|
|
341
|
+
logo: null
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}, { container: e } = n(/* @__PURE__ */ a(l, { program: o })), g = e.querySelector(".program-airdate__logo-module");
|
|
345
|
+
r(g).toHaveClass("program-airdate--missing-logo-module");
|
|
346
|
+
}), s("should handle series name with HTML", () => {
|
|
347
|
+
const o = {
|
|
348
|
+
...t,
|
|
349
|
+
episode: {
|
|
350
|
+
...t.episode,
|
|
351
|
+
series: {
|
|
352
|
+
...t.episode.series,
|
|
353
|
+
name: "Test<br/>Series"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}, { container: e } = n(
|
|
357
|
+
/* @__PURE__ */ a(l, { logoStyle: "standard", program: o })
|
|
358
|
+
), g = e.querySelector(".program-airdate__logo-image-module");
|
|
359
|
+
r(g).toHaveAttribute("alt", "Test Series");
|
|
360
|
+
}), s("should handle film name with HTML", () => {
|
|
361
|
+
const o = {
|
|
362
|
+
...i,
|
|
363
|
+
name: "Test<br/>Film"
|
|
364
|
+
}, { container: e } = n(/* @__PURE__ */ a(l, { program: o })), g = e.querySelector(".program-airdate__logo-module");
|
|
365
|
+
r(g).toHaveTextContent("Test<br/>Film");
|
|
366
|
+
});
|
|
367
|
+
}), c("Integration", () => {
|
|
368
|
+
s("should render complete episode with all props", () => {
|
|
369
|
+
const { container: o } = n(
|
|
370
|
+
/* @__PURE__ */ a(
|
|
371
|
+
l,
|
|
372
|
+
{
|
|
373
|
+
useLogo: !0,
|
|
374
|
+
useSeriesColors: !0,
|
|
375
|
+
brand: "Test Network",
|
|
376
|
+
buttonStyle: "gradient",
|
|
377
|
+
href: "/full-schedule",
|
|
378
|
+
logoStyle: "standard",
|
|
379
|
+
program: t,
|
|
380
|
+
type: "upcoming"
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
);
|
|
384
|
+
r(o.querySelector(".program-airdate")).toBeInTheDocument();
|
|
385
|
+
const e = o.querySelector(".program-airdate__descriptor-module");
|
|
386
|
+
r(e).toHaveTextContent("Coming Soon on Test Network");
|
|
387
|
+
const g = o.querySelector(".program-airdate__logo-image-module");
|
|
388
|
+
r(g).toBeInTheDocument();
|
|
389
|
+
const u = d.getByTestId("cta-block");
|
|
390
|
+
r(u).toHaveAttribute("data-href", "/full-schedule"), r(u).toHaveAttribute("data-button-style", "gradient");
|
|
391
|
+
}), s("should render complete film with all props", () => {
|
|
392
|
+
const { container: o } = n(
|
|
393
|
+
/* @__PURE__ */ a(
|
|
394
|
+
l,
|
|
395
|
+
{
|
|
396
|
+
brand: "Movie Network",
|
|
397
|
+
buttonStyle: "flat",
|
|
398
|
+
href: "/movies",
|
|
399
|
+
logoStyle: "standard",
|
|
400
|
+
program: i,
|
|
401
|
+
type: "on-tomorrow"
|
|
402
|
+
}
|
|
403
|
+
)
|
|
404
|
+
);
|
|
405
|
+
r(o.querySelector(".program-airdate")).toBeInTheDocument();
|
|
406
|
+
const e = o.querySelector(".program-airdate__descriptor-module");
|
|
407
|
+
r(e).toHaveTextContent("Playing Tomorrow on Movie Network");
|
|
408
|
+
const g = o.querySelector(".program-airdate__logo-module");
|
|
409
|
+
r(g).toHaveTextContent("Test Film");
|
|
410
|
+
const u = d.getByTestId("cta-block");
|
|
411
|
+
r(u).toHaveAttribute("data-href", "/movies"), r(u).toHaveAttribute("data-button-style", "flat");
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
});
|