@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,577 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { v as y, d as p, b as T, a as B, i as l, r as a, g as t, s as c } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import { u as g } from "../../index-BUN4jQ3m.mjs";
|
|
4
|
+
import v from "react";
|
|
5
|
+
import i from "./ImageCardCore.js";
|
|
6
|
+
y.mock("html-react-parser", () => ({
|
|
7
|
+
default: (o) => /* @__PURE__ */ n("span", { "data-parsed": !0, children: o })
|
|
8
|
+
}));
|
|
9
|
+
y.mock("../../utils/helpers", () => ({
|
|
10
|
+
classes: (o) => o.filter(Boolean).join(" ")
|
|
11
|
+
}));
|
|
12
|
+
y.mock("../AnchorTag", () => ({
|
|
13
|
+
default: ({ label: o, href: m, type: r, classname: e, onClick: s, ...d }) => /* @__PURE__ */ n(
|
|
14
|
+
"a",
|
|
15
|
+
{
|
|
16
|
+
className: e,
|
|
17
|
+
"data-testid": "anchor-tag",
|
|
18
|
+
"data-type": r,
|
|
19
|
+
href: m,
|
|
20
|
+
onClick: (u) => {
|
|
21
|
+
u.preventDefault(), s == null || s(u);
|
|
22
|
+
},
|
|
23
|
+
...d,
|
|
24
|
+
children: o
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
}));
|
|
28
|
+
y.mock("../ButtonAnchor", () => ({
|
|
29
|
+
default: ({ label: o, classname: m, onClick: r, ...e }) => /* @__PURE__ */ n(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
className: m,
|
|
33
|
+
"data-testid": "button-anchor",
|
|
34
|
+
onClick: r,
|
|
35
|
+
...e,
|
|
36
|
+
children: o
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}));
|
|
40
|
+
y.mock("../ResponsiveImage", () => ({
|
|
41
|
+
default: ({ altText: o, classname: m, fullSizeUrl: r, handleClick: e, loading: s, sources: d, decoding: u, fetchPriority: h }) => /* @__PURE__ */ n(
|
|
42
|
+
"img",
|
|
43
|
+
{
|
|
44
|
+
alt: o,
|
|
45
|
+
className: m,
|
|
46
|
+
"data-fetch-priority": h,
|
|
47
|
+
"data-sources": JSON.stringify(d),
|
|
48
|
+
"data-testid": "responsive-image",
|
|
49
|
+
decoding: u,
|
|
50
|
+
loading: s,
|
|
51
|
+
src: r,
|
|
52
|
+
onClick: e
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}));
|
|
56
|
+
p("ImageCardCore", () => {
|
|
57
|
+
const o = {
|
|
58
|
+
"image-card__img-wrapper": "img-wrapper-module",
|
|
59
|
+
"image-card__mobile-image": "mobile-image-module",
|
|
60
|
+
"image-card__image": "image-module",
|
|
61
|
+
"image-card__overlay-content": "overlay-content-module",
|
|
62
|
+
"image-card__play-icon": "play-icon-module",
|
|
63
|
+
"play-icon__triangle": "triangle-module",
|
|
64
|
+
"image-card__content": "content-module",
|
|
65
|
+
"image-card__cta": "cta-module",
|
|
66
|
+
"image-card__cta-wrapper": "cta-wrapper-module"
|
|
67
|
+
}, m = (e) => ({
|
|
68
|
+
url: "https://example.com/image.jpg",
|
|
69
|
+
altText: "Test image",
|
|
70
|
+
aspectRatio: 16 / 9,
|
|
71
|
+
sources: [],
|
|
72
|
+
...e
|
|
73
|
+
}), r = (e) => ({
|
|
74
|
+
label: "Click Here",
|
|
75
|
+
href: "#test",
|
|
76
|
+
type: "external-link",
|
|
77
|
+
relatedResourceId: "resource-123",
|
|
78
|
+
relatedResourceType: "article",
|
|
79
|
+
position: "end",
|
|
80
|
+
...e
|
|
81
|
+
});
|
|
82
|
+
T(() => {
|
|
83
|
+
y.clearAllMocks();
|
|
84
|
+
}), B(() => {
|
|
85
|
+
y.restoreAllMocks();
|
|
86
|
+
}), p("Basic Rendering", () => {
|
|
87
|
+
l("should render image wrapper", () => {
|
|
88
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
89
|
+
const e = document.querySelector(".img-wrapper-module");
|
|
90
|
+
t(e).toBeInTheDocument();
|
|
91
|
+
}), l("should render responsive image with default values", () => {
|
|
92
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
93
|
+
const e = c.getByTestId("responsive-image");
|
|
94
|
+
t(e).toBeInTheDocument(), t(e).toHaveAttribute("src", ""), t(e).toHaveAttribute("alt", "");
|
|
95
|
+
}), l("should apply wrapper classes", () => {
|
|
96
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
97
|
+
const e = document.querySelector(".image-card__img-wrapper");
|
|
98
|
+
t(e).toHaveClass("img-wrapper-module"), t(e).toHaveClass("image-card__img-wrapper");
|
|
99
|
+
}), l("should forward ref", () => {
|
|
100
|
+
const e = v.createRef();
|
|
101
|
+
a(/* @__PURE__ */ n(i, { ref: e, styles: o })), t(e.current).toBeNull();
|
|
102
|
+
});
|
|
103
|
+
}), p("Responsive Image", () => {
|
|
104
|
+
l("should render responsive image with provided props", () => {
|
|
105
|
+
const e = m({
|
|
106
|
+
url: "https://example.com/photo.jpg",
|
|
107
|
+
altText: "Photo description"
|
|
108
|
+
});
|
|
109
|
+
a(/* @__PURE__ */ n(i, { image: e, styles: o }));
|
|
110
|
+
const s = c.getByTestId("responsive-image");
|
|
111
|
+
t(s).toHaveAttribute("src", "https://example.com/photo.jpg"), t(s).toHaveAttribute("alt", "Photo description");
|
|
112
|
+
}), l("should apply image classname", () => {
|
|
113
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
114
|
+
const e = c.getByTestId("responsive-image");
|
|
115
|
+
t(e).toHaveClass("image-module");
|
|
116
|
+
}), l("should set lazy loading by default", () => {
|
|
117
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
118
|
+
const e = c.getByTestId("responsive-image");
|
|
119
|
+
t(e).toHaveAttribute("loading", "lazy");
|
|
120
|
+
}), l("should disable lazy loading when lazyLoad is false", () => {
|
|
121
|
+
a(/* @__PURE__ */ n(i, { lazyLoad: !1, styles: o }));
|
|
122
|
+
const e = c.getByTestId("responsive-image");
|
|
123
|
+
t(e).not.toHaveAttribute("loading");
|
|
124
|
+
}), l("should pass fetchPriority to responsive image", () => {
|
|
125
|
+
a(/* @__PURE__ */ n(i, { fetchPriority: "high", styles: o }));
|
|
126
|
+
const e = c.getByTestId("responsive-image");
|
|
127
|
+
t(e).toHaveAttribute("data-fetch-priority", "high");
|
|
128
|
+
}), l("should pass decoding to responsive image", () => {
|
|
129
|
+
a(/* @__PURE__ */ n(i, { decoding: "sync", styles: o }));
|
|
130
|
+
const e = c.getByTestId("responsive-image");
|
|
131
|
+
t(e).toHaveAttribute("decoding", "sync");
|
|
132
|
+
}), l("should use async decoding by default", () => {
|
|
133
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
134
|
+
const e = c.getByTestId("responsive-image");
|
|
135
|
+
t(e).toHaveAttribute("decoding", "async");
|
|
136
|
+
}), l("should pass sources to responsive image", () => {
|
|
137
|
+
const e = m({
|
|
138
|
+
sources: [
|
|
139
|
+
{ media: "(max-width: 600px)", srcsets: ["https://example.com/small.jpg"] },
|
|
140
|
+
{ media: "(min-width: 601px)", srcsets: ["https://example.com/large.jpg"] }
|
|
141
|
+
]
|
|
142
|
+
});
|
|
143
|
+
a(/* @__PURE__ */ n(i, { image: e, styles: o }));
|
|
144
|
+
const s = c.getByTestId("responsive-image"), d = JSON.parse(s.getAttribute("data-sources") || "[]");
|
|
145
|
+
t(d).toHaveLength(2);
|
|
146
|
+
});
|
|
147
|
+
}), p("Mobile Image", () => {
|
|
148
|
+
l("should render mobile image when mobileImage url is provided", () => {
|
|
149
|
+
const e = m({
|
|
150
|
+
url: "https://example.com/mobile.jpg",
|
|
151
|
+
altText: "Mobile version"
|
|
152
|
+
});
|
|
153
|
+
a(/* @__PURE__ */ n(i, { mobileImage: e, styles: o }));
|
|
154
|
+
const s = c.getByRole("img", { name: "Mobile version" });
|
|
155
|
+
t(s).toBeInTheDocument(), t(s).toHaveAttribute("src", "https://example.com/mobile.jpg");
|
|
156
|
+
}), l("should not render mobile image when url is empty", () => {
|
|
157
|
+
const e = m({ url: "" });
|
|
158
|
+
a(/* @__PURE__ */ n(i, { mobileImage: e, styles: o }));
|
|
159
|
+
const s = c.queryAllByRole("img").filter(
|
|
160
|
+
(d) => d.getAttribute("src") === ""
|
|
161
|
+
);
|
|
162
|
+
t(s).toHaveLength(0);
|
|
163
|
+
}), l("should apply mobile image class", () => {
|
|
164
|
+
const e = m({ url: "https://example.com/mobile.jpg" });
|
|
165
|
+
a(/* @__PURE__ */ n(i, { mobileImage: e, styles: o }));
|
|
166
|
+
const s = c.getByRole("img", { name: "Test image" });
|
|
167
|
+
t(s).toHaveClass("mobile-image-module");
|
|
168
|
+
}), l("should set lazy loading on mobile image by default", () => {
|
|
169
|
+
const e = m({ url: "https://example.com/mobile.jpg" });
|
|
170
|
+
a(/* @__PURE__ */ n(i, { mobileImage: e, styles: o }));
|
|
171
|
+
const s = c.getByRole("img", { name: "Test image" });
|
|
172
|
+
t(s).toHaveAttribute("loading", "lazy");
|
|
173
|
+
}), l("should disable lazy loading on mobile image when lazyLoad is false", () => {
|
|
174
|
+
const e = m({ url: "https://example.com/mobile.jpg" });
|
|
175
|
+
a(/* @__PURE__ */ n(i, { lazyLoad: !1, mobileImage: e, styles: o }));
|
|
176
|
+
const s = c.getByRole("img", { name: "Test image" });
|
|
177
|
+
t(s).not.toHaveAttribute("loading");
|
|
178
|
+
}), l("should pass decoding to mobile image", () => {
|
|
179
|
+
const e = m({ url: "https://example.com/mobile.jpg" });
|
|
180
|
+
a(/* @__PURE__ */ n(i, { decoding: "auto", mobileImage: e, styles: o }));
|
|
181
|
+
const s = c.getByRole("img", { name: "Test image" });
|
|
182
|
+
t(s).toHaveAttribute("decoding", "auto");
|
|
183
|
+
}), l("should pass fetchPriority to mobile image", () => {
|
|
184
|
+
const e = m({ url: "https://example.com/mobile.jpg" });
|
|
185
|
+
a(/* @__PURE__ */ n(i, { fetchPriority: "low", mobileImage: e, styles: o }));
|
|
186
|
+
const s = c.getByRole("img", { name: "Test image" });
|
|
187
|
+
t(s).toHaveAttribute("fetchPriority", "low");
|
|
188
|
+
});
|
|
189
|
+
}), p("Overlay Content", () => {
|
|
190
|
+
l("should render overlay content when string provided", () => {
|
|
191
|
+
a(/* @__PURE__ */ n(i, { overlayContent: "<p>Overlay text</p>", styles: o }));
|
|
192
|
+
const e = document.querySelector(".overlay-content-module");
|
|
193
|
+
t(e).toBeInTheDocument(), t(c.getByText("<p>Overlay text</p>")).toBeInTheDocument();
|
|
194
|
+
}), l("should render overlay content when JSX provided", () => {
|
|
195
|
+
a(
|
|
196
|
+
/* @__PURE__ */ n(
|
|
197
|
+
i,
|
|
198
|
+
{
|
|
199
|
+
overlayContent: /* @__PURE__ */ n("div", { "data-testid": "custom-overlay", children: "Custom" }),
|
|
200
|
+
styles: o
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
), t(c.getByTestId("custom-overlay")).toBeInTheDocument();
|
|
204
|
+
}), l("should not render overlay when overlayContent is empty", () => {
|
|
205
|
+
a(/* @__PURE__ */ n(i, { overlayContent: "", styles: o }));
|
|
206
|
+
const e = document.querySelector(".overlay-content-module");
|
|
207
|
+
t(e).not.toBeInTheDocument();
|
|
208
|
+
}), l("should apply overlay classes", () => {
|
|
209
|
+
a(/* @__PURE__ */ n(i, { overlayContent: "Text", styles: o }));
|
|
210
|
+
const e = document.querySelector(".overlay-content-module");
|
|
211
|
+
t(e).toHaveClass("image-card__overlay-content");
|
|
212
|
+
}), l("should parse HTML string in overlay", () => {
|
|
213
|
+
a(/* @__PURE__ */ n(i, { overlayContent: "<strong>Bold</strong>", styles: o })), t(c.getByText("<strong>Bold</strong>")).toBeInTheDocument();
|
|
214
|
+
});
|
|
215
|
+
}), p("Content Section", () => {
|
|
216
|
+
l("should render content section when content is provided", () => {
|
|
217
|
+
a(/* @__PURE__ */ n(i, { content: "<p>Card content</p>", styles: o }));
|
|
218
|
+
const e = document.querySelector(".content-module");
|
|
219
|
+
t(e).toBeInTheDocument();
|
|
220
|
+
}), l("should not render content section when content is empty", () => {
|
|
221
|
+
a(/* @__PURE__ */ n(i, { content: "", styles: o }));
|
|
222
|
+
const e = document.querySelector(".content-module");
|
|
223
|
+
t(e).not.toBeInTheDocument();
|
|
224
|
+
}), l("should render title when provided", () => {
|
|
225
|
+
a(/* @__PURE__ */ n(i, { content: "Content", styles: o, title: "Card Title" }));
|
|
226
|
+
const e = c.getByRole("heading", { level: 2 });
|
|
227
|
+
t(e).toHaveTextContent("Card Title"), t(e).toHaveClass("h4");
|
|
228
|
+
}), l("should not render title when empty", () => {
|
|
229
|
+
a(/* @__PURE__ */ n(i, { content: "Content", styles: o, title: "" })), t(c.queryByRole("heading")).not.toBeInTheDocument();
|
|
230
|
+
}), l("should parse HTML string content", () => {
|
|
231
|
+
a(/* @__PURE__ */ n(i, { content: "<p>HTML content</p>", styles: o })), t(c.getByText("<p>HTML content</p>")).toBeInTheDocument();
|
|
232
|
+
}), l("should render JSX content", () => {
|
|
233
|
+
a(
|
|
234
|
+
/* @__PURE__ */ n(
|
|
235
|
+
i,
|
|
236
|
+
{
|
|
237
|
+
content: /* @__PURE__ */ n("div", { "data-testid": "custom-content", children: "Custom" }),
|
|
238
|
+
styles: o
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
), t(c.getByTestId("custom-content")).toBeInTheDocument();
|
|
242
|
+
});
|
|
243
|
+
}), p("CTA Rendering", () => {
|
|
244
|
+
l("should render external-link CTA as AnchorTag", () => {
|
|
245
|
+
const e = r({ type: "external-link", label: "Learn More" });
|
|
246
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByTestId("anchor-tag")).toBeInTheDocument(), t(c.getByText("Learn More")).toBeInTheDocument();
|
|
247
|
+
}), l("should render internal-link CTA as AnchorTag", () => {
|
|
248
|
+
const e = r({ type: "internal-link", href: "/about" });
|
|
249
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByTestId("anchor-tag")).toBeInTheDocument();
|
|
250
|
+
}), l("should render play-video CTA as ButtonAnchor", () => {
|
|
251
|
+
const e = r({ type: "play-video" });
|
|
252
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByTestId("button-anchor")).toBeInTheDocument();
|
|
253
|
+
}), l("should render info-panel CTA as ButtonAnchor", () => {
|
|
254
|
+
const e = r({ type: "info-panel" });
|
|
255
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByTestId("button-anchor")).toBeInTheDocument();
|
|
256
|
+
}), l("should render show-modal CTA as ButtonAnchor", () => {
|
|
257
|
+
const e = r({ type: "show-modal" });
|
|
258
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByTestId("button-anchor")).toBeInTheDocument();
|
|
259
|
+
}), l("should not render CTA when type is unrecognized", () => {
|
|
260
|
+
const e = r({ type: "unknown-type" });
|
|
261
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.queryByTestId("anchor-tag")).not.toBeInTheDocument(), t(c.queryByTestId("button-anchor")).not.toBeInTheDocument();
|
|
262
|
+
}), l("should use custom label when provided", () => {
|
|
263
|
+
const e = r({ type: "external-link", label: "Custom Label" });
|
|
264
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("Custom Label")).toBeInTheDocument();
|
|
265
|
+
}), l("should use default label when not provided", () => {
|
|
266
|
+
const e = r({ type: "external-link", label: "" });
|
|
267
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("Learn More")).toBeInTheDocument();
|
|
268
|
+
}), l("should not render CTA when displayCTA is false", () => {
|
|
269
|
+
const e = r({ type: "external-link" });
|
|
270
|
+
a(/* @__PURE__ */ n(i, { cta: e, displayCTA: !1, styles: o })), t(c.queryByTestId("anchor-tag")).not.toBeInTheDocument();
|
|
271
|
+
}), l("should pass href to AnchorTag", () => {
|
|
272
|
+
const e = r({ type: "internal-link", href: "/contact" });
|
|
273
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
274
|
+
const s = c.getByTestId("anchor-tag");
|
|
275
|
+
t(s).toHaveAttribute("href", "/contact");
|
|
276
|
+
}), l("should pass type to AnchorTag for links", () => {
|
|
277
|
+
const e = r({ type: "external-link" });
|
|
278
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
279
|
+
const s = c.getByTestId("anchor-tag");
|
|
280
|
+
t(s).toHaveAttribute("data-type", "external-link");
|
|
281
|
+
}), l("should pass relatedResourceId to CTA", () => {
|
|
282
|
+
const e = r({ type: "external-link", relatedResourceId: "res-456" });
|
|
283
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
284
|
+
const s = c.getByTestId("anchor-tag");
|
|
285
|
+
t(s).toHaveAttribute("data-resource-id", "res-456");
|
|
286
|
+
}), l("should apply CTA classes", () => {
|
|
287
|
+
const e = r({ type: "external-link" });
|
|
288
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
289
|
+
const s = c.getByTestId("anchor-tag");
|
|
290
|
+
t(s).toHaveClass("cta-module"), t(s).toHaveClass("image-card__cta");
|
|
291
|
+
});
|
|
292
|
+
}), p("CTA Position", () => {
|
|
293
|
+
l("should render CTA at end position by default", () => {
|
|
294
|
+
const e = r({ type: "external-link", position: "end" });
|
|
295
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
296
|
+
const s = document.querySelector(".cta-wrapper-module");
|
|
297
|
+
t(s).toBeInTheDocument();
|
|
298
|
+
}), l("should render CTA inline when position is inline and content is string", () => {
|
|
299
|
+
const e = r({ type: "external-link", position: "inline" });
|
|
300
|
+
a(/* @__PURE__ */ n(i, { content: "Content text", cta: e, styles: o })), t(c.getByTestId("anchor-tag")).toBeInTheDocument();
|
|
301
|
+
const s = document.querySelector(".cta-wrapper-module");
|
|
302
|
+
t(s).not.toBeInTheDocument();
|
|
303
|
+
}), l("should render CTA inline when position is inline and content is JSX", () => {
|
|
304
|
+
const e = r({ type: "external-link", position: "inline" });
|
|
305
|
+
a(
|
|
306
|
+
/* @__PURE__ */ n(
|
|
307
|
+
i,
|
|
308
|
+
{
|
|
309
|
+
content: /* @__PURE__ */ n("div", { children: "JSX content" }),
|
|
310
|
+
cta: e,
|
|
311
|
+
styles: o
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
), t(c.getByTestId("anchor-tag")).toBeInTheDocument();
|
|
315
|
+
}), l("should not render end CTA when position is inline", () => {
|
|
316
|
+
const e = r({ type: "external-link", position: "inline" });
|
|
317
|
+
a(/* @__PURE__ */ n(i, { content: "Content", cta: e, styles: o }));
|
|
318
|
+
const s = document.querySelector(".cta-wrapper-module");
|
|
319
|
+
t(s).not.toBeInTheDocument();
|
|
320
|
+
}), l("should not render inline CTA when no content", () => {
|
|
321
|
+
const e = r({ type: "external-link", position: "inline" });
|
|
322
|
+
a(/* @__PURE__ */ n(i, { content: "", cta: e, styles: o })), t(c.queryByTestId("anchor-tag")).not.toBeInTheDocument();
|
|
323
|
+
});
|
|
324
|
+
}), p("Play Video CTA", () => {
|
|
325
|
+
l("should render play icon button for play-video type", () => {
|
|
326
|
+
const e = r({ type: "play-video" });
|
|
327
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
328
|
+
const s = c.getByRole("button", { name: /play button/i });
|
|
329
|
+
t(s).toBeInTheDocument();
|
|
330
|
+
}), l("should apply play icon classes", () => {
|
|
331
|
+
const e = r({ type: "play-video" });
|
|
332
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
333
|
+
const s = c.getByRole("button", { name: /play button/i });
|
|
334
|
+
t(s).toHaveClass("play-icon-module"), t(s).toHaveClass("image-card__play-icon");
|
|
335
|
+
}), l("should render triangle inside play button", () => {
|
|
336
|
+
const e = r({ type: "play-video" });
|
|
337
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
338
|
+
const s = document.querySelector(".triangle-module");
|
|
339
|
+
t(s).toBeInTheDocument();
|
|
340
|
+
}), l("should not render play icon for other CTA types", () => {
|
|
341
|
+
const e = r({ type: "external-link" });
|
|
342
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.queryByRole("button", { name: /play button/i })).not.toBeInTheDocument();
|
|
343
|
+
}), l("should call handleClicks when play button is clicked", async () => {
|
|
344
|
+
const e = g.setup(), s = y.fn(), d = r({ type: "play-video", relatedResourceId: "video-123" });
|
|
345
|
+
a(/* @__PURE__ */ n(i, { cta: d, handleClicks: s, styles: o }));
|
|
346
|
+
const u = c.getByRole("button", { name: /play button/i });
|
|
347
|
+
await e.click(u), t(s).toHaveBeenCalledTimes(1), t(s).toHaveBeenCalledWith(
|
|
348
|
+
t.objectContaining({
|
|
349
|
+
type: "play-video",
|
|
350
|
+
resourceId: "video-123"
|
|
351
|
+
})
|
|
352
|
+
);
|
|
353
|
+
});
|
|
354
|
+
}), p("Click Handling", () => {
|
|
355
|
+
l("should call handleClicks when button CTA is clicked", async () => {
|
|
356
|
+
const e = g.setup(), s = y.fn(), d = r({
|
|
357
|
+
type: "info-panel",
|
|
358
|
+
relatedResourceId: "panel-123",
|
|
359
|
+
relatedResourceType: "info"
|
|
360
|
+
});
|
|
361
|
+
a(/* @__PURE__ */ n(i, { cta: d, handleClicks: s, styles: o }));
|
|
362
|
+
const u = c.getByTestId("button-anchor");
|
|
363
|
+
await e.click(u), t(s).toHaveBeenCalledTimes(1), t(s).toHaveBeenCalledWith(
|
|
364
|
+
t.objectContaining({
|
|
365
|
+
type: "info-panel",
|
|
366
|
+
resourceId: "panel-123",
|
|
367
|
+
resourceType: "info"
|
|
368
|
+
})
|
|
369
|
+
);
|
|
370
|
+
}), l("should not call handleClicks for link CTAs", async () => {
|
|
371
|
+
const e = g.setup(), s = y.fn(), d = r({ type: "external-link" });
|
|
372
|
+
a(/* @__PURE__ */ n(i, { cta: d, handleClicks: s, styles: o }));
|
|
373
|
+
const u = c.getByTestId("anchor-tag");
|
|
374
|
+
await e.click(u), t(s).not.toHaveBeenCalled();
|
|
375
|
+
}), l("should include event target in handleClicks details", async () => {
|
|
376
|
+
const e = g.setup(), s = y.fn(), d = r({ type: "show-modal" });
|
|
377
|
+
a(/* @__PURE__ */ n(i, { cta: d, handleClicks: s, styles: o }));
|
|
378
|
+
const u = c.getByTestId("button-anchor");
|
|
379
|
+
await e.click(u);
|
|
380
|
+
const h = s.mock.calls[0][0];
|
|
381
|
+
t(h.target).toBeTruthy(), t(h.currentTarget).toBeTruthy();
|
|
382
|
+
}), l("should stop event propagation when CTA is clicked", async () => {
|
|
383
|
+
const e = g.setup(), s = y.fn(), d = r({ type: "info-panel" });
|
|
384
|
+
a(
|
|
385
|
+
/* @__PURE__ */ n("div", { onClick: y.fn(), children: /* @__PURE__ */ n(i, { cta: d, handleClicks: s, styles: o }) })
|
|
386
|
+
);
|
|
387
|
+
const u = c.getByTestId("button-anchor");
|
|
388
|
+
await e.click(u), t(s).toHaveBeenCalled();
|
|
389
|
+
}), l("should use default noop handler when handleClicks not provided", async () => {
|
|
390
|
+
const e = g.setup(), s = r({ type: "play-video" });
|
|
391
|
+
a(/* @__PURE__ */ n(i, { cta: s, styles: o }));
|
|
392
|
+
const d = c.getByRole("button", { name: /play button/i });
|
|
393
|
+
await e.click(d), t(d).toBeInTheDocument();
|
|
394
|
+
});
|
|
395
|
+
}), p("Image Click Handling for Special CTA Types", () => {
|
|
396
|
+
l("should handle mobile image click for play-video type", async () => {
|
|
397
|
+
const e = g.setup(), s = y.fn(), d = m({ url: "https://example.com/mobile.jpg" }), u = r({ type: "play-video" });
|
|
398
|
+
a(
|
|
399
|
+
/* @__PURE__ */ n(
|
|
400
|
+
i,
|
|
401
|
+
{
|
|
402
|
+
cta: u,
|
|
403
|
+
handleClicks: s,
|
|
404
|
+
mobileImage: d,
|
|
405
|
+
styles: o
|
|
406
|
+
}
|
|
407
|
+
)
|
|
408
|
+
);
|
|
409
|
+
const h = c.getByRole("img", { name: "Test image" });
|
|
410
|
+
await e.click(h), t(s).toHaveBeenCalled();
|
|
411
|
+
}), l("should handle mobile image click for show-modal type", async () => {
|
|
412
|
+
const e = g.setup(), s = y.fn(), d = m({ url: "https://example.com/mobile.jpg" }), u = r({ type: "show-modal" });
|
|
413
|
+
a(
|
|
414
|
+
/* @__PURE__ */ n(
|
|
415
|
+
i,
|
|
416
|
+
{
|
|
417
|
+
cta: u,
|
|
418
|
+
handleClicks: s,
|
|
419
|
+
mobileImage: d,
|
|
420
|
+
styles: o
|
|
421
|
+
}
|
|
422
|
+
)
|
|
423
|
+
);
|
|
424
|
+
const h = c.getByRole("img", { name: "Test image" });
|
|
425
|
+
await e.click(h), t(s).toHaveBeenCalled();
|
|
426
|
+
}), l("should not handle mobile image click when fullCardClickable", async () => {
|
|
427
|
+
const e = g.setup(), s = y.fn(), d = m({ url: "https://example.com/mobile.jpg" }), u = r({ type: "play-video" });
|
|
428
|
+
a(
|
|
429
|
+
/* @__PURE__ */ n(
|
|
430
|
+
i,
|
|
431
|
+
{
|
|
432
|
+
fullCardClickable: !0,
|
|
433
|
+
cta: u,
|
|
434
|
+
handleClicks: s,
|
|
435
|
+
mobileImage: d,
|
|
436
|
+
styles: o
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
);
|
|
440
|
+
const h = c.getByRole("img", { name: "Test image" });
|
|
441
|
+
await e.click(h), t(s).not.toHaveBeenCalled();
|
|
442
|
+
}), l("should not handle mobile image click for link types", async () => {
|
|
443
|
+
const e = g.setup(), s = y.fn(), d = m({ url: "https://example.com/mobile.jpg" }), u = r({ type: "external-link" });
|
|
444
|
+
a(
|
|
445
|
+
/* @__PURE__ */ n(
|
|
446
|
+
i,
|
|
447
|
+
{
|
|
448
|
+
cta: u,
|
|
449
|
+
handleClicks: s,
|
|
450
|
+
mobileImage: d,
|
|
451
|
+
styles: o
|
|
452
|
+
}
|
|
453
|
+
)
|
|
454
|
+
);
|
|
455
|
+
const h = c.getByRole("img", { name: "Test image" });
|
|
456
|
+
await e.click(h), t(s).not.toHaveBeenCalled();
|
|
457
|
+
});
|
|
458
|
+
}), p("Default Props", () => {
|
|
459
|
+
l("should use default image values", () => {
|
|
460
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
461
|
+
const e = c.getByTestId("responsive-image");
|
|
462
|
+
t(e).toHaveAttribute("src", ""), t(e).toHaveAttribute("alt", "");
|
|
463
|
+
}), l("should use default mobileImage values", () => {
|
|
464
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
465
|
+
const e = c.queryAllByRole("img").filter(
|
|
466
|
+
(s) => s.className.includes("mobile-image")
|
|
467
|
+
);
|
|
468
|
+
t(e).toHaveLength(0);
|
|
469
|
+
}), l("should use lazyLoad true by default", () => {
|
|
470
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
471
|
+
const e = c.getByTestId("responsive-image");
|
|
472
|
+
t(e).toHaveAttribute("loading", "lazy");
|
|
473
|
+
}), l("should use async decoding by default", () => {
|
|
474
|
+
a(/* @__PURE__ */ n(i, { styles: o }));
|
|
475
|
+
const e = c.getByTestId("responsive-image");
|
|
476
|
+
t(e).toHaveAttribute("decoding", "async");
|
|
477
|
+
}), l("should use displayCTA true by default", () => {
|
|
478
|
+
const e = r({ type: "external-link" });
|
|
479
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByTestId("anchor-tag")).toBeInTheDocument();
|
|
480
|
+
}), l("should use empty strings for title and content by default", () => {
|
|
481
|
+
a(/* @__PURE__ */ n(i, { styles: o })), t(c.queryByRole("heading")).not.toBeInTheDocument();
|
|
482
|
+
const e = document.querySelector(".content-module");
|
|
483
|
+
t(e).not.toBeInTheDocument();
|
|
484
|
+
});
|
|
485
|
+
}), p("Default CTA Labels", () => {
|
|
486
|
+
l('should use "View Promo" for play-video when no label', () => {
|
|
487
|
+
const e = r({ type: "play-video", label: "" });
|
|
488
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("View Promo")).toBeInTheDocument();
|
|
489
|
+
}), l('should use "View More" for internal-link when no label', () => {
|
|
490
|
+
const e = r({ type: "internal-link", label: "" });
|
|
491
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("View More")).toBeInTheDocument();
|
|
492
|
+
}), l('should use "Learn More" for external-link when no label', () => {
|
|
493
|
+
const e = r({ type: "external-link", label: "" });
|
|
494
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("Learn More")).toBeInTheDocument();
|
|
495
|
+
}), l('should use "View More" for info-panel when no label', () => {
|
|
496
|
+
const e = r({ type: "info-panel", label: "" });
|
|
497
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("View More")).toBeInTheDocument();
|
|
498
|
+
}), l('should use "See More" for show-modal when no label', () => {
|
|
499
|
+
const e = r({ type: "show-modal", label: "" });
|
|
500
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o })), t(c.getByText("See More")).toBeInTheDocument();
|
|
501
|
+
});
|
|
502
|
+
}), p("Edge Cases", () => {
|
|
503
|
+
l("should handle empty styles object", () => {
|
|
504
|
+
a(/* @__PURE__ */ n(i, { styles: {} }));
|
|
505
|
+
const e = c.getByTestId("responsive-image");
|
|
506
|
+
t(e).toBeInTheDocument();
|
|
507
|
+
}), l("should handle very long title", () => {
|
|
508
|
+
const e = "A".repeat(500);
|
|
509
|
+
a(/* @__PURE__ */ n(i, { content: "Content", styles: o, title: e })), t(c.getByText(e)).toBeInTheDocument();
|
|
510
|
+
}), l("should handle special characters in overlay content", () => {
|
|
511
|
+
a(/* @__PURE__ */ n(i, { overlayContent: '<>"', styles: o }));
|
|
512
|
+
const e = document.querySelector(".overlay-content-module");
|
|
513
|
+
t(e).toBeInTheDocument(), t(e == null ? void 0 : e.textContent).toBe('<>"');
|
|
514
|
+
}), l("should handle undefined fetchPriority", () => {
|
|
515
|
+
a(/* @__PURE__ */ n(i, { fetchPriority: void 0, styles: o }));
|
|
516
|
+
const e = c.getByTestId("responsive-image");
|
|
517
|
+
t(e).toBeInTheDocument();
|
|
518
|
+
}), l("should handle CTA with empty relatedResourceId", () => {
|
|
519
|
+
const e = r({ type: "external-link", relatedResourceId: "" });
|
|
520
|
+
a(/* @__PURE__ */ n(i, { cta: e, styles: o }));
|
|
521
|
+
const s = c.getByTestId("anchor-tag");
|
|
522
|
+
t(s).toHaveAttribute("data-resource-id", "");
|
|
523
|
+
}), l("should handle both title and JSX content", () => {
|
|
524
|
+
a(
|
|
525
|
+
/* @__PURE__ */ n(
|
|
526
|
+
i,
|
|
527
|
+
{
|
|
528
|
+
content: /* @__PURE__ */ n("div", { "data-testid": "jsx-content", children: "JSX" }),
|
|
529
|
+
styles: o,
|
|
530
|
+
title: "Title"
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
), t(c.getByRole("heading")).toHaveTextContent("Title"), t(c.getByTestId("jsx-content")).toBeInTheDocument();
|
|
534
|
+
});
|
|
535
|
+
}), p("Integration", () => {
|
|
536
|
+
l("should render complete card with all features", () => {
|
|
537
|
+
const e = m({ url: "https://example.com/image.jpg" }), s = m({ url: "https://example.com/mobile.jpg" }), d = r({
|
|
538
|
+
type: "play-video",
|
|
539
|
+
label: "Watch Now",
|
|
540
|
+
position: "end"
|
|
541
|
+
}), u = y.fn();
|
|
542
|
+
a(
|
|
543
|
+
/* @__PURE__ */ n(
|
|
544
|
+
i,
|
|
545
|
+
{
|
|
546
|
+
displayCTA: !0,
|
|
547
|
+
lazyLoad: !0,
|
|
548
|
+
content: "Video description",
|
|
549
|
+
cta: d,
|
|
550
|
+
handleClicks: u,
|
|
551
|
+
image: e,
|
|
552
|
+
mobileImage: s,
|
|
553
|
+
overlayContent: "Featured",
|
|
554
|
+
styles: o,
|
|
555
|
+
title: "Video Title"
|
|
556
|
+
}
|
|
557
|
+
)
|
|
558
|
+
), t(c.getByTestId("responsive-image")).toBeInTheDocument();
|
|
559
|
+
const h = c.getAllByRole("img", { name: "Test image" });
|
|
560
|
+
t(h).toHaveLength(2), t(c.getByText("Featured")).toBeInTheDocument(), t(c.getByRole("heading")).toHaveTextContent("Video Title"), t(c.getByText("Video description")).toBeInTheDocument(), t(c.getByRole("button", { name: /play button/i })).toBeInTheDocument(), t(c.getByText("Watch Now")).toBeInTheDocument();
|
|
561
|
+
}), l("should render minimal card with only image", () => {
|
|
562
|
+
a(/* @__PURE__ */ n(i, { styles: o })), t(c.getByTestId("responsive-image")).toBeInTheDocument(), t(c.queryByRole("heading")).not.toBeInTheDocument(), t(document.querySelector(".content-module")).not.toBeInTheDocument();
|
|
563
|
+
}), l("should handle inline CTA with string content", () => {
|
|
564
|
+
const e = r({ type: "external-link", position: "inline" });
|
|
565
|
+
a(
|
|
566
|
+
/* @__PURE__ */ n(
|
|
567
|
+
i,
|
|
568
|
+
{
|
|
569
|
+
content: "Read the full article",
|
|
570
|
+
cta: e,
|
|
571
|
+
styles: o
|
|
572
|
+
}
|
|
573
|
+
)
|
|
574
|
+
), t(c.getByText("Read the full article")).toBeInTheDocument(), t(c.getByTestId("anchor-tag")).toBeInTheDocument(), t(document.querySelector(".cta-wrapper-module")).not.toBeInTheDocument();
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
});
|