@scrippsproduct/networks-ui-library 1.1.9 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/{Form.module-Cd8qH2rj.mjs → Form.module-CarfWK5T.mjs} +1 -1
  2. package/dist/ResultsTable.module-wcNUQEKe.mjs +14 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.mjs +8 -0
  4. package/dist/assets/ResultsTable.css +1 -1
  5. package/dist/{chevron-left-DRvpaLmK.mjs → chevron-left-D0UjbrKw.mjs} +1 -1
  6. package/dist/{chevron-right-C8yCnmfx.mjs → chevron-right-0ZF3LruR.mjs} +1 -1
  7. package/dist/components/ActionButton/ActionButton.test.js +209 -0
  8. package/dist/components/AdBlock/AdBlock.test.js +286 -0
  9. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +295 -0
  10. package/dist/components/AirDateFormatter/AirDateFormatter.test.js +192 -0
  11. package/dist/components/AnchorTag/AnchorTag.test.js +463 -0
  12. package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +295 -0
  13. package/dist/components/BasicGridModule/BasicGridModule.js +41 -37
  14. package/dist/components/BasicGridModule/BasicGridModule.test.js +227 -0
  15. package/dist/components/Button/Button.test.js +434 -0
  16. package/dist/components/Carousel/Carousel.js +2 -2
  17. package/dist/components/Carousel/Carousel.test.js +705 -0
  18. package/dist/components/CarouselSlide/CarouselSlide.test.js +378 -0
  19. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
  20. package/dist/components/CastInfoLayout/CastInfoLayout.test.js +294 -0
  21. package/dist/components/ChannelSearch/ChannelSearch.test.js +565 -0
  22. package/dist/components/ChoicesItem/ChoicesItem.test.js +428 -0
  23. package/dist/components/Concat/Concat.js +1 -1
  24. package/dist/components/Concat/Concat.test.js +115 -0
  25. package/dist/components/CtaBlock/CtaBlock.js +1 -1
  26. package/dist/components/CtaBlock/CtaBlock.test.js +226 -0
  27. package/dist/components/CustomDataList/CustomDataList.js +4 -4
  28. package/dist/components/CustomSelect/CustomSelect.js +86 -86
  29. package/dist/components/CustomSelect/CustomSelect.test.js +313 -0
  30. package/dist/components/DateNavigation/DateNavigation.js +10 -10
  31. package/dist/components/DateNavigation/DateNavigation.test.js +370 -0
  32. package/dist/components/DatePicker/DatePicker.js +1 -1
  33. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +288 -0
  34. package/dist/components/DrawerNavigation/DrawerNavigation.test.js +316 -0
  35. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +337 -0
  36. package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +358 -0
  37. package/dist/components/ErrorHandler/ErrorHandler.js +2 -2
  38. package/dist/components/ErrorHandler/ErrorHandler.test.js +158 -0
  39. package/dist/components/FeaturedList/FeaturedList.test.js +353 -0
  40. package/dist/components/Figure/Figure.js +1 -1
  41. package/dist/components/Figure/Figure.test.js +198 -0
  42. package/dist/components/FindUs/FindUs.test.js +499 -0
  43. package/dist/components/FooterNavigation/FooterNavigation.test.js +310 -0
  44. package/dist/components/GenericList/GenericList.js +1 -1
  45. package/dist/components/GenericList/GenericList.test.js +288 -0
  46. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +689 -0
  47. package/dist/components/GradientButton/GradientButton.d.ts +1 -1
  48. package/dist/components/GradientButton/GradientButton.js +33 -31
  49. package/dist/components/GradientButton/GradientButton.test.js +457 -0
  50. package/dist/components/GridList/GridList.test.js +371 -0
  51. package/dist/components/ImageCard/ImageCard.test.js +668 -0
  52. package/dist/components/ImageCard/ImageCardCore.js +28 -28
  53. package/dist/components/ImageCard/ImageCardCore.test.js +577 -0
  54. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +379 -0
  55. package/dist/components/InfoPanel/InfoPanel.js +1 -1
  56. package/dist/components/InlineNavigation/InlineNavigation.test.js +149 -0
  57. package/dist/components/Input/Input.js +1 -1
  58. package/dist/components/Input/Input.test.js +263 -0
  59. package/dist/components/InstructionsList/InstructionsList.js +11 -11
  60. package/dist/components/InstructionsList/InstructionsList.test.js +181 -0
  61. package/dist/components/LogoListItem/LogoListItem.test.js +303 -0
  62. package/dist/components/LogoNavigation/LogoNavigation.test.js +352 -0
  63. package/dist/components/ModalContainer/ModalContainer.js +2 -2
  64. package/dist/components/NavList/NavList.test.js +332 -0
  65. package/dist/components/Overlay/Overlay.js +24 -23
  66. package/dist/components/Overlay/Overlay.test.js +198 -0
  67. package/dist/components/PageHero/PageHero.test.js +241 -0
  68. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
  69. package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
  70. package/dist/components/ProgramAirdate/ProgramAirdate.test.js +414 -0
  71. package/dist/components/PromotionBlock/PromotionBlock.test.js +208 -0
  72. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +221 -0
  73. package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +349 -0
  74. package/dist/components/RescanInstructions/RescanInstructions.test.js +218 -0
  75. package/dist/components/ResponsiveImage/ResponsiveImage.test.js +264 -0
  76. package/dist/components/ResultsTable/ResultsTable.js +9 -2
  77. package/dist/components/ResultsTable/ResultsTable.test.js +402 -0
  78. package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
  79. package/dist/components/ResultsTableBody/ResultsTableBody.test.js +445 -0
  80. package/dist/components/ResultsTableHeader/ResultsTableHeader.js +37 -15
  81. package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +275 -0
  82. package/dist/components/ScheduleLayout/ScheduleContext.js +654 -626
  83. package/dist/components/ScheduleLayout/ScheduleLayout.js +1 -1
  84. package/dist/components/ScheduleLayout/useScheduleContext.js +5 -10
  85. package/dist/components/ScheduleList/ScheduleList.js +1 -1
  86. package/dist/components/SectionedContent/SectionedContent.js +1 -1
  87. package/dist/components/SectionedContent/SectionedContent.test.js +341 -0
  88. package/dist/components/Select/Select.js +24 -24
  89. package/dist/components/Select/Select.test.js +367 -0
  90. package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
  91. package/dist/components/ShowAboutContent/ShowAboutContent.test.js +535 -0
  92. package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +570 -0
  93. package/dist/components/SocialLinks/SocialLinks.js +1 -1
  94. package/dist/components/StringList/StringList.js +1 -1
  95. package/dist/components/StringList/StringList.test.js +311 -0
  96. package/dist/components/TabContent/TabContent.js +1 -1
  97. package/dist/components/TabContent/TabContent.test.js +274 -0
  98. package/dist/components/TabNavigation/TabNavigation.js +21 -21
  99. package/dist/components/TabNavigation/TabNavigation.test.js +535 -0
  100. package/dist/components/TabbedContent/TabbedContent.test.js +654 -0
  101. package/dist/components/TextArea/TextArea.js +1 -1
  102. package/dist/components/UpcomingList/UpcomingList.test.js +471 -0
  103. package/dist/{index-VjANCDXC.mjs → index-06PEPfBQ.mjs} +1 -1
  104. package/dist/index-BUN4jQ3m.mjs +3098 -0
  105. package/dist/index-BVxBrkZB.mjs +3 -0
  106. package/dist/{index-DC2JJV3a.mjs → index-D3kkcgee.mjs} +1 -1
  107. package/dist/{index-C-kn9Zhn.mjs → index-DzfYkULW.mjs} +2 -1
  108. package/dist/magic-string.es-uPKorP4O.mjs +663 -0
  109. package/dist/matchers-35e4d3bd-BBPNTlen.mjs +2404 -0
  110. package/dist/react.esm-DLSrfVwM.mjs +23410 -0
  111. package/dist/test/setupTests.d.ts +1 -0
  112. package/dist/test/setupTests.js +55 -0
  113. package/dist/{triangle-PcCcGXjr.mjs → triangle-C4z906Wf.mjs} +1 -1
  114. package/dist/useScheduleContext-D7FdzNxe.mjs +17 -0
  115. package/dist/utils/analytics.js +1 -1
  116. package/dist/utils/getOnNowProgram.js +10 -10
  117. package/dist/{x-C-QzJ-qD.mjs → x-Ck9Vk5Fo.mjs} +1 -1
  118. package/package.json +4 -1
  119. package/dist/ResultsTable.module-1zxhXaem.mjs +0 -14
  120. package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
@@ -0,0 +1,463 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { d as c, i as n, r as i, g as t, s, v as g } from "../../react.esm-DLSrfVwM.mjs";
3
+ import { u as m } from "../../index-BUN4jQ3m.mjs";
4
+ import "../../index-BVxBrkZB.mjs";
5
+ import { AnchorTag as o } from "./AnchorTag.js";
6
+ c("AnchorTag", () => {
7
+ c("Basic Rendering", () => {
8
+ n("should render with label text", () => {
9
+ i(/* @__PURE__ */ a(o, { label: "Click Here" })), t(s.getByText("Click Here")).toBeInTheDocument();
10
+ }), n("should render with href attribute", () => {
11
+ i(/* @__PURE__ */ a(o, { href: "https://example.com", label: "Link" }));
12
+ const l = s.getByRole("link");
13
+ t(l).toHaveAttribute("href", "https://example.com");
14
+ }), n("should render with empty href by default", () => {
15
+ const { container: l } = i(/* @__PURE__ */ a(o, { label: "Link" })), e = l.querySelector("a");
16
+ t(e).toBeInTheDocument(), t(e).toHaveAttribute("href", "");
17
+ }), n("should render with custom className", () => {
18
+ i(/* @__PURE__ */ a(o, { classname: "custom-class", href: "/test", label: "Link" }));
19
+ const l = s.getByRole("link");
20
+ t(l).toHaveClass("custom-class");
21
+ });
22
+ }), c("Link Type: internal-link (default)", () => {
23
+ n("should use internal-link as default type", () => {
24
+ i(/* @__PURE__ */ a(o, { href: "/page", label: "Internal Link" }));
25
+ const l = s.getByRole("link");
26
+ t(l).toHaveAttribute("target", "_self"), t(l).not.toHaveAttribute("rel");
27
+ }), n("should set target to _self for internal links", () => {
28
+ i(/* @__PURE__ */ a(o, { href: "/page", label: "Internal Link", type: "internal-link" }));
29
+ const l = s.getByRole("link");
30
+ t(l).toHaveAttribute("target", "_self");
31
+ }), n("should not have rel attribute for internal links", () => {
32
+ i(/* @__PURE__ */ a(o, { href: "/page", label: "Internal Link", type: "internal-link" }));
33
+ const l = s.getByRole("link");
34
+ t(l).not.toHaveAttribute("rel");
35
+ });
36
+ }), c("Link Type: external-link", () => {
37
+ n("should set target to _blank for external links", () => {
38
+ i(/* @__PURE__ */ a(o, { href: "https://example.com", label: "External Link", type: "external-link" }));
39
+ const l = s.getByRole("link");
40
+ t(l).toHaveAttribute("target", "_blank");
41
+ }), n("should set rel to noreferrer for external links", () => {
42
+ i(/* @__PURE__ */ a(o, { href: "https://example.com", label: "External Link", type: "external-link" }));
43
+ const l = s.getByRole("link");
44
+ t(l).toHaveAttribute("rel", "noreferrer");
45
+ });
46
+ }), c("Click Handler", () => {
47
+ n("should call clickHandler when clicked on internal hash link", async () => {
48
+ const l = m.setup(), e = g.fn();
49
+ i(/* @__PURE__ */ a(
50
+ o,
51
+ {
52
+ clickHandler: e,
53
+ href: "#section",
54
+ label: "Jump Link",
55
+ type: "internal-link"
56
+ }
57
+ ));
58
+ const r = s.getByRole("link");
59
+ await l.click(r), t(e).toHaveBeenCalledTimes(1);
60
+ }), n("should not call clickHandler for non-hash internal links", async () => {
61
+ const l = m.setup(), e = g.fn((k) => k.preventDefault()), { container: r } = i(/* @__PURE__ */ a(
62
+ o,
63
+ {
64
+ clickHandler: e,
65
+ href: "",
66
+ label: "Page Link",
67
+ type: "internal-link"
68
+ }
69
+ )), h = r.querySelector("a");
70
+ h && await l.click(h), t(e).not.toHaveBeenCalled();
71
+ }), n("should not call clickHandler for external links", async () => {
72
+ const l = m.setup(), e = g.fn();
73
+ i(/* @__PURE__ */ a(
74
+ o,
75
+ {
76
+ clickHandler: e,
77
+ href: "https://example.com#section",
78
+ label: "External",
79
+ type: "external-link"
80
+ }
81
+ ));
82
+ const r = s.getByRole("link");
83
+ await l.click(r), t(e).not.toHaveBeenCalled();
84
+ }), n("should pass the event to clickHandler", async () => {
85
+ const l = m.setup(), e = g.fn();
86
+ i(/* @__PURE__ */ a(
87
+ o,
88
+ {
89
+ clickHandler: e,
90
+ href: "#section",
91
+ label: "Jump",
92
+ type: "internal-link"
93
+ }
94
+ ));
95
+ const r = s.getByRole("link");
96
+ await l.click(r), t(e).toHaveBeenCalledWith(t.any(Object));
97
+ }), n("should not have onClick when clickHandler is null", () => {
98
+ i(/* @__PURE__ */ a(
99
+ o,
100
+ {
101
+ clickHandler: null,
102
+ href: "#section",
103
+ label: "Link",
104
+ type: "internal-link"
105
+ }
106
+ ));
107
+ const l = s.getByRole("link");
108
+ t(l.onclick).toBeNull();
109
+ });
110
+ }), c("Image Rendering", () => {
111
+ const l = {
112
+ url: "https://example.com/image.jpg",
113
+ altText: "Test Image",
114
+ aspectRatio: 1.5,
115
+ width: 300,
116
+ height: 200
117
+ };
118
+ n("should render image when image prop is provided", () => {
119
+ i(/* @__PURE__ */ a(o, { href: "/", image: l, label: "Image Link" }));
120
+ const e = s.getByRole("img");
121
+ t(e).toBeInTheDocument(), t(e).toHaveAttribute("src", "https://example.com/image.jpg");
122
+ }), n("should use label as alt text for image", () => {
123
+ i(/* @__PURE__ */ a(o, { href: "/", image: l, label: "Test Label" }));
124
+ const e = s.getByRole("img");
125
+ t(e).toHaveAttribute("alt", "Test Label");
126
+ }), n("should render label in sr-only span when image is present", () => {
127
+ const { container: e } = i(/* @__PURE__ */ a(o, { href: "/", image: l, label: "Screen Reader Text" })), r = e.querySelector(".sr-only");
128
+ t(r).toBeInTheDocument(), t(r == null ? void 0 : r.textContent).toBe("Screen Reader Text");
129
+ }), n("should apply image-specific classes when image is present", () => {
130
+ i(/* @__PURE__ */ a(o, { href: "/", image: l, label: "Image Link" }));
131
+ const e = s.getByRole("link");
132
+ t(e).toHaveClass("anchor-tag--image");
133
+ }), n("should include custom classname along with image classes", () => {
134
+ i(/* @__PURE__ */ a(
135
+ o,
136
+ {
137
+ classname: "custom",
138
+ href: "/",
139
+ image: l,
140
+ label: "Image Link"
141
+ }
142
+ ));
143
+ const e = s.getByRole("link");
144
+ t(e).toHaveClass("custom"), t(e).toHaveClass("anchor-tag--image");
145
+ }), n("should set aspect ratio CSS variable when width and height are provided", () => {
146
+ i(/* @__PURE__ */ a(o, { href: "/", image: l, label: "Image Link" }));
147
+ const e = s.getByRole("link");
148
+ t(e).toHaveStyle({ "--anchor-tag-image-ratio": "1.5" });
149
+ }), n("should default aspect ratio to 1 when width or height is missing", () => {
150
+ i(/* @__PURE__ */ a(o, { href: "/", image: {
151
+ url: "https://example.com/image.jpg",
152
+ altText: "Test",
153
+ aspectRatio: 1.5
154
+ }, label: "Image Link" }));
155
+ const r = s.getByRole("link");
156
+ t(r).toHaveStyle({ "--anchor-tag-image-ratio": "1" });
157
+ }), n("should handle image with only width provided", () => {
158
+ i(/* @__PURE__ */ a(o, { href: "/", image: {
159
+ url: "https://example.com/image.jpg",
160
+ altText: "Test",
161
+ aspectRatio: 1.5,
162
+ width: 300
163
+ }, label: "Image Link" }));
164
+ const r = s.getByRole("link");
165
+ t(r).toHaveStyle({ "--anchor-tag-image-ratio": "1" });
166
+ }), n("should handle image with only height provided", () => {
167
+ i(/* @__PURE__ */ a(o, { href: "/", image: {
168
+ url: "https://example.com/image.jpg",
169
+ altText: "Test",
170
+ aspectRatio: 1.5,
171
+ height: 200
172
+ }, label: "Image Link" }));
173
+ const r = s.getByRole("link");
174
+ t(r).toHaveStyle({ "--anchor-tag-image-ratio": "1" });
175
+ }), n("should not render image when image is null", () => {
176
+ i(/* @__PURE__ */ a(o, { image: null, label: "No Image" }));
177
+ const e = s.queryByRole("img");
178
+ t(e).not.toBeInTheDocument();
179
+ }), n("should render text label when image is null", () => {
180
+ i(/* @__PURE__ */ a(o, { image: null, label: "Text Only" })), t(s.getByText("Text Only")).toBeInTheDocument();
181
+ const e = s.queryByText("Text Only");
182
+ t(e).not.toHaveClass("sr-only");
183
+ });
184
+ }), c("Image with Link Types", () => {
185
+ const l = {
186
+ url: "https://example.com/image.jpg",
187
+ altText: "Test",
188
+ aspectRatio: 1.5,
189
+ width: 300,
190
+ height: 200
191
+ };
192
+ n("should set internal link attributes with image", () => {
193
+ i(/* @__PURE__ */ a(
194
+ o,
195
+ {
196
+ href: "/page",
197
+ image: l,
198
+ label: "Internal",
199
+ type: "internal-link"
200
+ }
201
+ ));
202
+ const e = s.getByRole("link");
203
+ t(e).toHaveAttribute("target", "_self"), t(e).not.toHaveAttribute("rel");
204
+ }), n("should set external link attributes with image", () => {
205
+ i(/* @__PURE__ */ a(
206
+ o,
207
+ {
208
+ href: "https://example.com",
209
+ image: l,
210
+ label: "External",
211
+ type: "external-link"
212
+ }
213
+ ));
214
+ const e = s.getByRole("link");
215
+ t(e).toHaveAttribute("target", "_blank"), t(e).toHaveAttribute("rel", "noreferrer");
216
+ });
217
+ }), c("Image with Click Handler", () => {
218
+ const l = {
219
+ url: "https://example.com/image.jpg",
220
+ altText: "Test",
221
+ aspectRatio: 1.5,
222
+ width: 300,
223
+ height: 200
224
+ };
225
+ n("should call clickHandler on internal hash link with image", async () => {
226
+ const e = m.setup(), r = g.fn();
227
+ i(/* @__PURE__ */ a(
228
+ o,
229
+ {
230
+ clickHandler: r,
231
+ href: "#section",
232
+ image: l,
233
+ label: "Jump",
234
+ type: "internal-link"
235
+ }
236
+ ));
237
+ const h = s.getByRole("link");
238
+ await e.click(h), t(r).toHaveBeenCalledTimes(1);
239
+ }), n("should not call clickHandler on non-hash link with image", async () => {
240
+ const e = m.setup(), r = g.fn(), { container: h } = i(/* @__PURE__ */ a(
241
+ o,
242
+ {
243
+ clickHandler: r,
244
+ href: "",
245
+ image: l,
246
+ label: "Page",
247
+ type: "internal-link"
248
+ }
249
+ )), k = h.querySelector("a");
250
+ k && await e.click(k), t(r).not.toHaveBeenCalled();
251
+ }), n("should not call clickHandler on external link with image", async () => {
252
+ const e = m.setup(), r = g.fn();
253
+ i(/* @__PURE__ */ a(
254
+ o,
255
+ {
256
+ clickHandler: r,
257
+ href: "https://example.com#section",
258
+ image: l,
259
+ label: "External",
260
+ type: "external-link"
261
+ }
262
+ ));
263
+ const h = s.getByRole("link");
264
+ await e.click(h), t(r).not.toHaveBeenCalled();
265
+ });
266
+ }), c("Default Props", () => {
267
+ n("should render with all default props", () => {
268
+ const { container: l } = i(/* @__PURE__ */ a(o, {})), e = l.querySelector("a");
269
+ t(e).toBeInTheDocument(), t(e).toHaveAttribute("href", ""), t(e).toHaveAttribute("target", "_self"), t(e).not.toHaveAttribute("rel"), t(e == null ? void 0 : e.textContent).toBe("");
270
+ }), n("should have empty className by default", () => {
271
+ const { container: l } = i(/* @__PURE__ */ a(o, { label: "Test" })), e = l.querySelector("a");
272
+ t(e == null ? void 0 : e.className).toBe("");
273
+ });
274
+ }), c("Hash Link Detection", () => {
275
+ n("should detect hash in href for click handler", async () => {
276
+ const l = m.setup(), e = g.fn();
277
+ i(/* @__PURE__ */ a(
278
+ o,
279
+ {
280
+ clickHandler: e,
281
+ href: "#top",
282
+ label: "Top",
283
+ type: "internal-link"
284
+ }
285
+ )), await l.click(s.getByRole("link")), t(e).toHaveBeenCalled();
286
+ }), n("should detect hash in middle of href", async () => {
287
+ const l = m.setup(), e = g.fn((r) => r.preventDefault());
288
+ i(/* @__PURE__ */ a(
289
+ o,
290
+ {
291
+ clickHandler: e,
292
+ href: "#section",
293
+ label: "Section",
294
+ type: "internal-link"
295
+ }
296
+ )), await l.click(s.getByRole("link")), t(e).toHaveBeenCalled();
297
+ }), n("should not trigger handler without hash", async () => {
298
+ const l = m.setup(), e = g.fn(), { container: r } = i(/* @__PURE__ */ a(
299
+ o,
300
+ {
301
+ clickHandler: e,
302
+ href: "",
303
+ label: "Page",
304
+ type: "internal-link"
305
+ }
306
+ )), h = r.querySelector("a");
307
+ h && await l.click(h), t(e).not.toHaveBeenCalled();
308
+ });
309
+ }), c("Edge Cases", () => {
310
+ n("should handle empty label", () => {
311
+ i(/* @__PURE__ */ a(o, { href: "/page", label: "" }));
312
+ const l = s.getByRole("link");
313
+ t(l).toBeInTheDocument(), t(l.textContent).toBe("");
314
+ }), n("should handle label with special characters", () => {
315
+ i(/* @__PURE__ */ a(o, { label: "<Click> & 'Go'" })), t(s.getByText("<Click> & 'Go'")).toBeInTheDocument();
316
+ }), n("should handle very long href", () => {
317
+ const l = "https://example.com/" + "a".repeat(1e3);
318
+ i(/* @__PURE__ */ a(o, { href: l, label: "Long URL" }));
319
+ const e = s.getByRole("link");
320
+ t(e).toHaveAttribute("href", l);
321
+ }), n("should handle image with zero width and height", () => {
322
+ i(/* @__PURE__ */ a(o, { href: "/", image: {
323
+ url: "https://example.com/image.jpg",
324
+ altText: "Test",
325
+ aspectRatio: 1.5,
326
+ width: 0,
327
+ height: 0
328
+ }, label: "Zero Dimensions" }));
329
+ const e = s.getByRole("link");
330
+ t(e).toBeInTheDocument();
331
+ }), n("should handle multiple classes in classname prop", () => {
332
+ i(/* @__PURE__ */ a(o, { classname: "class1 class2 class3", href: "/test", label: "Multi Class" }));
333
+ const l = s.getByRole("link");
334
+ t(l).toHaveClass("class1"), t(l).toHaveClass("class2"), t(l).toHaveClass("class3");
335
+ });
336
+ }), c("Accessibility", () => {
337
+ n("should be keyboard accessible", () => {
338
+ i(/* @__PURE__ */ a(o, { href: "/page", label: "Link" }));
339
+ const l = s.getByRole("link");
340
+ l.focus(), t(l).toHaveFocus();
341
+ }), n("should have proper role", () => {
342
+ i(/* @__PURE__ */ a(o, { href: "/page", label: "Link" })), t(s.getByRole("link")).toBeInTheDocument();
343
+ }), n("should provide screen reader text when image is used", () => {
344
+ const l = {
345
+ url: "https://example.com/image.jpg",
346
+ altText: "Test",
347
+ aspectRatio: 1.5,
348
+ width: 300,
349
+ height: 200
350
+ }, { container: e } = i(/* @__PURE__ */ a(o, { image: l, label: "Accessible Text" })), r = e.querySelector(".sr-only");
351
+ t(r).toHaveTextContent("Accessible Text");
352
+ }), n("should have proper alt text on image", () => {
353
+ i(/* @__PURE__ */ a(o, { image: {
354
+ url: "https://example.com/image.jpg",
355
+ altText: "Test",
356
+ aspectRatio: 1.5,
357
+ width: 300,
358
+ height: 200
359
+ }, label: "Alt Text Here" }));
360
+ const e = s.getByRole("img");
361
+ t(e).toHaveAttribute("alt", "Alt Text Here");
362
+ }), n("should properly indicate external links with rel noreferrer", () => {
363
+ i(/* @__PURE__ */ a(o, { href: "https://example.com", label: "External", type: "external-link" }));
364
+ const l = s.getByRole("link");
365
+ t(l).toHaveAttribute("rel", "noreferrer"), t(l).toHaveAttribute("target", "_blank");
366
+ });
367
+ }), c("Complex Image Objects", () => {
368
+ n("should handle image with sources", () => {
369
+ i(/* @__PURE__ */ a(o, { image: {
370
+ url: "https://example.com/image.jpg",
371
+ altText: "Test",
372
+ aspectRatio: 1.5,
373
+ width: 300,
374
+ height: 200,
375
+ sources: [
376
+ {
377
+ media: "(min-width: 768px)",
378
+ srcsets: ["image-large.jpg"]
379
+ }
380
+ ]
381
+ }, label: "Image with Sources" }));
382
+ const e = s.getByRole("img");
383
+ t(e).toHaveAttribute("src", "https://example.com/image.jpg");
384
+ }), n("should handle image with caption", () => {
385
+ i(/* @__PURE__ */ a(o, { image: {
386
+ url: "https://example.com/image.jpg",
387
+ altText: "Test",
388
+ aspectRatio: 1.5,
389
+ width: 300,
390
+ height: 200,
391
+ caption: "This is a caption"
392
+ }, label: "Captioned Image" }));
393
+ const e = s.getByRole("img");
394
+ t(e).toBeInTheDocument();
395
+ }), n("should handle image with text property", () => {
396
+ i(/* @__PURE__ */ a(o, { image: {
397
+ url: "https://example.com/image.jpg",
398
+ altText: "Test",
399
+ aspectRatio: 1.5,
400
+ width: 300,
401
+ height: 200,
402
+ text: "Additional text"
403
+ }, label: "Image with Text" }));
404
+ const e = s.getByRole("img");
405
+ t(e).toBeInTheDocument();
406
+ });
407
+ }), c("Integration Tests", () => {
408
+ n("should render complete internal link with all props", () => {
409
+ const l = g.fn();
410
+ i(
411
+ /* @__PURE__ */ a(
412
+ o,
413
+ {
414
+ classname: "nav-link",
415
+ clickHandler: l,
416
+ href: "/about#team",
417
+ label: "About Us",
418
+ type: "internal-link"
419
+ }
420
+ )
421
+ );
422
+ const e = s.getByRole("link");
423
+ t(e).toHaveClass("nav-link"), t(e).toHaveAttribute("href", "/about#team"), t(e).toHaveAttribute("target", "_self"), t(e).not.toHaveAttribute("rel"), t(s.getByText("About Us")).toBeInTheDocument();
424
+ }), n("should render complete external link with all props", () => {
425
+ i(
426
+ /* @__PURE__ */ a(
427
+ o,
428
+ {
429
+ classname: "external-link",
430
+ href: "https://example.com",
431
+ label: "Visit Example",
432
+ type: "external-link"
433
+ }
434
+ )
435
+ );
436
+ const l = s.getByRole("link");
437
+ t(l).toHaveClass("external-link"), t(l).toHaveAttribute("href", "https://example.com"), t(l).toHaveAttribute("target", "_blank"), t(l).toHaveAttribute("rel", "noreferrer"), t(s.getByText("Visit Example")).toBeInTheDocument();
438
+ }), n("should render complete image link with all props", () => {
439
+ i(
440
+ /* @__PURE__ */ a(
441
+ o,
442
+ {
443
+ classname: "logo-link",
444
+ href: "/",
445
+ image: {
446
+ url: "https://example.com/logo.png",
447
+ altText: "Logo",
448
+ aspectRatio: 2,
449
+ width: 400,
450
+ height: 200
451
+ },
452
+ label: "Home",
453
+ type: "internal-link"
454
+ }
455
+ )
456
+ );
457
+ const e = s.getByRole("link");
458
+ t(e).toHaveClass("logo-link"), t(e).toHaveClass("anchor-tag--image"), t(e).toHaveAttribute("href", "/"), t(e).toHaveAttribute("target", "_self"), t(e).toHaveStyle({ "--anchor-tag-image-ratio": "2" });
459
+ const r = s.getByRole("img");
460
+ t(r).toHaveAttribute("src", "https://example.com/logo.png"), t(r).toHaveAttribute("alt", "Home");
461
+ });
462
+ });
463
+ });