@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,379 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { v as m, d as u, b as d, a as h, i as s, r, g as o, s as i } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import { ImageReplacementAnchor as l } from "./ImageReplacementAnchor.js";
|
|
4
|
+
m.mock("../../utils/helpers", () => ({
|
|
5
|
+
classes: (n) => n.filter(Boolean).join(" ")
|
|
6
|
+
}));
|
|
7
|
+
m.mock("./ImageReplacementAnchor.module.scss", () => ({
|
|
8
|
+
default: {
|
|
9
|
+
"image-replacement-anchor": "ira-module",
|
|
10
|
+
"image-replacement-anchor__image": "ira-image-module",
|
|
11
|
+
"image-replacement-anchor__text": "ira-text-module"
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
u("ImageReplacementAnchor", () => {
|
|
15
|
+
const n = (e) => ({
|
|
16
|
+
url: "https://example.com/logo.png",
|
|
17
|
+
altText: "Company Logo",
|
|
18
|
+
aspectRatio: 2,
|
|
19
|
+
width: 200,
|
|
20
|
+
height: 100,
|
|
21
|
+
...e
|
|
22
|
+
});
|
|
23
|
+
d(() => {
|
|
24
|
+
m.clearAllMocks();
|
|
25
|
+
}), h(() => {
|
|
26
|
+
m.restoreAllMocks();
|
|
27
|
+
}), u("Basic Rendering", () => {
|
|
28
|
+
s("should render anchor element", () => {
|
|
29
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
30
|
+
const e = document.querySelector("a");
|
|
31
|
+
o(e).toBeInTheDocument();
|
|
32
|
+
}), s("should render image element", () => {
|
|
33
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
34
|
+
const e = i.getByRole("presentation");
|
|
35
|
+
o(e).toBeInTheDocument();
|
|
36
|
+
}), s("should apply anchor classes", () => {
|
|
37
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
38
|
+
const e = document.querySelector("a");
|
|
39
|
+
o(e).toHaveClass("ira-module"), o(e).toHaveClass("image-replacement-anchor");
|
|
40
|
+
}), s("should apply image classes", () => {
|
|
41
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
42
|
+
const e = i.getByRole("presentation");
|
|
43
|
+
o(e).toHaveClass("ira-image-module"), o(e).toHaveClass("image-replacement-anchor__image");
|
|
44
|
+
});
|
|
45
|
+
}), u("Link Attributes", () => {
|
|
46
|
+
s("should set href attribute", () => {
|
|
47
|
+
r(/* @__PURE__ */ a(l, { href: "https://example.com" }));
|
|
48
|
+
const e = i.getByRole("link");
|
|
49
|
+
o(e).toHaveAttribute("href", "https://example.com");
|
|
50
|
+
}), s("should use empty href by default", () => {
|
|
51
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
52
|
+
const e = document.querySelector("a");
|
|
53
|
+
o(e).toHaveAttribute("href", "");
|
|
54
|
+
}), s("should set target to _self by default", () => {
|
|
55
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
56
|
+
const e = document.querySelector("a");
|
|
57
|
+
o(e).toHaveAttribute("target", "_self");
|
|
58
|
+
}), s("should set target to _blank", () => {
|
|
59
|
+
r(/* @__PURE__ */ a(l, { target: "_blank" }));
|
|
60
|
+
const e = document.querySelector("a");
|
|
61
|
+
o(e).toHaveAttribute("target", "_blank");
|
|
62
|
+
}), s("should set target to _parent", () => {
|
|
63
|
+
r(/* @__PURE__ */ a(l, { target: "_parent" }));
|
|
64
|
+
const e = document.querySelector("a");
|
|
65
|
+
o(e).toHaveAttribute("target", "_parent");
|
|
66
|
+
}), s("should set target to _top", () => {
|
|
67
|
+
r(/* @__PURE__ */ a(l, { target: "_top" }));
|
|
68
|
+
const e = document.querySelector("a");
|
|
69
|
+
o(e).toHaveAttribute("target", "_top");
|
|
70
|
+
}), s('should add rel="noreferrer" when target is _blank', () => {
|
|
71
|
+
r(/* @__PURE__ */ a(l, { target: "_blank" }));
|
|
72
|
+
const e = document.querySelector("a");
|
|
73
|
+
o(e).toHaveAttribute("rel", "noreferrer");
|
|
74
|
+
}), s("should not add rel attribute when target is not _blank", () => {
|
|
75
|
+
r(/* @__PURE__ */ a(l, { target: "_self" }));
|
|
76
|
+
const e = document.querySelector("a");
|
|
77
|
+
o(e).not.toHaveAttribute("rel");
|
|
78
|
+
}), s("should not add rel attribute when target is _parent", () => {
|
|
79
|
+
r(/* @__PURE__ */ a(l, { target: "_parent" }));
|
|
80
|
+
const e = document.querySelector("a");
|
|
81
|
+
o(e).not.toHaveAttribute("rel");
|
|
82
|
+
});
|
|
83
|
+
}), u("Image Properties", () => {
|
|
84
|
+
s("should set image src from image prop", () => {
|
|
85
|
+
const e = n({ url: "https://example.com/custom-logo.png" });
|
|
86
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
87
|
+
const t = i.getByRole("presentation");
|
|
88
|
+
o(t).toHaveAttribute("src", "https://example.com/custom-logo.png");
|
|
89
|
+
}), s("should set image alt text from image prop", () => {
|
|
90
|
+
const e = n({ altText: "Custom Logo" });
|
|
91
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
92
|
+
const t = i.getByRole("presentation");
|
|
93
|
+
o(t).toHaveAttribute("alt", "Custom Logo");
|
|
94
|
+
}), s("should use empty src by default", () => {
|
|
95
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
96
|
+
const e = i.getByRole("presentation");
|
|
97
|
+
o(e).toHaveAttribute("src", "");
|
|
98
|
+
}), s("should use empty alt text by default", () => {
|
|
99
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
100
|
+
const e = i.getByRole("presentation");
|
|
101
|
+
o(e).toHaveAttribute("alt", "");
|
|
102
|
+
}), s("should set loading to lazy", () => {
|
|
103
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
104
|
+
const e = i.getByRole("presentation");
|
|
105
|
+
o(e).toHaveAttribute("loading", "lazy");
|
|
106
|
+
}), s("should set role to presentation", () => {
|
|
107
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
108
|
+
const e = i.getByRole("presentation");
|
|
109
|
+
o(e).toHaveAttribute("role", "presentation");
|
|
110
|
+
});
|
|
111
|
+
}), u("Aspect Ratio Calculation", () => {
|
|
112
|
+
s("should calculate aspect ratio from width and height", () => {
|
|
113
|
+
const e = n({ width: 400, height: 100 });
|
|
114
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
115
|
+
const t = document.querySelector("a");
|
|
116
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("4");
|
|
117
|
+
}), s("should use 1 as default aspect ratio when width/height not provided", () => {
|
|
118
|
+
const e = n({ width: void 0, height: void 0 });
|
|
119
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
120
|
+
const t = document.querySelector("a");
|
|
121
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("1");
|
|
122
|
+
}), s("should handle decimal aspect ratios", () => {
|
|
123
|
+
const e = n({ width: 300, height: 200 });
|
|
124
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
125
|
+
const t = document.querySelector("a");
|
|
126
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("1.5");
|
|
127
|
+
}), s("should use 1 when only width is provided", () => {
|
|
128
|
+
const e = n({ width: 200, height: void 0 });
|
|
129
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
130
|
+
const t = document.querySelector("a");
|
|
131
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("1");
|
|
132
|
+
}), s("should use 1 when only height is provided", () => {
|
|
133
|
+
const e = n({ width: void 0, height: 100 });
|
|
134
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
135
|
+
const t = document.querySelector("a");
|
|
136
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("1");
|
|
137
|
+
}), s("should handle square images", () => {
|
|
138
|
+
const e = n({ width: 100, height: 100 });
|
|
139
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
140
|
+
const t = document.querySelector("a");
|
|
141
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("1");
|
|
142
|
+
}), s("should handle very wide aspect ratios", () => {
|
|
143
|
+
const e = n({ width: 1e3, height: 50 });
|
|
144
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
145
|
+
const t = document.querySelector("a");
|
|
146
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("20");
|
|
147
|
+
}), s("should handle very tall aspect ratios", () => {
|
|
148
|
+
const e = n({ width: 50, height: 200 });
|
|
149
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
150
|
+
const t = document.querySelector("a");
|
|
151
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("0.25");
|
|
152
|
+
});
|
|
153
|
+
}), u("CSS Custom Properties", () => {
|
|
154
|
+
s("should set height CSS variable with default 4rem", () => {
|
|
155
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
156
|
+
const e = document.querySelector("a");
|
|
157
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-height")).toBe("4rem");
|
|
158
|
+
}), s("should set height CSS variable with custom value", () => {
|
|
159
|
+
r(/* @__PURE__ */ a(l, { height: 6 }));
|
|
160
|
+
const e = document.querySelector("a");
|
|
161
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-height")).toBe("6rem");
|
|
162
|
+
}), s("should set baseline adjustment CSS variable with default 0rem", () => {
|
|
163
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
164
|
+
const e = document.querySelector("a");
|
|
165
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-baseline-adjustment")).toBe("0rem");
|
|
166
|
+
}), s("should set baseline adjustment CSS variable with custom value", () => {
|
|
167
|
+
r(/* @__PURE__ */ a(l, { baselineAdjustment: 0.5 }));
|
|
168
|
+
const e = document.querySelector("a");
|
|
169
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-baseline-adjustment")).toBe("0.5rem");
|
|
170
|
+
}), s("should set negative baseline adjustment", () => {
|
|
171
|
+
r(/* @__PURE__ */ a(l, { baselineAdjustment: -0.25 }));
|
|
172
|
+
const e = document.querySelector("a");
|
|
173
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-baseline-adjustment")).toBe("-0.25rem");
|
|
174
|
+
}), s("should set all three CSS custom properties", () => {
|
|
175
|
+
const e = n({ width: 200, height: 100 });
|
|
176
|
+
r(/* @__PURE__ */ a(l, { baselineAdjustment: 1, height: 5, image: e }));
|
|
177
|
+
const t = document.querySelector("a");
|
|
178
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("2"), o(t == null ? void 0 : t.style.getPropertyValue("--ira-height")).toBe("5rem"), o(t == null ? void 0 : t.style.getPropertyValue("--ira-baseline-adjustment")).toBe("1rem");
|
|
179
|
+
}), s("should handle zero height", () => {
|
|
180
|
+
r(/* @__PURE__ */ a(l, { height: 0 }));
|
|
181
|
+
const e = document.querySelector("a");
|
|
182
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-height")).toBe("0rem");
|
|
183
|
+
}), s("should handle large height values", () => {
|
|
184
|
+
r(/* @__PURE__ */ a(l, { height: 100 }));
|
|
185
|
+
const e = document.querySelector("a");
|
|
186
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-height")).toBe("100rem");
|
|
187
|
+
}), s("should handle decimal height values", () => {
|
|
188
|
+
r(/* @__PURE__ */ a(l, { height: 2.5 }));
|
|
189
|
+
const e = document.querySelector("a");
|
|
190
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-height")).toBe("2.5rem");
|
|
191
|
+
});
|
|
192
|
+
}), u("Text Span Rendering", () => {
|
|
193
|
+
s("should render text span when altText is empty", () => {
|
|
194
|
+
const e = n({ altText: "" });
|
|
195
|
+
r(/* @__PURE__ */ a(l, { image: e, text: "Company Name" }));
|
|
196
|
+
const t = document.querySelector(".ira-text-module");
|
|
197
|
+
o(t).toBeInTheDocument(), o(t).toHaveTextContent("Company Name");
|
|
198
|
+
}), s("should render text span when altText is undefined", () => {
|
|
199
|
+
const e = n({ altText: void 0 });
|
|
200
|
+
r(/* @__PURE__ */ a(l, { image: e, text: "Company Name" }));
|
|
201
|
+
const t = document.querySelector(".ira-text-module");
|
|
202
|
+
o(t).toBeInTheDocument();
|
|
203
|
+
}), s("should not render text span when altText is provided", () => {
|
|
204
|
+
const e = n({ altText: "Logo" });
|
|
205
|
+
r(/* @__PURE__ */ a(l, { image: e, text: "Company Name" }));
|
|
206
|
+
const t = document.querySelector(".ira-text-module");
|
|
207
|
+
o(t).not.toBeInTheDocument();
|
|
208
|
+
}), s("should use empty text by default", () => {
|
|
209
|
+
const e = n({ altText: "" });
|
|
210
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
211
|
+
const t = document.querySelector(".ira-text-module");
|
|
212
|
+
o(t).toHaveTextContent("");
|
|
213
|
+
}), s("should apply text span class", () => {
|
|
214
|
+
const e = n({ altText: "" });
|
|
215
|
+
r(/* @__PURE__ */ a(l, { image: e, text: "Test" }));
|
|
216
|
+
const t = document.querySelector(".ira-text-module");
|
|
217
|
+
o(t).toHaveClass("ira-text-module");
|
|
218
|
+
}), s("should render text even when image has no alt but text is provided", () => {
|
|
219
|
+
r(/* @__PURE__ */ a(l, { text: "Fallback Text" }));
|
|
220
|
+
const e = document.querySelector(".ira-text-module");
|
|
221
|
+
o(e).toBeInTheDocument(), o(e).toHaveTextContent("Fallback Text");
|
|
222
|
+
});
|
|
223
|
+
}), u("Custom Classname", () => {
|
|
224
|
+
s("should apply custom classname", () => {
|
|
225
|
+
r(/* @__PURE__ */ a(l, { classname: "custom-class" }));
|
|
226
|
+
const e = document.querySelector("a");
|
|
227
|
+
o(e).toHaveClass("custom-class");
|
|
228
|
+
}), s("should apply multiple custom classes", () => {
|
|
229
|
+
r(/* @__PURE__ */ a(l, { classname: "class-one class-two" }));
|
|
230
|
+
const e = document.querySelector("a");
|
|
231
|
+
o(e).toHaveClass("class-one"), o(e).toHaveClass("class-two");
|
|
232
|
+
}), s("should apply custom class along with default classes", () => {
|
|
233
|
+
r(/* @__PURE__ */ a(l, { classname: "my-custom-class" }));
|
|
234
|
+
const e = document.querySelector("a");
|
|
235
|
+
o(e).toHaveClass("ira-module"), o(e).toHaveClass("image-replacement-anchor"), o(e).toHaveClass("my-custom-class");
|
|
236
|
+
}), s("should handle empty classname", () => {
|
|
237
|
+
r(/* @__PURE__ */ a(l, { classname: "" }));
|
|
238
|
+
const e = document.querySelector("a");
|
|
239
|
+
o(e).toHaveClass("ira-module"), o(e).toHaveClass("image-replacement-anchor");
|
|
240
|
+
});
|
|
241
|
+
}), u("Default Props", () => {
|
|
242
|
+
s("should use all default values", () => {
|
|
243
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
244
|
+
const e = document.querySelector("a"), t = i.getByRole("presentation");
|
|
245
|
+
o(e).toHaveAttribute("href", ""), o(e).toHaveAttribute("target", "_self"), o(t).toHaveAttribute("src", ""), o(t).toHaveAttribute("alt", ""), o(e == null ? void 0 : e.style.getPropertyValue("--ira-height")).toBe("4rem"), o(e == null ? void 0 : e.style.getPropertyValue("--ira-baseline-adjustment")).toBe("0rem");
|
|
246
|
+
}), s("should use default image values", () => {
|
|
247
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
248
|
+
const e = i.getByRole("presentation");
|
|
249
|
+
o(e).toHaveAttribute("src", ""), o(e).toHaveAttribute("alt", "");
|
|
250
|
+
}), s("should render text span with default image", () => {
|
|
251
|
+
r(/* @__PURE__ */ a(l, { text: "Default Text" }));
|
|
252
|
+
const e = document.querySelector(".ira-text-module");
|
|
253
|
+
o(e).toBeInTheDocument();
|
|
254
|
+
});
|
|
255
|
+
}), u("Edge Cases", () => {
|
|
256
|
+
s("should handle zero aspect ratio (zero width)", () => {
|
|
257
|
+
const e = n({ width: 0, height: 100 });
|
|
258
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
259
|
+
const t = document.querySelector("a");
|
|
260
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("1");
|
|
261
|
+
}), s("should handle division by zero (zero height)", () => {
|
|
262
|
+
const e = n({ width: 100, height: 0 });
|
|
263
|
+
r(/* @__PURE__ */ a(l, { image: e }));
|
|
264
|
+
const t = document.querySelector("a");
|
|
265
|
+
o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("1");
|
|
266
|
+
}), s("should handle very long URLs", () => {
|
|
267
|
+
const e = "https://example.com/" + "a".repeat(1e3) + ".png";
|
|
268
|
+
r(/* @__PURE__ */ a(l, { href: e }));
|
|
269
|
+
const t = i.getByRole("link");
|
|
270
|
+
o(t).toHaveAttribute("href", e);
|
|
271
|
+
}), s("should handle special characters in text", () => {
|
|
272
|
+
const e = n({ altText: "" }), t = `<>&"'Company`;
|
|
273
|
+
r(/* @__PURE__ */ a(l, { image: e, text: t }));
|
|
274
|
+
const c = document.querySelector(".ira-text-module");
|
|
275
|
+
o(c).toHaveTextContent(t);
|
|
276
|
+
}), s("should handle empty string altText (not just undefined)", () => {
|
|
277
|
+
const e = n({ altText: "" });
|
|
278
|
+
r(/* @__PURE__ */ a(l, { image: e, text: "Text" }));
|
|
279
|
+
const t = document.querySelector(".ira-text-module");
|
|
280
|
+
o(t).toBeInTheDocument();
|
|
281
|
+
}), s("should handle whitespace-only altText as truthy", () => {
|
|
282
|
+
const e = n({ altText: " " });
|
|
283
|
+
r(/* @__PURE__ */ a(l, { image: e, text: "Text" }));
|
|
284
|
+
const t = document.querySelector(".ira-text-module");
|
|
285
|
+
o(t).not.toBeInTheDocument();
|
|
286
|
+
}), s("should handle negative height", () => {
|
|
287
|
+
r(/* @__PURE__ */ a(l, { height: -5 }));
|
|
288
|
+
const e = document.querySelector("a");
|
|
289
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-height")).toBe("-5rem");
|
|
290
|
+
}), s("should handle very large baseline adjustment", () => {
|
|
291
|
+
r(/* @__PURE__ */ a(l, { baselineAdjustment: 999 }));
|
|
292
|
+
const e = document.querySelector("a");
|
|
293
|
+
o(e == null ? void 0 : e.style.getPropertyValue("--ira-baseline-adjustment")).toBe("999rem");
|
|
294
|
+
});
|
|
295
|
+
}), u("Integration", () => {
|
|
296
|
+
s("should render complete component with all props", () => {
|
|
297
|
+
const e = n({
|
|
298
|
+
url: "https://example.com/logo.png",
|
|
299
|
+
altText: "Company Logo",
|
|
300
|
+
width: 300,
|
|
301
|
+
height: 150
|
|
302
|
+
});
|
|
303
|
+
r(
|
|
304
|
+
/* @__PURE__ */ a(
|
|
305
|
+
l,
|
|
306
|
+
{
|
|
307
|
+
baselineAdjustment: 0.5,
|
|
308
|
+
classname: "custom-logo",
|
|
309
|
+
height: 5,
|
|
310
|
+
href: "https://example.com",
|
|
311
|
+
image: e,
|
|
312
|
+
target: "_blank",
|
|
313
|
+
text: "Company Name"
|
|
314
|
+
}
|
|
315
|
+
)
|
|
316
|
+
);
|
|
317
|
+
const t = i.getByRole("link"), c = i.getByRole("presentation");
|
|
318
|
+
o(t).toHaveAttribute("href", "https://example.com"), o(t).toHaveAttribute("target", "_blank"), o(t).toHaveAttribute("rel", "noreferrer"), o(t).toHaveClass("custom-logo"), o(c).toHaveAttribute("src", "https://example.com/logo.png"), o(c).toHaveAttribute("alt", "Company Logo"), o(t == null ? void 0 : t.style.getPropertyValue("--ira-aspect-ratio")).toBe("2"), o(t == null ? void 0 : t.style.getPropertyValue("--ira-height")).toBe("5rem"), o(t == null ? void 0 : t.style.getPropertyValue("--ira-baseline-adjustment")).toBe("0.5rem"), o(document.querySelector(".ira-text-module")).not.toBeInTheDocument();
|
|
319
|
+
}), s("should render minimal component for logo replacement", () => {
|
|
320
|
+
const e = n({ altText: "" });
|
|
321
|
+
r(
|
|
322
|
+
/* @__PURE__ */ a(
|
|
323
|
+
l,
|
|
324
|
+
{
|
|
325
|
+
href: "/",
|
|
326
|
+
image: e,
|
|
327
|
+
text: "Home"
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
);
|
|
331
|
+
const t = i.getByRole("link"), c = document.querySelector(".ira-text-module");
|
|
332
|
+
o(t).toHaveAttribute("href", "/"), o(c).toHaveTextContent("Home");
|
|
333
|
+
}), s("should handle external link with security attributes", () => {
|
|
334
|
+
r(
|
|
335
|
+
/* @__PURE__ */ a(
|
|
336
|
+
l,
|
|
337
|
+
{
|
|
338
|
+
href: "https://external-site.com",
|
|
339
|
+
target: "_blank"
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
);
|
|
343
|
+
const e = i.getByRole("link");
|
|
344
|
+
o(e).toHaveAttribute("target", "_blank"), o(e).toHaveAttribute("rel", "noreferrer");
|
|
345
|
+
}), s("should handle internal link without security attributes", () => {
|
|
346
|
+
r(
|
|
347
|
+
/* @__PURE__ */ a(
|
|
348
|
+
l,
|
|
349
|
+
{
|
|
350
|
+
href: "/about",
|
|
351
|
+
target: "_self"
|
|
352
|
+
}
|
|
353
|
+
)
|
|
354
|
+
);
|
|
355
|
+
const e = document.querySelector("a");
|
|
356
|
+
o(e).toHaveAttribute("target", "_self"), o(e).not.toHaveAttribute("rel");
|
|
357
|
+
});
|
|
358
|
+
}), u("Accessibility", () => {
|
|
359
|
+
s("should set role presentation on image", () => {
|
|
360
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
361
|
+
const e = i.getByRole("presentation");
|
|
362
|
+
o(e).toHaveAttribute("role", "presentation");
|
|
363
|
+
}), s("should provide text fallback when image alt is empty", () => {
|
|
364
|
+
const e = n({ altText: "" });
|
|
365
|
+
r(/* @__PURE__ */ a(l, { image: e, text: "Accessible Text" }));
|
|
366
|
+
const t = document.querySelector(".ira-text-module");
|
|
367
|
+
o(t).toHaveTextContent("Accessible Text");
|
|
368
|
+
}), s("should not duplicate text when alt text exists", () => {
|
|
369
|
+
const e = n({ altText: "Logo Alt Text" });
|
|
370
|
+
r(/* @__PURE__ */ a(l, { image: e, text: "Logo Text" }));
|
|
371
|
+
const t = document.querySelector(".ira-text-module");
|
|
372
|
+
o(t).not.toBeInTheDocument();
|
|
373
|
+
}), s("should have lazy loading for performance", () => {
|
|
374
|
+
r(/* @__PURE__ */ a(l, {}));
|
|
375
|
+
const e = i.getByRole("presentation");
|
|
376
|
+
o(e).toHaveAttribute("loading", "lazy");
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
});
|
|
@@ -2,7 +2,7 @@ import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as b, useRef as d, useEffect as m } from "react";
|
|
3
3
|
import { classes as i } from "../../utils/helpers.js";
|
|
4
4
|
import { blockLayoutsMap as h } from "../../settings.js";
|
|
5
|
-
import { C as k } from "../../chevron-left-
|
|
5
|
+
import { C as k } from "../../chevron-left-D0UjbrKw.mjs";
|
|
6
6
|
import '../../assets/InfoPanel.css';const l = {
|
|
7
7
|
"info-panel": "_info-panel_1j4w6_1",
|
|
8
8
|
"info-panel__back-btn": "_info-panel__back-btn_1j4w6_19"
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { v as u, d, b as r, i as s, r as o, s as n, g as e } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import { InlineNavigation as i } from "./InlineNavigation.js";
|
|
4
|
+
u.mock("../NavList", () => ({
|
|
5
|
+
default: ({ classname: c, links: t }) => /* @__PURE__ */ a("ul", { "data-classname": c, "data-links-count": t.length, "data-testid": "nav-list", children: t.map(
|
|
6
|
+
(l, v) => /* @__PURE__ */ a("li", { children: l.label || l.href }, v)
|
|
7
|
+
) })
|
|
8
|
+
}));
|
|
9
|
+
u.mock("./InlineNavigation.module.scss", () => ({
|
|
10
|
+
default: {
|
|
11
|
+
"inline-navigation": "inline-navigation-module"
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
d("InlineNavigation", () => {
|
|
15
|
+
const c = (t) => ({
|
|
16
|
+
href: "/test",
|
|
17
|
+
label: "Test Link",
|
|
18
|
+
...t
|
|
19
|
+
});
|
|
20
|
+
r(() => {
|
|
21
|
+
u.clearAllMocks();
|
|
22
|
+
}), d("Basic Rendering", () => {
|
|
23
|
+
s("should render nav element", () => {
|
|
24
|
+
o(/* @__PURE__ */ a(i, {}));
|
|
25
|
+
const t = n.getByRole("navigation");
|
|
26
|
+
e(t).toBeInTheDocument();
|
|
27
|
+
}), s("should apply module class", () => {
|
|
28
|
+
o(/* @__PURE__ */ a(i, {}));
|
|
29
|
+
const t = n.getByRole("navigation");
|
|
30
|
+
e(t).toHaveClass("inline-navigation-module");
|
|
31
|
+
}), s("should render NavList component", () => {
|
|
32
|
+
o(/* @__PURE__ */ a(i, {}));
|
|
33
|
+
const t = n.getByTestId("nav-list");
|
|
34
|
+
e(t).toBeInTheDocument();
|
|
35
|
+
});
|
|
36
|
+
}), d("Links Prop", () => {
|
|
37
|
+
s("should pass empty array by default", () => {
|
|
38
|
+
o(/* @__PURE__ */ a(i, {}));
|
|
39
|
+
const t = n.getByTestId("nav-list");
|
|
40
|
+
e(t).toHaveAttribute("data-links-count", "0");
|
|
41
|
+
}), s("should pass single link to NavList", () => {
|
|
42
|
+
const t = [c()];
|
|
43
|
+
o(/* @__PURE__ */ a(i, { links: t }));
|
|
44
|
+
const l = n.getByTestId("nav-list");
|
|
45
|
+
e(l).toHaveAttribute("data-links-count", "1"), e(n.getByText("Test Link")).toBeInTheDocument();
|
|
46
|
+
}), s("should pass multiple links to NavList", () => {
|
|
47
|
+
const t = [
|
|
48
|
+
c({ label: "Link 1" }),
|
|
49
|
+
c({ label: "Link 2" }),
|
|
50
|
+
c({ label: "Link 3" })
|
|
51
|
+
];
|
|
52
|
+
o(/* @__PURE__ */ a(i, { links: t }));
|
|
53
|
+
const l = n.getByTestId("nav-list");
|
|
54
|
+
e(l).toHaveAttribute("data-links-count", "3"), e(n.getByText("Link 1")).toBeInTheDocument(), e(n.getByText("Link 2")).toBeInTheDocument(), e(n.getByText("Link 3")).toBeInTheDocument();
|
|
55
|
+
});
|
|
56
|
+
}), d("Classname Prop", () => {
|
|
57
|
+
s("should pass empty string by default", () => {
|
|
58
|
+
o(/* @__PURE__ */ a(i, {}));
|
|
59
|
+
const t = n.getByTestId("nav-list");
|
|
60
|
+
e(t).toHaveAttribute("data-classname", "");
|
|
61
|
+
}), s("should pass custom classname to NavList", () => {
|
|
62
|
+
o(/* @__PURE__ */ a(i, { classname: "custom-nav" }));
|
|
63
|
+
const t = n.getByTestId("nav-list");
|
|
64
|
+
e(t).toHaveAttribute("data-classname", "custom-nav");
|
|
65
|
+
}), s("should pass multiple classes to NavList", () => {
|
|
66
|
+
o(/* @__PURE__ */ a(i, { classname: "class-one class-two" }));
|
|
67
|
+
const t = n.getByTestId("nav-list");
|
|
68
|
+
e(t).toHaveAttribute("data-classname", "class-one class-two");
|
|
69
|
+
});
|
|
70
|
+
}), d("Position Prop - CSS Custom Property", () => {
|
|
71
|
+
s("should default to left position", () => {
|
|
72
|
+
o(/* @__PURE__ */ a(i, {}));
|
|
73
|
+
const t = n.getByRole("navigation");
|
|
74
|
+
e(t).toHaveStyle({
|
|
75
|
+
"--inline-nav-justify-content": "flex-start"
|
|
76
|
+
});
|
|
77
|
+
}), s("should apply left position", () => {
|
|
78
|
+
o(/* @__PURE__ */ a(i, { position: "left" }));
|
|
79
|
+
const t = n.getByRole("navigation");
|
|
80
|
+
e(t).toHaveStyle({
|
|
81
|
+
"--inline-nav-justify-content": "flex-start"
|
|
82
|
+
});
|
|
83
|
+
}), s("should apply right position", () => {
|
|
84
|
+
o(/* @__PURE__ */ a(i, { position: "right" }));
|
|
85
|
+
const t = n.getByRole("navigation");
|
|
86
|
+
e(t).toHaveStyle({
|
|
87
|
+
"--inline-nav-justify-content": "flex-end"
|
|
88
|
+
});
|
|
89
|
+
}), s("should apply center position", () => {
|
|
90
|
+
o(/* @__PURE__ */ a(i, { position: "center" }));
|
|
91
|
+
const t = n.getByRole("navigation");
|
|
92
|
+
e(t).toHaveStyle({
|
|
93
|
+
"--inline-nav-justify-content": "center"
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}), d("Integration", () => {
|
|
97
|
+
s("should render with all props combined", () => {
|
|
98
|
+
const t = [
|
|
99
|
+
c({ label: "Home", href: "/" }),
|
|
100
|
+
c({ label: "About", href: "/about" })
|
|
101
|
+
];
|
|
102
|
+
o(
|
|
103
|
+
/* @__PURE__ */ a(
|
|
104
|
+
i,
|
|
105
|
+
{
|
|
106
|
+
classname: "my-nav",
|
|
107
|
+
links: t,
|
|
108
|
+
position: "center"
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
);
|
|
112
|
+
const l = n.getByRole("navigation");
|
|
113
|
+
e(l).toHaveClass("inline-navigation-module"), e(l).toHaveStyle({
|
|
114
|
+
"--inline-nav-justify-content": "center"
|
|
115
|
+
});
|
|
116
|
+
const v = n.getByTestId("nav-list");
|
|
117
|
+
e(v).toHaveAttribute("data-classname", "my-nav"), e(v).toHaveAttribute("data-links-count", "2"), e(n.getByText("Home")).toBeInTheDocument(), e(n.getByText("About")).toBeInTheDocument();
|
|
118
|
+
}), s("should render with only links prop", () => {
|
|
119
|
+
const t = [c()];
|
|
120
|
+
o(/* @__PURE__ */ a(i, { links: t }));
|
|
121
|
+
const l = n.getByRole("navigation");
|
|
122
|
+
e(l).toHaveStyle({
|
|
123
|
+
"--inline-nav-justify-content": "flex-start"
|
|
124
|
+
});
|
|
125
|
+
const v = n.getByTestId("nav-list");
|
|
126
|
+
e(v).toHaveAttribute("data-classname", ""), e(v).toHaveAttribute("data-links-count", "1");
|
|
127
|
+
}), s("should render with all defaults", () => {
|
|
128
|
+
o(/* @__PURE__ */ a(i, {}));
|
|
129
|
+
const t = n.getByRole("navigation");
|
|
130
|
+
e(t).toHaveClass("inline-navigation-module"), e(t).toHaveStyle({
|
|
131
|
+
"--inline-nav-justify-content": "flex-start"
|
|
132
|
+
});
|
|
133
|
+
const l = n.getByTestId("nav-list");
|
|
134
|
+
e(l).toHaveAttribute("data-classname", ""), e(l).toHaveAttribute("data-links-count", "0");
|
|
135
|
+
});
|
|
136
|
+
}), d("Edge Cases", () => {
|
|
137
|
+
s("should handle links with only URL", () => {
|
|
138
|
+
o(/* @__PURE__ */ a(i, { links: [{ href: "/test" }] })), e(n.getByText("/test")).toBeInTheDocument();
|
|
139
|
+
}), s("should handle empty classname string", () => {
|
|
140
|
+
o(/* @__PURE__ */ a(i, { classname: "" }));
|
|
141
|
+
const t = n.getByTestId("nav-list");
|
|
142
|
+
e(t).toHaveAttribute("data-classname", "");
|
|
143
|
+
}), s("should handle whitespace in classname", () => {
|
|
144
|
+
o(/* @__PURE__ */ a(i, { classname: " spaced " }));
|
|
145
|
+
const t = n.getByTestId("nav-list");
|
|
146
|
+
e(t).toHaveAttribute("data-classname", " spaced ");
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as s, useRef as b } from "react";
|
|
3
3
|
import { classes as m, areaCodePhoneNumberMask as M } from "../../utils/helpers.js";
|
|
4
|
-
import { s as t, C as V, A as $ } from "../../Form.module-
|
|
4
|
+
import { s as t, C as V, A as $ } from "../../Form.module-CarfWK5T.mjs";
|
|
5
5
|
function B({
|
|
6
6
|
name: a,
|
|
7
7
|
label: h = "",
|