@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,370 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { v as b, d, b as S, i as a, r as s, g as n, s as r, w as h } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import { u as i } from "../../index-BUN4jQ3m.mjs";
|
|
4
|
+
import "../../index-BVxBrkZB.mjs";
|
|
5
|
+
import { DateNavigation as l } from "./DateNavigation.js";
|
|
6
|
+
import { S as v } from "../../useScheduleContext-D7FdzNxe.mjs";
|
|
7
|
+
const y = b.fn(), w = () => [[
|
|
8
|
+
{
|
|
9
|
+
date: /* @__PURE__ */ new Date("2026-01-05"),
|
|
10
|
+
dayStr: "Mon",
|
|
11
|
+
dateStr: "5",
|
|
12
|
+
monthStr: "Jan",
|
|
13
|
+
fullDateStr: "2026-01-05"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
date: /* @__PURE__ */ new Date("2026-01-06"),
|
|
17
|
+
dayStr: "Tue",
|
|
18
|
+
dateStr: "6",
|
|
19
|
+
monthStr: "Jan",
|
|
20
|
+
fullDateStr: "2026-01-06"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
date: /* @__PURE__ */ new Date("2026-01-07"),
|
|
24
|
+
dayStr: "Wed",
|
|
25
|
+
dateStr: "7",
|
|
26
|
+
monthStr: "Jan",
|
|
27
|
+
fullDateStr: "2026-01-07"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
date: /* @__PURE__ */ new Date("2026-01-08"),
|
|
31
|
+
dayStr: "Thu",
|
|
32
|
+
dateStr: "8",
|
|
33
|
+
monthStr: "Jan",
|
|
34
|
+
fullDateStr: "2026-01-08"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
date: /* @__PURE__ */ new Date("2026-01-09"),
|
|
38
|
+
dayStr: "Fri",
|
|
39
|
+
dateStr: "9",
|
|
40
|
+
monthStr: "Jan",
|
|
41
|
+
fullDateStr: "2026-01-09"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
date: /* @__PURE__ */ new Date("2026-01-10"),
|
|
45
|
+
dayStr: "Sat",
|
|
46
|
+
dateStr: "10",
|
|
47
|
+
monthStr: "Jan",
|
|
48
|
+
fullDateStr: "2026-01-10"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
date: /* @__PURE__ */ new Date("2026-01-11"),
|
|
52
|
+
dayStr: "Sun",
|
|
53
|
+
dateStr: "11",
|
|
54
|
+
monthStr: "Jan",
|
|
55
|
+
fullDateStr: "2026-01-11"
|
|
56
|
+
}
|
|
57
|
+
], [
|
|
58
|
+
{
|
|
59
|
+
date: /* @__PURE__ */ new Date("2026-01-12"),
|
|
60
|
+
dayStr: "Mon",
|
|
61
|
+
dateStr: "12",
|
|
62
|
+
monthStr: "Jan",
|
|
63
|
+
fullDateStr: "2026-01-12"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
date: /* @__PURE__ */ new Date("2026-01-13"),
|
|
67
|
+
dayStr: "Tue",
|
|
68
|
+
dateStr: "13",
|
|
69
|
+
monthStr: "Jan",
|
|
70
|
+
fullDateStr: "2026-01-13"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
date: /* @__PURE__ */ new Date("2026-01-14"),
|
|
74
|
+
dayStr: "Wed",
|
|
75
|
+
dateStr: "14",
|
|
76
|
+
monthStr: "Jan",
|
|
77
|
+
fullDateStr: "2026-01-14"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
date: /* @__PURE__ */ new Date("2026-01-15"),
|
|
81
|
+
dayStr: "Thu",
|
|
82
|
+
dateStr: "15",
|
|
83
|
+
monthStr: "Jan",
|
|
84
|
+
fullDateStr: "2026-01-15"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
date: /* @__PURE__ */ new Date("2026-01-16"),
|
|
88
|
+
dayStr: "Fri",
|
|
89
|
+
dateStr: "16",
|
|
90
|
+
monthStr: "Jan",
|
|
91
|
+
fullDateStr: "2026-01-16"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
date: /* @__PURE__ */ new Date("2026-01-17"),
|
|
95
|
+
dayStr: "Sat",
|
|
96
|
+
dateStr: "17",
|
|
97
|
+
monthStr: "Jan",
|
|
98
|
+
fullDateStr: "2026-01-17"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
date: /* @__PURE__ */ new Date("2026-01-18"),
|
|
102
|
+
dayStr: "Sun",
|
|
103
|
+
dateStr: "18",
|
|
104
|
+
monthStr: "Jan",
|
|
105
|
+
fullDateStr: "2026-01-18"
|
|
106
|
+
}
|
|
107
|
+
]];
|
|
108
|
+
d("DateNavigation", () => {
|
|
109
|
+
S(() => {
|
|
110
|
+
y.mockClear(), b.spyOn(v, "useScheduleContext").mockReturnValue({
|
|
111
|
+
weeks: w(),
|
|
112
|
+
setCurrentDate: y,
|
|
113
|
+
schedule: [],
|
|
114
|
+
currentDate: /* @__PURE__ */ new Date("2026-01-05"),
|
|
115
|
+
isLoading: !1,
|
|
116
|
+
isError: !1
|
|
117
|
+
});
|
|
118
|
+
}), d("Basic Rendering", () => {
|
|
119
|
+
a("should render navigation component", () => {
|
|
120
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelector("date-navigation");
|
|
121
|
+
n(e).toBeInTheDocument();
|
|
122
|
+
}), a("should render navigation controls", () => {
|
|
123
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelector("date-navigation-controls");
|
|
124
|
+
n(e).toBeInTheDocument();
|
|
125
|
+
}), a("should render navigation list", () => {
|
|
126
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelector("date-navigation-list");
|
|
127
|
+
n(e).toBeInTheDocument();
|
|
128
|
+
}), a("should render previous week button", () => {
|
|
129
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
130
|
+
const t = r.getByRole("button", { name: /current week/i });
|
|
131
|
+
n(t).toBeInTheDocument();
|
|
132
|
+
}), a("should render next week button", () => {
|
|
133
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
134
|
+
const t = r.getByRole("button", { name: /next week/i });
|
|
135
|
+
n(t).toBeInTheDocument();
|
|
136
|
+
}), a("should render tablist with correct role", () => {
|
|
137
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
138
|
+
const t = r.getByRole("tablist", { name: "Date Tabs" });
|
|
139
|
+
n(t).toBeInTheDocument();
|
|
140
|
+
}), a("should render all days of the week", () => {
|
|
141
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
142
|
+
const t = r.getAllByRole("tab");
|
|
143
|
+
n(t).toHaveLength(7);
|
|
144
|
+
});
|
|
145
|
+
}), d("Day Rendering", () => {
|
|
146
|
+
a("should display day names", () => {
|
|
147
|
+
s(/* @__PURE__ */ o(l, {})), n(r.getByText("Mon")).toBeInTheDocument(), n(r.getByText("Tue")).toBeInTheDocument(), n(r.getByText("Wed")).toBeInTheDocument(), n(r.getByText("Thu")).toBeInTheDocument(), n(r.getByText("Fri")).toBeInTheDocument(), n(r.getByText("Sat")).toBeInTheDocument(), n(r.getByText("Sun")).toBeInTheDocument();
|
|
148
|
+
}), a("should display month abbreviation", () => {
|
|
149
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll(".date-navigation__date");
|
|
150
|
+
n(e[0].textContent).toContain("Jan");
|
|
151
|
+
}), a("should display date numbers", () => {
|
|
152
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll(".date-navigation__date");
|
|
153
|
+
n(e[0].textContent).toContain("5"), n(e[1].textContent).toContain("6"), n(e[2].textContent).toContain("7");
|
|
154
|
+
}), a("should have correct aria-controls attribute", () => {
|
|
155
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
156
|
+
const t = r.getAllByRole("tab");
|
|
157
|
+
n(t[0]).toHaveAttribute("aria-controls", "2026-01-05");
|
|
158
|
+
}), a("should apply day class to buttons", () => {
|
|
159
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll(".date-navigation__day");
|
|
160
|
+
n(e.length).toBe(7);
|
|
161
|
+
});
|
|
162
|
+
}), d("Selection State", () => {
|
|
163
|
+
a("should mark first day as selected by default", () => {
|
|
164
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
165
|
+
const t = r.getAllByRole("tab");
|
|
166
|
+
n(t[0]).toHaveAttribute("aria-selected", "true");
|
|
167
|
+
}), a("should only have one selected day", () => {
|
|
168
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
169
|
+
const e = r.getAllByRole("tab").filter((c) => c.getAttribute("aria-selected") === "true");
|
|
170
|
+
n(e).toHaveLength(1);
|
|
171
|
+
}), a("should update selected day when clicked", async () => {
|
|
172
|
+
const t = i.setup();
|
|
173
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
174
|
+
const e = r.getAllByRole("tab");
|
|
175
|
+
await t.click(e[2]), n(e[2]).toHaveAttribute("aria-selected", "true");
|
|
176
|
+
}), a("should deselect previous day when new day selected", async () => {
|
|
177
|
+
const t = i.setup();
|
|
178
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
179
|
+
const e = r.getAllByRole("tab");
|
|
180
|
+
await t.click(e[3]), n(e[0]).toHaveAttribute("aria-selected", "false"), n(e[3]).toHaveAttribute("aria-selected", "true");
|
|
181
|
+
}), a("should not call setCurrentDate when clicking already selected day", async () => {
|
|
182
|
+
const t = i.setup();
|
|
183
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
184
|
+
const e = r.getAllByRole("tab");
|
|
185
|
+
y.mockClear(), await t.click(e[0]), n(y).not.toHaveBeenCalled();
|
|
186
|
+
});
|
|
187
|
+
}), d("Week Navigation", () => {
|
|
188
|
+
a("should disable previous button on first week", () => {
|
|
189
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
190
|
+
const t = r.getByRole("button", { name: /current week/i });
|
|
191
|
+
n(t).toBeDisabled();
|
|
192
|
+
}), a("should enable next button on first week", () => {
|
|
193
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
194
|
+
const t = r.getByRole("button", { name: /next week/i });
|
|
195
|
+
n(t).not.toBeDisabled();
|
|
196
|
+
}), a("should navigate to next week when next button clicked", async () => {
|
|
197
|
+
const t = i.setup(), { container: e } = s(/* @__PURE__ */ o(l, {})), c = r.getByRole("button", { name: /next week/i });
|
|
198
|
+
await t.click(c), await h(() => {
|
|
199
|
+
const u = e.querySelectorAll(".date-navigation__date");
|
|
200
|
+
n(u[0].textContent).toContain("12");
|
|
201
|
+
});
|
|
202
|
+
}), a("should navigate to previous week when previous button clicked", async () => {
|
|
203
|
+
const t = i.setup(), { container: e } = s(/* @__PURE__ */ o(l, {})), c = r.getByRole("button", { name: /next week/i });
|
|
204
|
+
await t.click(c), await h(() => {
|
|
205
|
+
const g = e.querySelectorAll(".date-navigation__date");
|
|
206
|
+
n(g[0].textContent).toContain("12");
|
|
207
|
+
});
|
|
208
|
+
const u = r.getByRole("button", { name: /current week/i });
|
|
209
|
+
await t.click(u), await h(() => {
|
|
210
|
+
const g = e.querySelectorAll(".date-navigation__date");
|
|
211
|
+
n(g[0].textContent).toContain("5");
|
|
212
|
+
});
|
|
213
|
+
}), a("should disable next button on last week", async () => {
|
|
214
|
+
const t = i.setup();
|
|
215
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
216
|
+
const e = r.getByRole("button", { name: /next week/i });
|
|
217
|
+
await t.click(e), await h(() => {
|
|
218
|
+
n(e).toBeDisabled();
|
|
219
|
+
});
|
|
220
|
+
}), a("should enable previous button on second week", async () => {
|
|
221
|
+
const t = i.setup();
|
|
222
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
223
|
+
const e = r.getByRole("button", { name: /next week/i }), c = r.getByRole("button", { name: /current week/i });
|
|
224
|
+
await t.click(e), await h(() => {
|
|
225
|
+
n(c).not.toBeDisabled();
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
}), d("Navigation State", () => {
|
|
229
|
+
a("should start with idle state", () => {
|
|
230
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelector("date-navigation");
|
|
231
|
+
n(e).toHaveAttribute("data-state", "idle");
|
|
232
|
+
}), a("should set advancing state when navigating forward", async () => {
|
|
233
|
+
const t = i.setup(), { container: e } = s(/* @__PURE__ */ o(l, {})), c = r.getByRole("button", { name: /next week/i });
|
|
234
|
+
await t.click(c);
|
|
235
|
+
const u = e.querySelector("date-navigation");
|
|
236
|
+
n(u).toHaveAttribute("data-state", "advancing");
|
|
237
|
+
}), a("should set retracting state when navigating backward", async () => {
|
|
238
|
+
const t = i.setup(), { container: e } = s(/* @__PURE__ */ o(l, {})), c = r.getByRole("button", { name: /next week/i });
|
|
239
|
+
await t.click(c), await h(() => {
|
|
240
|
+
const m = e.querySelectorAll(".date-navigation__date");
|
|
241
|
+
n(m[0].textContent).toContain("12");
|
|
242
|
+
});
|
|
243
|
+
const u = r.getByRole("button", { name: /current week/i });
|
|
244
|
+
await t.click(u);
|
|
245
|
+
const g = e.querySelector("date-navigation");
|
|
246
|
+
n(g).toHaveAttribute("data-state", "retracting");
|
|
247
|
+
});
|
|
248
|
+
}), d("Context Integration", () => {
|
|
249
|
+
a("should call setCurrentDate when day is selected", async () => {
|
|
250
|
+
const t = i.setup();
|
|
251
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
252
|
+
const e = r.getAllByRole("tab");
|
|
253
|
+
y.mockClear(), await t.click(e[2]), n(y).toHaveBeenCalledWith(/* @__PURE__ */ new Date("2026-01-07"));
|
|
254
|
+
}), a("should use weeks from context", () => {
|
|
255
|
+
const t = w();
|
|
256
|
+
b.spyOn(v, "useScheduleContext").mockReturnValue({
|
|
257
|
+
weeks: t,
|
|
258
|
+
setCurrentDate: y,
|
|
259
|
+
schedule: [],
|
|
260
|
+
currentDate: /* @__PURE__ */ new Date("2026-01-05"),
|
|
261
|
+
isLoading: !1,
|
|
262
|
+
isError: !1
|
|
263
|
+
});
|
|
264
|
+
const { container: e } = s(/* @__PURE__ */ o(l, {})), c = e.querySelectorAll(".date-navigation__date");
|
|
265
|
+
n(c[0].textContent).toContain("5");
|
|
266
|
+
}), a("should preserve day selection when switching weeks", async () => {
|
|
267
|
+
const t = i.setup();
|
|
268
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
269
|
+
const e = r.getAllByRole("tab");
|
|
270
|
+
await t.click(e[2]);
|
|
271
|
+
const c = r.getByRole("button", { name: /next week/i });
|
|
272
|
+
await t.click(c), await h(() => {
|
|
273
|
+
const u = r.getAllByRole("tab");
|
|
274
|
+
n(u[2]).toHaveAttribute("aria-selected", "true");
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
}), d("CSS Classes", () => {
|
|
278
|
+
a("should apply date-navigation class to list", () => {
|
|
279
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelector(".date-navigation__list");
|
|
280
|
+
n(e).toBeInTheDocument();
|
|
281
|
+
}), a("should apply date-navigation__item class to list items", () => {
|
|
282
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll(".date-navigation__item");
|
|
283
|
+
n(e).toHaveLength(7);
|
|
284
|
+
}), a("should apply date-navigation__control class to buttons", () => {
|
|
285
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll(".date-navigation__control");
|
|
286
|
+
n(e).toHaveLength(2);
|
|
287
|
+
}), a("should apply previous control class", () => {
|
|
288
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelector(".date-navigation__control--previous");
|
|
289
|
+
n(e).toBeInTheDocument();
|
|
290
|
+
}), a("should apply next control class", () => {
|
|
291
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelector(".date-navigation__control--next");
|
|
292
|
+
n(e).toBeInTheDocument();
|
|
293
|
+
}), a("should apply weekday class", () => {
|
|
294
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll(".date-navigation__weekday");
|
|
295
|
+
n(e).toHaveLength(7);
|
|
296
|
+
}), a("should apply date class", () => {
|
|
297
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll(".date-navigation__date");
|
|
298
|
+
n(e).toHaveLength(7);
|
|
299
|
+
}), a("should apply month-day-break class to br element", () => {
|
|
300
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll(".date-navigation__month-day-break");
|
|
301
|
+
n(e).toHaveLength(7);
|
|
302
|
+
});
|
|
303
|
+
}), d("Accessibility", () => {
|
|
304
|
+
a("should have proper ARIA roles", () => {
|
|
305
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
306
|
+
const t = r.getByRole("tablist"), e = r.getAllByRole("tab");
|
|
307
|
+
n(t).toBeInTheDocument(), n(e).toHaveLength(7);
|
|
308
|
+
}), a("should have aria-label on tablist", () => {
|
|
309
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
310
|
+
const t = r.getByRole("tablist", { name: "Date Tabs" });
|
|
311
|
+
n(t).toBeInTheDocument();
|
|
312
|
+
}), a("should have aria-selected on tabs", () => {
|
|
313
|
+
s(/* @__PURE__ */ o(l, {})), r.getAllByRole("tab").forEach((e) => {
|
|
314
|
+
n(e).toHaveAttribute("aria-selected");
|
|
315
|
+
});
|
|
316
|
+
}), a("should have aria-controls on tabs", () => {
|
|
317
|
+
s(/* @__PURE__ */ o(l, {})), r.getAllByRole("tab").forEach((e) => {
|
|
318
|
+
n(e).toHaveAttribute("aria-controls");
|
|
319
|
+
});
|
|
320
|
+
}), a("should have screen reader text for controls", () => {
|
|
321
|
+
s(/* @__PURE__ */ o(l, {})), n(r.getByText("Current Week")).toHaveClass("sr-only"), n(r.getByText("Next Week")).toHaveClass("sr-only");
|
|
322
|
+
}), a("should have aria-hidden on control icons", () => {
|
|
323
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll('i[aria-hidden="true"]');
|
|
324
|
+
n(e).toHaveLength(2);
|
|
325
|
+
}), a('should have role="presentation" on list items', () => {
|
|
326
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {})), e = t.querySelectorAll('li[role="presentation"]');
|
|
327
|
+
n(e).toHaveLength(7);
|
|
328
|
+
});
|
|
329
|
+
}), d("Icons", () => {
|
|
330
|
+
a("should render ChevronLeft icon in previous button", () => {
|
|
331
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
332
|
+
const e = r.getByRole("button", { name: /current week/i }).querySelector("svg");
|
|
333
|
+
n(e).toBeInTheDocument();
|
|
334
|
+
}), a("should render ChevronRight icon in next button", () => {
|
|
335
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
336
|
+
const e = r.getByRole("button", { name: /next week/i }).querySelector("svg");
|
|
337
|
+
n(e).toBeInTheDocument();
|
|
338
|
+
}), a("should set icon size to 48x48", () => {
|
|
339
|
+
const { container: t } = s(/* @__PURE__ */ o(l, {}));
|
|
340
|
+
t.querySelectorAll("svg").forEach((c) => {
|
|
341
|
+
n(c).toHaveAttribute("height", "48"), n(c).toHaveAttribute("width", "48");
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
}), d("Edge Cases", () => {
|
|
345
|
+
a("should handle clicking same day multiple times", async () => {
|
|
346
|
+
const t = i.setup();
|
|
347
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
348
|
+
const e = r.getAllByRole("tab");
|
|
349
|
+
y.mockClear(), await t.click(e[0]), await t.click(e[0]), await t.click(e[0]), n(y).not.toHaveBeenCalled();
|
|
350
|
+
}), a("should handle rapid week navigation", async () => {
|
|
351
|
+
const t = i.setup(), { container: e } = s(/* @__PURE__ */ o(l, {})), c = r.getByRole("button", { name: /next week/i });
|
|
352
|
+
await t.click(c), await h(() => {
|
|
353
|
+
const u = e.querySelectorAll(".date-navigation__date");
|
|
354
|
+
n(u[0].textContent).toContain("12");
|
|
355
|
+
});
|
|
356
|
+
}), a("should handle empty weeks array gracefully", () => {
|
|
357
|
+
n(!0).toBe(!0);
|
|
358
|
+
}), a("should maintain selection across week changes", async () => {
|
|
359
|
+
const t = i.setup();
|
|
360
|
+
s(/* @__PURE__ */ o(l, {}));
|
|
361
|
+
const e = r.getAllByRole("tab");
|
|
362
|
+
await t.click(e[4]);
|
|
363
|
+
const c = r.getByRole("button", { name: /next week/i });
|
|
364
|
+
await t.click(c), await h(() => {
|
|
365
|
+
const u = r.getAllByRole("tab");
|
|
366
|
+
n(u[4]).toHaveAttribute("aria-selected", "true");
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
});
|
|
@@ -7,7 +7,7 @@ import m, { useLayoutEffect as ar, cloneElement as or, createRef as Oe, Componen
|
|
|
7
7
|
import { a as ye, b as ve } from "../../addMonths-FatsTLmU.mjs";
|
|
8
8
|
import { t as M, c as G, m as Lt, a as Ft, s as tt, d as nt, g as cn, b as $r, e as qr, h as xt, i as sr, j as jr, k as ir, l as lr, n as Xr, o as Jt, p as zr, w as _n, q as Gr, r as Pe, u as en, v as un, f as tn } from "../../format-YhWt2D8M.mjs";
|
|
9
9
|
import { s as Le, a as Zr } from "../../subMonths-BtMU5A9u.mjs";
|
|
10
|
-
import { r as Jr, R as ea } from "../../index-
|
|
10
|
+
import { r as Jr, R as ea } from "../../index-DzfYkULW.mjs";
|
|
11
11
|
import { Input as ta } from "../Input/Input.js";
|
|
12
12
|
function dn(r, a) {
|
|
13
13
|
const t = +M(r);
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { d as p, i as l, r, g as s, s as a } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import "../../index-BVxBrkZB.mjs";
|
|
4
|
+
import { DeviceAndPlatformLists as c } from "./DeviceAndPlatformLists.js";
|
|
5
|
+
const f = () => [
|
|
6
|
+
{
|
|
7
|
+
id: 1,
|
|
8
|
+
alt_text: "Device 1",
|
|
9
|
+
image_url: "/images/device1.png",
|
|
10
|
+
link: "https://example.com/device1",
|
|
11
|
+
target: "_blank"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 2,
|
|
15
|
+
alt_text: "Device 2",
|
|
16
|
+
image_url: "/images/device2.png",
|
|
17
|
+
link: "https://example.com/device2",
|
|
18
|
+
target: "_blank"
|
|
19
|
+
}
|
|
20
|
+
], m = (e) => {
|
|
21
|
+
const o = /* @__PURE__ */ new Map();
|
|
22
|
+
for (let t = 0; t < e; t++)
|
|
23
|
+
o.set(
|
|
24
|
+
{ name: `Platform ${t + 1}`, slug: `platform-${t + 1}` },
|
|
25
|
+
f()
|
|
26
|
+
);
|
|
27
|
+
return o;
|
|
28
|
+
};
|
|
29
|
+
p("DeviceAndPlatformLists", () => {
|
|
30
|
+
p("Basic Rendering", () => {
|
|
31
|
+
l("should render section element", () => {
|
|
32
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelector("section");
|
|
33
|
+
s(t).toBeInTheDocument();
|
|
34
|
+
}), l("should apply devices-platforms class", () => {
|
|
35
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelector(".devices-platforms");
|
|
36
|
+
s(t).toBeInTheDocument();
|
|
37
|
+
}), l("should render at least one column", () => {
|
|
38
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column");
|
|
39
|
+
s(t.length).toBeGreaterThanOrEqual(1);
|
|
40
|
+
});
|
|
41
|
+
}), p("Single Platform Resource", () => {
|
|
42
|
+
l("should render one platform with size 1", () => {
|
|
43
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column-item");
|
|
44
|
+
s(t).toHaveLength(1);
|
|
45
|
+
}), l("should display platform header text in lowercase", () => {
|
|
46
|
+
const e = /* @__PURE__ */ new Map();
|
|
47
|
+
e.set(
|
|
48
|
+
{ name: "Streaming Devices", slug: "streaming-devices" },
|
|
49
|
+
f()
|
|
50
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e })), s(a.getByText("streaming devices")).toBeInTheDocument();
|
|
51
|
+
}), l("should only render first column for single platform", () => {
|
|
52
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column");
|
|
53
|
+
s(t).toHaveLength(1);
|
|
54
|
+
}), l("should set first column to span full width (1/3) for single platform", () => {
|
|
55
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelector(".devices-platforms__column");
|
|
56
|
+
s(t).toHaveStyle({ gridColumn: "1/3" });
|
|
57
|
+
});
|
|
58
|
+
}), p("Multiple Platform Resources (< 4)", () => {
|
|
59
|
+
l("should render two platforms", () => {
|
|
60
|
+
const e = m(2), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column-item");
|
|
61
|
+
s(t).toHaveLength(2);
|
|
62
|
+
}), l("should render three platforms", () => {
|
|
63
|
+
const e = m(3), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column-item");
|
|
64
|
+
s(t).toHaveLength(3);
|
|
65
|
+
}), l("should only render first column for platforms < 4", () => {
|
|
66
|
+
const e = m(3), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column");
|
|
67
|
+
s(t).toHaveLength(1);
|
|
68
|
+
}), l("should set first column to span full width (1/3) for platforms < 4", () => {
|
|
69
|
+
const e = m(3), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelector(".devices-platforms__column");
|
|
70
|
+
s(t).toHaveStyle({ gridColumn: "1/3" });
|
|
71
|
+
});
|
|
72
|
+
}), p("Multiple Platform Resources (>= 4)", () => {
|
|
73
|
+
l("should render four platforms", () => {
|
|
74
|
+
const e = m(4), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column-item");
|
|
75
|
+
s(t).toHaveLength(4);
|
|
76
|
+
}), l("should render six platforms", () => {
|
|
77
|
+
const e = m(6), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column-item");
|
|
78
|
+
s(t).toHaveLength(6);
|
|
79
|
+
}), l("should render two columns for platforms >= 4", () => {
|
|
80
|
+
const e = m(4), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column");
|
|
81
|
+
s(t).toHaveLength(2);
|
|
82
|
+
}), l("should set first column to grid 1/2 for platforms >= 4", () => {
|
|
83
|
+
const e = m(4), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column");
|
|
84
|
+
s(t[0]).toHaveStyle({ gridColumn: "1/2" });
|
|
85
|
+
}), l("should set second column to grid 2/3 for platforms >= 4", () => {
|
|
86
|
+
const e = m(4), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column");
|
|
87
|
+
s(t[1]).toHaveStyle({ gridColumn: "2/3" });
|
|
88
|
+
}), l("should split 4 platforms evenly (2 per column)", () => {
|
|
89
|
+
const e = m(4), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column"), u = t[0].querySelectorAll(".devices-platforms__column-item"), i = t[1].querySelectorAll(".devices-platforms__column-item");
|
|
90
|
+
s(u).toHaveLength(2), s(i).toHaveLength(2);
|
|
91
|
+
}), l("should split 5 platforms (3 in first, 2 in second)", () => {
|
|
92
|
+
const e = m(5), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column"), u = t[0].querySelectorAll(".devices-platforms__column-item"), i = t[1].querySelectorAll(".devices-platforms__column-item");
|
|
93
|
+
s(u).toHaveLength(3), s(i).toHaveLength(2);
|
|
94
|
+
}), l("should split 6 platforms evenly (3 per column)", () => {
|
|
95
|
+
const e = m(6), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column"), u = t[0].querySelectorAll(".devices-platforms__column-item"), i = t[1].querySelectorAll(".devices-platforms__column-item");
|
|
96
|
+
s(u).toHaveLength(3), s(i).toHaveLength(3);
|
|
97
|
+
});
|
|
98
|
+
}), p("Video Platforms Special Case", () => {
|
|
99
|
+
l("should put video-platforms in first column alone when first", () => {
|
|
100
|
+
const e = /* @__PURE__ */ new Map();
|
|
101
|
+
e.set(
|
|
102
|
+
{ name: "Video Platforms", slug: "video-platforms" },
|
|
103
|
+
f()
|
|
104
|
+
), e.set(
|
|
105
|
+
{ name: "Platform 2", slug: "platform-2" },
|
|
106
|
+
f()
|
|
107
|
+
), e.set(
|
|
108
|
+
{ name: "Platform 3", slug: "platform-3" },
|
|
109
|
+
f()
|
|
110
|
+
), e.set(
|
|
111
|
+
{ name: "Platform 4", slug: "platform-4" },
|
|
112
|
+
f()
|
|
113
|
+
);
|
|
114
|
+
const { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column"), u = t[0].querySelectorAll(".devices-platforms__column-item"), i = t[1].querySelectorAll(".devices-platforms__column-item");
|
|
115
|
+
s(u).toHaveLength(1), s(i).toHaveLength(3), s(a.getByText("video platforms")).toBeInTheDocument();
|
|
116
|
+
}), l("should render video platforms header in lowercase", () => {
|
|
117
|
+
const e = /* @__PURE__ */ new Map();
|
|
118
|
+
e.set(
|
|
119
|
+
{ name: "Video Platforms", slug: "video-platforms" },
|
|
120
|
+
f()
|
|
121
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e })), s(a.getByText("video platforms")).toBeInTheDocument();
|
|
122
|
+
});
|
|
123
|
+
}), p("GridList Rendering", () => {
|
|
124
|
+
l("should render GridList for each platform", () => {
|
|
125
|
+
const e = m(2), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll('[class*="grid-list"]');
|
|
126
|
+
s(t.length).toBeGreaterThanOrEqual(2);
|
|
127
|
+
}), l("should pass headerText prop to GridList", () => {
|
|
128
|
+
const e = /* @__PURE__ */ new Map();
|
|
129
|
+
e.set(
|
|
130
|
+
{ name: "Test Platform", slug: "test-platform" },
|
|
131
|
+
f()
|
|
132
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e })), s(a.getByText("test platform")).toBeInTheDocument();
|
|
133
|
+
}), l("should pass numberOfColumns prop to GridList when provided", () => {
|
|
134
|
+
const e = m(1);
|
|
135
|
+
r(/* @__PURE__ */ n(c, { numberOfColumns: 3, platformResources: e })), s(a.getByText("platform 1")).toBeInTheDocument();
|
|
136
|
+
}), l("should not pass numberOfColumns when not provided", () => {
|
|
137
|
+
const e = m(1);
|
|
138
|
+
r(/* @__PURE__ */ n(c, { platformResources: e })), s(a.getByText("platform 1")).toBeInTheDocument();
|
|
139
|
+
});
|
|
140
|
+
}), p("LogoListItem Rendering", () => {
|
|
141
|
+
l("should render LogoListItem components for each item", () => {
|
|
142
|
+
const e = /* @__PURE__ */ new Map();
|
|
143
|
+
e.set(
|
|
144
|
+
{ name: "Platform 1", slug: "platform-1" },
|
|
145
|
+
[
|
|
146
|
+
{
|
|
147
|
+
id: 1,
|
|
148
|
+
alt_text: "Logo 1",
|
|
149
|
+
image_url: "/logo1.png",
|
|
150
|
+
link: "https://example.com/1",
|
|
151
|
+
target: "_blank"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: 2,
|
|
155
|
+
alt_text: "Logo 2",
|
|
156
|
+
image_url: "/logo2.png",
|
|
157
|
+
link: "https://example.com/2",
|
|
158
|
+
target: "_blank"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e })), s(a.getByAltText("Logo 1 logo")).toBeInTheDocument(), s(a.getByAltText("Logo 2 logo")).toBeInTheDocument();
|
|
162
|
+
}), l("should pass correct props to LogoListItem", () => {
|
|
163
|
+
const e = /* @__PURE__ */ new Map();
|
|
164
|
+
e.set(
|
|
165
|
+
{ name: "Platform 1", slug: "platform-1" },
|
|
166
|
+
[
|
|
167
|
+
{
|
|
168
|
+
id: 1,
|
|
169
|
+
alt_text: "Test Logo",
|
|
170
|
+
image_url: "/test-logo.png",
|
|
171
|
+
link: "https://example.com/test",
|
|
172
|
+
target: "_blank"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e }));
|
|
176
|
+
const o = a.getByAltText("Test Logo logo");
|
|
177
|
+
s(o).toHaveAttribute("src", "/test-logo.png");
|
|
178
|
+
const t = o.closest("a");
|
|
179
|
+
s(t).toHaveAttribute("href", "https://example.com/test"), s(t).toHaveAttribute("target", "_blank");
|
|
180
|
+
}), l("should default target to _blank when not provided", () => {
|
|
181
|
+
const e = /* @__PURE__ */ new Map();
|
|
182
|
+
e.set(
|
|
183
|
+
{ name: "Platform 1", slug: "platform-1" },
|
|
184
|
+
[
|
|
185
|
+
{
|
|
186
|
+
id: 1,
|
|
187
|
+
alt_text: "Test Logo",
|
|
188
|
+
image_url: "/test-logo.png",
|
|
189
|
+
link: "https://example.com/test"
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e }));
|
|
193
|
+
const t = a.getByAltText("Test Logo logo").closest("a");
|
|
194
|
+
s(t).toHaveAttribute("target", "_blank");
|
|
195
|
+
}), l("should use custom target when provided", () => {
|
|
196
|
+
const e = /* @__PURE__ */ new Map();
|
|
197
|
+
e.set(
|
|
198
|
+
{ name: "Platform 1", slug: "platform-1" },
|
|
199
|
+
[
|
|
200
|
+
{
|
|
201
|
+
id: 1,
|
|
202
|
+
alt_text: "Test Logo",
|
|
203
|
+
image_url: "/test-logo.png",
|
|
204
|
+
link: "https://example.com/test",
|
|
205
|
+
target: "_self"
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e }));
|
|
209
|
+
const t = a.getByAltText("Test Logo logo").closest("a");
|
|
210
|
+
s(t).toHaveAttribute("target", "_self");
|
|
211
|
+
}), l("should generate unique keys for LogoListItem components", () => {
|
|
212
|
+
const e = /* @__PURE__ */ new Map();
|
|
213
|
+
e.set(
|
|
214
|
+
{ name: "Platform 1", slug: "platform-1" },
|
|
215
|
+
[
|
|
216
|
+
{ id: "unique-1", alt_text: "Logo 1", image_url: "/1.png", link: "https://example.com/1" },
|
|
217
|
+
{ id: "unique-2", alt_text: "Logo 2", image_url: "/2.png", link: "https://example.com/2" },
|
|
218
|
+
{ id: 123, alt_text: "Logo 3", image_url: "/3.png", link: "https://example.com/3" }
|
|
219
|
+
]
|
|
220
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e })), s(a.getByAltText("Logo 1 logo")).toBeInTheDocument(), s(a.getByAltText("Logo 2 logo")).toBeInTheDocument(), s(a.getByAltText("Logo 3 logo")).toBeInTheDocument();
|
|
221
|
+
});
|
|
222
|
+
}), p("CSS Classes", () => {
|
|
223
|
+
l("should apply devices-platforms class to section", () => {
|
|
224
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelector(".devices-platforms");
|
|
225
|
+
s(t).toBeInTheDocument();
|
|
226
|
+
}), l("should apply devices-platforms__column class", () => {
|
|
227
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelector(".devices-platforms__column");
|
|
228
|
+
s(t).toBeInTheDocument();
|
|
229
|
+
}), l("should apply devices-platforms__column-item class", () => {
|
|
230
|
+
const e = m(1), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelector(".devices-platforms__column-item");
|
|
231
|
+
s(t).toBeInTheDocument();
|
|
232
|
+
});
|
|
233
|
+
}), p("Edge Cases", () => {
|
|
234
|
+
l("should handle empty Map", () => {
|
|
235
|
+
s(!0).toBe(!0);
|
|
236
|
+
}), l("should handle platform with empty items array", () => {
|
|
237
|
+
const e = /* @__PURE__ */ new Map();
|
|
238
|
+
e.set(
|
|
239
|
+
{ name: "Empty Platform", slug: "empty-platform" },
|
|
240
|
+
[]
|
|
241
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e })), s(a.getByText("empty platform")).toBeInTheDocument();
|
|
242
|
+
}), l("should handle large number of platforms", () => {
|
|
243
|
+
const e = m(10), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column-item");
|
|
244
|
+
s(t).toHaveLength(10);
|
|
245
|
+
}), l("should handle mixed string and number IDs", () => {
|
|
246
|
+
const e = /* @__PURE__ */ new Map();
|
|
247
|
+
e.set(
|
|
248
|
+
{ name: "Platform 1", slug: "platform-1" },
|
|
249
|
+
[
|
|
250
|
+
{ id: "string-id-1", alt_text: "Logo 1", image_url: "/1.png", link: "https://example.com/1" },
|
|
251
|
+
{ id: 999, alt_text: "Logo 2", image_url: "/2.png", link: "https://example.com/2" }
|
|
252
|
+
]
|
|
253
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e })), s(a.getByAltText("Logo 1 logo")).toBeInTheDocument(), s(a.getByAltText("Logo 2 logo")).toBeInTheDocument();
|
|
254
|
+
}), l("should preserve platform order in Map", () => {
|
|
255
|
+
const e = /* @__PURE__ */ new Map();
|
|
256
|
+
e.set({ name: "First", slug: "first" }, f()), e.set({ name: "Second", slug: "second" }, f()), e.set({ name: "Third", slug: "third" }, f());
|
|
257
|
+
const { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column-item");
|
|
258
|
+
s(t[0].textContent).toContain("first"), s(t[1].textContent).toContain("second"), s(t[2].textContent).toContain("third");
|
|
259
|
+
}), l("should handle numberOfColumns as 0", () => {
|
|
260
|
+
const e = m(1);
|
|
261
|
+
r(/* @__PURE__ */ n(c, { numberOfColumns: 0, platformResources: e })), s(a.getByText("platform 1")).toBeInTheDocument();
|
|
262
|
+
}), l("should handle all possible target values", () => {
|
|
263
|
+
const e = /* @__PURE__ */ new Map();
|
|
264
|
+
e.set(
|
|
265
|
+
{ name: "Platform 1", slug: "platform-1" },
|
|
266
|
+
[
|
|
267
|
+
{ id: 1, alt_text: "Logo 1", image_url: "/1.png", link: "#", target: "_blank" },
|
|
268
|
+
{ id: 2, alt_text: "Logo 2", image_url: "/2.png", link: "#", target: "_self" },
|
|
269
|
+
{ id: 3, alt_text: "Logo 3", image_url: "/3.png", link: "#", target: "_parent" },
|
|
270
|
+
{ id: 4, alt_text: "Logo 4", image_url: "/4.png", link: "#", target: "_top" }
|
|
271
|
+
]
|
|
272
|
+
), r(/* @__PURE__ */ n(c, { platformResources: e }));
|
|
273
|
+
const o = a.getByAltText("Logo 1 logo").closest("a"), t = a.getByAltText("Logo 2 logo").closest("a"), u = a.getByAltText("Logo 3 logo").closest("a"), i = a.getByAltText("Logo 4 logo").closest("a");
|
|
274
|
+
s(o).toHaveAttribute("target", "_blank"), s(t).toHaveAttribute("target", "_self"), s(u).toHaveAttribute("target", "_parent"), s(i).toHaveAttribute("target", "_top");
|
|
275
|
+
});
|
|
276
|
+
}), p("Column Distribution", () => {
|
|
277
|
+
l("should calculate firstColumnTotal correctly for size 7", () => {
|
|
278
|
+
const e = m(7), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column"), u = t[0].querySelectorAll(".devices-platforms__column-item"), i = t[1].querySelectorAll(".devices-platforms__column-item");
|
|
279
|
+
s(u).toHaveLength(4), s(i).toHaveLength(3);
|
|
280
|
+
}), l("should calculate firstColumnTotal correctly for size 8", () => {
|
|
281
|
+
const e = m(8), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column"), u = t[0].querySelectorAll(".devices-platforms__column-item"), i = t[1].querySelectorAll(".devices-platforms__column-item");
|
|
282
|
+
s(u).toHaveLength(4), s(i).toHaveLength(4);
|
|
283
|
+
}), l("should calculate firstColumnTotal correctly for size 9", () => {
|
|
284
|
+
const e = m(9), { container: o } = r(/* @__PURE__ */ n(c, { platformResources: e })), t = o.querySelectorAll(".devices-platforms__column"), u = t[0].querySelectorAll(".devices-platforms__column-item"), i = t[1].querySelectorAll(".devices-platforms__column-item");
|
|
285
|
+
s(u).toHaveLength(5), s(i).toHaveLength(4);
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
});
|