@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,295 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { v as l, d, b as h, a as I, i as a, r as c, g as r, f as u, w as y } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import "../../index-BVxBrkZB.mjs";
|
|
4
|
+
import { BCVideoPlayer as n } from "./BCVideoPlayer.js";
|
|
5
|
+
const w = {
|
|
6
|
+
play: l.fn().mockResolvedValue(void 0),
|
|
7
|
+
pause: l.fn(),
|
|
8
|
+
muted: l.fn(),
|
|
9
|
+
dispose: l.fn(),
|
|
10
|
+
on: l.fn()
|
|
11
|
+
};
|
|
12
|
+
d("BCVideoPlayer", () => {
|
|
13
|
+
h(() => {
|
|
14
|
+
l.clearAllMocks(), window.bc = l.fn(() => w), document.querySelectorAll("#video-js-script").forEach((e) => e.remove());
|
|
15
|
+
}), I(() => {
|
|
16
|
+
document.querySelectorAll("#video-js-script").forEach((e) => e.remove()), delete window.bc;
|
|
17
|
+
}), d("Basic Rendering", () => {
|
|
18
|
+
a("should render with valid bcId", () => {
|
|
19
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
20
|
+
r(o).toBeInTheDocument();
|
|
21
|
+
}), a("should render wrapper with correct id", () => {
|
|
22
|
+
c(/* @__PURE__ */ t(n, { bcId: "123456" }));
|
|
23
|
+
const e = document.getElementById("video-player-wrapper");
|
|
24
|
+
r(e).toHaveAttribute("id", "video-player-wrapper");
|
|
25
|
+
}), a("should render wrapper with correct class", () => {
|
|
26
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
27
|
+
r(o).toHaveClass("video-player__wrapper");
|
|
28
|
+
}), a("should set key attribute to bcId", () => {
|
|
29
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "video-123" })), o = e.querySelector(".video-player__wrapper");
|
|
30
|
+
r(o).toBeInTheDocument();
|
|
31
|
+
});
|
|
32
|
+
}), d("Null/Empty bcId Handling", () => {
|
|
33
|
+
a("should return null when bcId is null", () => {
|
|
34
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: null }));
|
|
35
|
+
r(e.firstChild).toBeNull();
|
|
36
|
+
}), a("should return null when bcId is undefined", () => {
|
|
37
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: void 0 }));
|
|
38
|
+
r(e.firstChild).toBeNull();
|
|
39
|
+
}), a("should return null when bcId is empty string", () => {
|
|
40
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "" }));
|
|
41
|
+
r(e.firstChild).toBeNull();
|
|
42
|
+
}), a("should render when bcId is valid string", () => {
|
|
43
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "valid-id" })), o = e.querySelector(".video-player__wrapper");
|
|
44
|
+
r(o).toBeInTheDocument();
|
|
45
|
+
});
|
|
46
|
+
}), d("Default Props", () => {
|
|
47
|
+
a("should use default playerElId of bc-player", () => {
|
|
48
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
49
|
+
r(o).toBeInTheDocument();
|
|
50
|
+
}), a("should use default containerClosing of false", () => {
|
|
51
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
52
|
+
r(o).toBeInTheDocument();
|
|
53
|
+
}), a("should use default autoplay of false", () => {
|
|
54
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
55
|
+
r(o).toBeInTheDocument();
|
|
56
|
+
}), a("should use default mute of false", () => {
|
|
57
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
58
|
+
r(o).toBeInTheDocument();
|
|
59
|
+
}), a("should use default pauseVideo of false", () => {
|
|
60
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
61
|
+
r(o).toBeInTheDocument();
|
|
62
|
+
}), a("should use default empty string for BC_AID", () => {
|
|
63
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
64
|
+
r(o).toBeInTheDocument();
|
|
65
|
+
}), a("should use default empty string for BC_PLAYERID", () => {
|
|
66
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
67
|
+
r(o).toBeInTheDocument();
|
|
68
|
+
}), a("should use default empty string for BC_EMBEDID", () => {
|
|
69
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
70
|
+
r(o).toBeInTheDocument();
|
|
71
|
+
});
|
|
72
|
+
}), d("Custom Props", () => {
|
|
73
|
+
a("should accept custom playerElId", () => {
|
|
74
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456", playerElId: "custom-player" })), o = e.querySelector(".video-player__wrapper");
|
|
75
|
+
r(o).toBeInTheDocument();
|
|
76
|
+
}), a("should accept containerClosing prop", () => {
|
|
77
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { containerClosing: !0, bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
78
|
+
r(o).toBeInTheDocument();
|
|
79
|
+
}), a("should accept autoplay prop", () => {
|
|
80
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { autoplay: !0, bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
81
|
+
r(o).toBeInTheDocument();
|
|
82
|
+
}), a("should accept mute prop", () => {
|
|
83
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { mute: !0, bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
84
|
+
r(o).toBeInTheDocument();
|
|
85
|
+
}), a("should accept pauseVideo prop", () => {
|
|
86
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { pauseVideo: !0, bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
87
|
+
r(o).toBeInTheDocument();
|
|
88
|
+
}), a("should accept BC_AID prop", () => {
|
|
89
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { BC_AID: "account123", bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
90
|
+
r(o).toBeInTheDocument();
|
|
91
|
+
}), a("should accept BC_PLAYERID prop", () => {
|
|
92
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { BC_PLAYERID: "player456", bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
93
|
+
r(o).toBeInTheDocument();
|
|
94
|
+
}), a("should accept BC_EMBEDID prop", () => {
|
|
95
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { BC_EMBEDID: "embed789", bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
96
|
+
r(o).toBeInTheDocument();
|
|
97
|
+
});
|
|
98
|
+
}), d("Keyboard Event Handlers", () => {
|
|
99
|
+
a("should call handleClosing when Escape key is pressed", () => {
|
|
100
|
+
const e = l.fn(), { container: o } = c(
|
|
101
|
+
/* @__PURE__ */ t(n, { bcId: "123456", handleClosing: e })
|
|
102
|
+
), p = o.querySelector(".video-player__wrapper");
|
|
103
|
+
u.keyUp(p, { key: "Escape" }), r(e).toHaveBeenCalledTimes(1);
|
|
104
|
+
}), a("should not call handleClosing when other keys are pressed", () => {
|
|
105
|
+
const e = l.fn(), { container: o } = c(
|
|
106
|
+
/* @__PURE__ */ t(n, { bcId: "123456", handleClosing: e })
|
|
107
|
+
), p = o.querySelector(".video-player__wrapper");
|
|
108
|
+
u.keyUp(p, { key: "Enter" }), r(e).not.toHaveBeenCalled();
|
|
109
|
+
}), a("should preventDefault on Escape keyUp", () => {
|
|
110
|
+
const e = l.fn(), { container: o } = c(
|
|
111
|
+
/* @__PURE__ */ t(n, { bcId: "123456", handleClosing: e })
|
|
112
|
+
), p = o.querySelector(".video-player__wrapper"), s = new KeyboardEvent("keyup", { key: "Escape", bubbles: !0, cancelable: !0 }), i = l.spyOn(s, "preventDefault");
|
|
113
|
+
p.dispatchEvent(s), r(i).toHaveBeenCalled();
|
|
114
|
+
}), a("should stopPropagation on Escape keyDown", () => {
|
|
115
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper"), p = new KeyboardEvent("keydown", { key: "Escape", bubbles: !0, cancelable: !0 }), s = l.spyOn(p, "stopPropagation"), i = l.spyOn(p, "preventDefault");
|
|
116
|
+
o.dispatchEvent(p), r(s).toHaveBeenCalled(), r(i).toHaveBeenCalled();
|
|
117
|
+
}), a("should not stop propagation for non-Escape keys on keyDown", () => {
|
|
118
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
119
|
+
u.keyDown(o, { key: "Enter" }), r(o).toBeInTheDocument();
|
|
120
|
+
});
|
|
121
|
+
}), d("handleClosing Default Behavior", () => {
|
|
122
|
+
a("should use default handleClosing that returns true", () => {
|
|
123
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
124
|
+
u.keyUp(o, { key: "Escape" }), r(o).toBeInTheDocument();
|
|
125
|
+
}), a("should accept custom handleClosing function", () => {
|
|
126
|
+
const e = l.fn(), { container: o } = c(
|
|
127
|
+
/* @__PURE__ */ t(n, { bcId: "123456", handleClosing: e })
|
|
128
|
+
), p = o.querySelector(".video-player__wrapper");
|
|
129
|
+
u.keyUp(p, { key: "Escape" }), r(e).toHaveBeenCalled();
|
|
130
|
+
});
|
|
131
|
+
}), d("Script Loading", () => {
|
|
132
|
+
a("should add script element to document body", async () => {
|
|
133
|
+
c(
|
|
134
|
+
/* @__PURE__ */ t(
|
|
135
|
+
n,
|
|
136
|
+
{
|
|
137
|
+
BC_AID: "account123",
|
|
138
|
+
BC_EMBEDID: "default",
|
|
139
|
+
BC_PLAYERID: "player456",
|
|
140
|
+
bcId: "123456"
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
), await y(() => {
|
|
144
|
+
const e = document.querySelector("#video-js-script");
|
|
145
|
+
r(e).toBeInTheDocument();
|
|
146
|
+
}, { timeout: 200 });
|
|
147
|
+
}), a("should set correct script src with account and player IDs", async () => {
|
|
148
|
+
c(
|
|
149
|
+
/* @__PURE__ */ t(
|
|
150
|
+
n,
|
|
151
|
+
{
|
|
152
|
+
BC_AID: "acc123",
|
|
153
|
+
BC_EMBEDID: "default",
|
|
154
|
+
BC_PLAYERID: "play456",
|
|
155
|
+
bcId: "video789"
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
), await y(() => {
|
|
159
|
+
const e = document.querySelector("#video-js-script");
|
|
160
|
+
r(e == null ? void 0 : e.src).toContain("acc123"), r(e == null ? void 0 : e.src).toContain("play456");
|
|
161
|
+
}, { timeout: 200 });
|
|
162
|
+
}), a("should set script id to video-js-script", async () => {
|
|
163
|
+
c(
|
|
164
|
+
/* @__PURE__ */ t(
|
|
165
|
+
n,
|
|
166
|
+
{
|
|
167
|
+
BC_AID: "account",
|
|
168
|
+
BC_EMBEDID: "default",
|
|
169
|
+
BC_PLAYERID: "player",
|
|
170
|
+
bcId: "123"
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
), await y(() => {
|
|
174
|
+
const e = document.querySelector("#video-js-script");
|
|
175
|
+
r(e).toHaveAttribute("id", "video-js-script");
|
|
176
|
+
}, { timeout: 200 });
|
|
177
|
+
});
|
|
178
|
+
}), d("Edge Cases", () => {
|
|
179
|
+
a("should handle bcId with special characters", () => {
|
|
180
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "video-123-abc_def" })), o = e.querySelector(".video-player__wrapper");
|
|
181
|
+
r(o).toBeInTheDocument();
|
|
182
|
+
}), a("should handle very long bcId", () => {
|
|
183
|
+
const e = "a".repeat(100), { container: o } = c(/* @__PURE__ */ t(n, { bcId: e })), p = o.querySelector(".video-player__wrapper");
|
|
184
|
+
r(p).toBeInTheDocument();
|
|
185
|
+
}), a("should handle numeric bcId", () => {
|
|
186
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456789" })), o = e.querySelector(".video-player__wrapper");
|
|
187
|
+
r(o).toBeInTheDocument();
|
|
188
|
+
}), a("should handle bcId with spaces", () => {
|
|
189
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "video 123" })), o = e.querySelector(".video-player__wrapper");
|
|
190
|
+
r(o).toBeInTheDocument();
|
|
191
|
+
});
|
|
192
|
+
}), d("Component Updates", () => {
|
|
193
|
+
a("should handle bcId changes", () => {
|
|
194
|
+
const { rerender: e, container: o } = c(/* @__PURE__ */ t(n, { bcId: "video1" }));
|
|
195
|
+
let p = o.querySelector(".video-player__wrapper");
|
|
196
|
+
r(p).toBeInTheDocument(), e(/* @__PURE__ */ t(n, { bcId: "video2" })), p = o.querySelector(".video-player__wrapper"), r(p).toBeInTheDocument();
|
|
197
|
+
}), a("should unmount when bcId becomes empty", () => {
|
|
198
|
+
const { rerender: e, container: o } = c(/* @__PURE__ */ t(n, { bcId: "video1" }));
|
|
199
|
+
let p = o.querySelector(".video-player__wrapper");
|
|
200
|
+
r(p).toBeInTheDocument(), e(/* @__PURE__ */ t(n, { bcId: "" })), p = o.querySelector(".video-player__wrapper"), r(p).not.toBeInTheDocument();
|
|
201
|
+
}), a("should remount when bcId changes from empty to valid", () => {
|
|
202
|
+
const { rerender: e, container: o } = c(/* @__PURE__ */ t(n, { bcId: "" }));
|
|
203
|
+
let p = o.querySelector(".video-player__wrapper");
|
|
204
|
+
r(p).not.toBeInTheDocument(), e(/* @__PURE__ */ t(n, { bcId: "video1" })), p = o.querySelector(".video-player__wrapper"), r(p).toBeInTheDocument();
|
|
205
|
+
});
|
|
206
|
+
}), d("Integration Tests", () => {
|
|
207
|
+
a("should render with all props provided", () => {
|
|
208
|
+
const e = l.fn(), { container: o } = c(
|
|
209
|
+
/* @__PURE__ */ t(
|
|
210
|
+
n,
|
|
211
|
+
{
|
|
212
|
+
autoplay: !0,
|
|
213
|
+
mute: !0,
|
|
214
|
+
BC_AID: "account123",
|
|
215
|
+
BC_EMBEDID: "embed789",
|
|
216
|
+
BC_PLAYERID: "player456",
|
|
217
|
+
bcId: "video123",
|
|
218
|
+
containerClosing: !1,
|
|
219
|
+
handleClosing: e,
|
|
220
|
+
pauseVideo: !1,
|
|
221
|
+
playerElId: "custom-player"
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
), p = o.querySelector(".video-player__wrapper");
|
|
225
|
+
r(p).toBeInTheDocument(), r(p).toHaveAttribute("id", "video-player-wrapper");
|
|
226
|
+
}), a("should handle keyboard events with all props", () => {
|
|
227
|
+
const e = l.fn(), { container: o } = c(
|
|
228
|
+
/* @__PURE__ */ t(
|
|
229
|
+
n,
|
|
230
|
+
{
|
|
231
|
+
autoplay: !0,
|
|
232
|
+
mute: !0,
|
|
233
|
+
BC_AID: "account",
|
|
234
|
+
BC_EMBEDID: "embed",
|
|
235
|
+
BC_PLAYERID: "player",
|
|
236
|
+
bcId: "video",
|
|
237
|
+
handleClosing: e
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
), p = o.querySelector(".video-player__wrapper");
|
|
241
|
+
u.keyUp(p, { key: "Escape" }), r(e).toHaveBeenCalledTimes(1);
|
|
242
|
+
});
|
|
243
|
+
}), d("Ref Handling", () => {
|
|
244
|
+
a("should create wrapper ref", () => {
|
|
245
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123456" })), o = e.querySelector(".video-player__wrapper");
|
|
246
|
+
r(o).toBeInTheDocument();
|
|
247
|
+
}), a("should maintain ref across rerenders", () => {
|
|
248
|
+
const { rerender: e, container: o } = c(/* @__PURE__ */ t(n, { bcId: "video1" })), p = o.querySelector(".video-player__wrapper");
|
|
249
|
+
r(p).toBeInTheDocument(), e(/* @__PURE__ */ t(n, { autoplay: !0, bcId: "video1" }));
|
|
250
|
+
const s = o.querySelector(".video-player__wrapper");
|
|
251
|
+
r(s).toBeInTheDocument();
|
|
252
|
+
});
|
|
253
|
+
}), d("Boolean Props", () => {
|
|
254
|
+
a("should handle autoplay true", () => {
|
|
255
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { autoplay: !0, bcId: "123" }));
|
|
256
|
+
r(e.querySelector(".video-player__wrapper")).toBeInTheDocument();
|
|
257
|
+
}), a("should handle autoplay false", () => {
|
|
258
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { autoplay: !1, bcId: "123" }));
|
|
259
|
+
r(e.querySelector(".video-player__wrapper")).toBeInTheDocument();
|
|
260
|
+
}), a("should handle mute true", () => {
|
|
261
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { mute: !0, bcId: "123" }));
|
|
262
|
+
r(e.querySelector(".video-player__wrapper")).toBeInTheDocument();
|
|
263
|
+
}), a("should handle mute false", () => {
|
|
264
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123", mute: !1 }));
|
|
265
|
+
r(e.querySelector(".video-player__wrapper")).toBeInTheDocument();
|
|
266
|
+
}), a("should handle pauseVideo true", () => {
|
|
267
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { pauseVideo: !0, bcId: "123" }));
|
|
268
|
+
r(e.querySelector(".video-player__wrapper")).toBeInTheDocument();
|
|
269
|
+
}), a("should handle pauseVideo false", () => {
|
|
270
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123", pauseVideo: !1 }));
|
|
271
|
+
r(e.querySelector(".video-player__wrapper")).toBeInTheDocument();
|
|
272
|
+
}), a("should handle containerClosing true", () => {
|
|
273
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { containerClosing: !0, bcId: "123" }));
|
|
274
|
+
r(e.querySelector(".video-player__wrapper")).toBeInTheDocument();
|
|
275
|
+
}), a("should handle containerClosing false", () => {
|
|
276
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "123", containerClosing: !1 }));
|
|
277
|
+
r(e.querySelector(".video-player__wrapper")).toBeInTheDocument();
|
|
278
|
+
});
|
|
279
|
+
}), d("Conditional Rendering", () => {
|
|
280
|
+
a("should render wrapper when bcId is valid", () => {
|
|
281
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "valid-id" })), o = e.querySelector(".video-player__wrapper");
|
|
282
|
+
r(o).toBeInTheDocument();
|
|
283
|
+
}), a("should not render wrapper when bcId is invalid", () => {
|
|
284
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "" })), o = e.querySelector(".video-player__wrapper");
|
|
285
|
+
r(o).not.toBeInTheDocument();
|
|
286
|
+
}), a("should return null element when bcId is empty", () => {
|
|
287
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "" }));
|
|
288
|
+
r(e.firstChild).toBeNull();
|
|
289
|
+
}), a("should return div element when bcId is valid", () => {
|
|
290
|
+
var o;
|
|
291
|
+
const { container: e } = c(/* @__PURE__ */ t(n, { bcId: "valid" }));
|
|
292
|
+
r(e.firstChild).not.toBeNull(), r((o = e.firstChild) == null ? void 0 : o.nodeName).toBe("DIV");
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as p, Fragment as j, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { classes as
|
|
4
|
-
import { blockLayoutsMap as
|
|
5
|
-
import { EqualSizeGrid as
|
|
6
|
-
import { InfoPanel as
|
|
7
|
-
import '../../assets/BasicGridModule.css';function
|
|
8
|
-
gap:
|
|
2
|
+
import { useState as a, useRef as y, useCallback as F, useEffect as b, createElement as O } from "react";
|
|
3
|
+
import { classes as _ } from "../../utils/helpers.js";
|
|
4
|
+
import { blockLayoutsMap as q } from "../../settings.js";
|
|
5
|
+
import { EqualSizeGrid as z } from "../EqualSizeGrid/EqualSizeGrid.js";
|
|
6
|
+
import { InfoPanel as A } from "../InfoPanel/InfoPanel.js";
|
|
7
|
+
import '../../assets/BasicGridModule.css';function Q({
|
|
8
|
+
gap: L = "1.5rem",
|
|
9
9
|
itemsPerRow: k = 4,
|
|
10
|
-
classname:
|
|
10
|
+
classname: E = "",
|
|
11
11
|
title: d = "",
|
|
12
12
|
itemComponent: s = {
|
|
13
13
|
layout: "ImageCard",
|
|
@@ -15,45 +15,49 @@ import '../../assets/BasicGridModule.css';function K({
|
|
|
15
15
|
fullCardClickable: !1
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
infoPanelComponent:
|
|
18
|
+
infoPanelComponent: n = {
|
|
19
19
|
layout: "",
|
|
20
20
|
backButtonLabel: "Return to List",
|
|
21
21
|
resourceList: [],
|
|
22
22
|
classname: ""
|
|
23
23
|
},
|
|
24
|
-
items:
|
|
24
|
+
items: v = [],
|
|
25
25
|
customClicksHandler: I = null,
|
|
26
|
-
noAnimation:
|
|
26
|
+
noAnimation: x = !1
|
|
27
27
|
}) {
|
|
28
|
-
const [
|
|
28
|
+
const [i, f] = a(!1), [C, R] = a({}), [m, B] = a(void 0), [M, c] = a("entering"), [N, G] = a(x ? null : !0), o = y("entering"), e = y(null), r = F(() => {
|
|
29
29
|
e.current !== null && e.current.children[0].addEventListener("animationstart", () => {
|
|
30
|
-
e.current !== null && e.current.children[0].addEventListener("animationend",
|
|
30
|
+
e.current !== null && e.current.children[0].addEventListener("animationend", r, { once: !0 });
|
|
31
31
|
}), o.current === "exiting" ? (c("entering"), o.current = "entering", f(!0)) : c("idle");
|
|
32
32
|
}, []), S = (t) => {
|
|
33
|
-
t.type === "info-panel" && (
|
|
33
|
+
t.type === "info-panel" && (R(n.resourceList.find((l) => Number.parseInt(l.id, 10) === Number.parseInt(t.resourceId, 10)) ?? {}), G(!1), o.current = "exiting", c("exiting"));
|
|
34
34
|
};
|
|
35
|
-
return
|
|
36
|
-
B(
|
|
37
|
-
}, [s.layout]),
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
return b(() => {
|
|
36
|
+
B(q.get(s.layout));
|
|
37
|
+
}, [s.layout]), b(() => {
|
|
38
|
+
var l, h;
|
|
39
|
+
const t = e.current;
|
|
40
|
+
return !i && e.current !== null && e.current.children.length && ((l = e.current.children[0]) == null || l.removeEventListener("animationend", r), (h = e.current.children[0]) == null || h.addEventListener("animationend", r, { once: !0 })), () => {
|
|
41
|
+
var g;
|
|
42
|
+
t !== null && t.children.length && ((g = t.children[0]) == null || g.removeEventListener("animationend", r));
|
|
43
|
+
};
|
|
44
|
+
}, [i, r]), /* @__PURE__ */ p(j, { children: [
|
|
45
|
+
!i && /* @__PURE__ */ p(
|
|
42
46
|
"basic-grid-module",
|
|
43
47
|
{
|
|
44
|
-
"data-state":
|
|
45
|
-
"first-entry":
|
|
48
|
+
"data-state": M,
|
|
49
|
+
"first-entry": N,
|
|
46
50
|
ref: e,
|
|
47
51
|
children: [
|
|
48
|
-
d !== "" && /* @__PURE__ */ u("h2", { className:
|
|
52
|
+
d !== "" && /* @__PURE__ */ u("h2", { className: _(["basic-grid-module__header", "h4"]), children: d }),
|
|
49
53
|
m !== void 0 && /* @__PURE__ */ u(
|
|
50
|
-
|
|
54
|
+
z,
|
|
51
55
|
{
|
|
52
|
-
classname:
|
|
53
|
-
gap:
|
|
56
|
+
classname: E,
|
|
57
|
+
gap: L,
|
|
54
58
|
itemsPerRow: k,
|
|
55
|
-
children:
|
|
56
|
-
(t) => /* @__PURE__ */
|
|
59
|
+
children: v.map(
|
|
60
|
+
(t) => /* @__PURE__ */ O(
|
|
57
61
|
m,
|
|
58
62
|
{
|
|
59
63
|
...t,
|
|
@@ -69,16 +73,16 @@ import '../../assets/BasicGridModule.css';function K({
|
|
|
69
73
|
]
|
|
70
74
|
}
|
|
71
75
|
),
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
i && n.layout && /* @__PURE__ */ u(
|
|
77
|
+
A,
|
|
74
78
|
{
|
|
75
|
-
backButtonLabel:
|
|
79
|
+
backButtonLabel: n.backButtonLabel,
|
|
76
80
|
className: "grid-info-panel",
|
|
77
|
-
classname:
|
|
81
|
+
classname: n.classname,
|
|
78
82
|
layoutComponent: {
|
|
79
|
-
layout:
|
|
83
|
+
layout: n.layout,
|
|
80
84
|
props: {
|
|
81
|
-
...
|
|
85
|
+
...C
|
|
82
86
|
}
|
|
83
87
|
},
|
|
84
88
|
onBackClicked: () => {
|
|
@@ -89,6 +93,6 @@ import '../../assets/BasicGridModule.css';function K({
|
|
|
89
93
|
] });
|
|
90
94
|
}
|
|
91
95
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
Q as BasicGridModule,
|
|
97
|
+
Q as default
|
|
94
98
|
};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { jsx as n, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { v as a, d as c, b as h, i as r, r as i, g as o, s as l } from "../../react.esm-DLSrfVwM.mjs";
|
|
3
|
+
import "../../index-BVxBrkZB.mjs";
|
|
4
|
+
import { BasicGridModule as s } from "./BasicGridModule.js";
|
|
5
|
+
a.mock("../EqualSizeGrid/index.ts", () => ({
|
|
6
|
+
default: ({ children: e, classname: t, gap: d, itemsPerRow: u }) => /* @__PURE__ */ n(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
"data-testid": "equal-size-grid",
|
|
10
|
+
"data-classname": t,
|
|
11
|
+
"data-gap": d,
|
|
12
|
+
"data-items-per-row": u,
|
|
13
|
+
children: e
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
}));
|
|
17
|
+
a.mock("../InfoPanel/index.ts", () => ({
|
|
18
|
+
default: ({ backButtonLabel: e, className: t, classname: d, onBackClicked: u }) => /* @__PURE__ */ m("div", { "data-testid": "info-panel", "data-classname": d, className: t, children: [
|
|
19
|
+
/* @__PURE__ */ n("button", { "data-testid": "back-button", type: "button", onClick: u, children: e }),
|
|
20
|
+
/* @__PURE__ */ n("div", { children: "Info Panel Content" })
|
|
21
|
+
] })
|
|
22
|
+
}));
|
|
23
|
+
a.mock("../../settings", () => ({
|
|
24
|
+
blockLayoutsMap: /* @__PURE__ */ new Map()
|
|
25
|
+
}));
|
|
26
|
+
c("BasicGridModule", () => {
|
|
27
|
+
h(() => {
|
|
28
|
+
a.clearAllMocks();
|
|
29
|
+
}), c("Basic Rendering", () => {
|
|
30
|
+
r("should render with default props", () => {
|
|
31
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
32
|
+
o(t).toBeInTheDocument();
|
|
33
|
+
}), r("should render grid module custom element", () => {
|
|
34
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
35
|
+
o(t).toBeInTheDocument();
|
|
36
|
+
}), r("should render title when provided", () => {
|
|
37
|
+
i(/* @__PURE__ */ n(s, { title: "Test Grid Title" })), o(l.getByText("Test Grid Title")).toBeInTheDocument();
|
|
38
|
+
}), r("should not render title when empty", () => {
|
|
39
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { title: "" })), t = e.querySelector(".basic-grid-module__header");
|
|
40
|
+
o(t).not.toBeInTheDocument();
|
|
41
|
+
}), r("should render with custom element tag", () => {
|
|
42
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
43
|
+
o(t).toBeInTheDocument();
|
|
44
|
+
});
|
|
45
|
+
}), c("Animation States", () => {
|
|
46
|
+
r("should have entering state on initial render", () => {
|
|
47
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
48
|
+
o(t).toHaveAttribute("data-state", "entering");
|
|
49
|
+
}), r("should have first-entry attribute on initial render", () => {
|
|
50
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
51
|
+
o(t).toHaveAttribute("first-entry");
|
|
52
|
+
}), r("should not have first-entry when noAnimation is true", () => {
|
|
53
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { noAnimation: !0 })), t = e.querySelector("basic-grid-module");
|
|
54
|
+
o(t).not.toHaveAttribute("first-entry");
|
|
55
|
+
}), r("should set first-entry to null when noAnimation is true", () => {
|
|
56
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { noAnimation: !0 })), t = e.querySelector("basic-grid-module");
|
|
57
|
+
o(t == null ? void 0 : t.getAttribute("first-entry")).toBeNull();
|
|
58
|
+
});
|
|
59
|
+
}), c("Info Panel", () => {
|
|
60
|
+
r("should not render info panel by default", () => {
|
|
61
|
+
i(/* @__PURE__ */ n(s, {})), o(l.queryByTestId("info-panel")).not.toBeInTheDocument();
|
|
62
|
+
}), r("should render grid when info panel is closed", () => {
|
|
63
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
64
|
+
o(t).toBeInTheDocument(), o(l.queryByTestId("info-panel")).not.toBeInTheDocument();
|
|
65
|
+
}), r("should not show info panel initially", () => {
|
|
66
|
+
i(/* @__PURE__ */ n(s, {})), o(l.queryByTestId("info-panel")).not.toBeInTheDocument();
|
|
67
|
+
});
|
|
68
|
+
}), c("Title Rendering", () => {
|
|
69
|
+
r("should render title with h2 tag", () => {
|
|
70
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { title: "Grid Title" })), t = e.querySelector("h2");
|
|
71
|
+
o(t).toBeInTheDocument(), o(t).toHaveTextContent("Grid Title");
|
|
72
|
+
}), r("should apply correct CSS classes to title", () => {
|
|
73
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { title: "Grid Title" })), t = e.querySelector("h2");
|
|
74
|
+
o(t).toHaveClass("basic-grid-module__header"), o(t).toHaveClass("h4");
|
|
75
|
+
}), r("should handle long titles", () => {
|
|
76
|
+
const e = "A".repeat(100);
|
|
77
|
+
i(/* @__PURE__ */ n(s, { title: e })), o(l.getByText(e)).toBeInTheDocument();
|
|
78
|
+
}), r("should handle titles with special characters", () => {
|
|
79
|
+
const e = "Grid's Title & More <>";
|
|
80
|
+
i(/* @__PURE__ */ n(s, { title: e })), o(l.getByText(e)).toBeInTheDocument();
|
|
81
|
+
}), r("should not render header element when title is empty string", () => {
|
|
82
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { title: "" })), t = e.querySelector(".basic-grid-module__header");
|
|
83
|
+
o(t).not.toBeInTheDocument();
|
|
84
|
+
}), r("should not render header element when title is not provided", () => {
|
|
85
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector(".basic-grid-module__header");
|
|
86
|
+
o(t).not.toBeInTheDocument();
|
|
87
|
+
});
|
|
88
|
+
}), c("Props Types", () => {
|
|
89
|
+
r("should accept gap prop", () => {
|
|
90
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { gap: "2rem" })), t = e.querySelector("basic-grid-module");
|
|
91
|
+
o(t).toBeInTheDocument();
|
|
92
|
+
}), r("should accept itemsPerRow prop", () => {
|
|
93
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { itemsPerRow: 3 })), t = e.querySelector("basic-grid-module");
|
|
94
|
+
o(t).toBeInTheDocument();
|
|
95
|
+
}), r("should accept classname prop", () => {
|
|
96
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { classname: "custom-grid" })), t = e.querySelector("basic-grid-module");
|
|
97
|
+
o(t).toBeInTheDocument();
|
|
98
|
+
}), r("should accept itemComponent prop", () => {
|
|
99
|
+
const e = {
|
|
100
|
+
layout: "Figure",
|
|
101
|
+
props: {}
|
|
102
|
+
}, { container: t } = i(/* @__PURE__ */ n(s, { itemComponent: e })), d = t.querySelector("basic-grid-module");
|
|
103
|
+
o(d).toBeInTheDocument();
|
|
104
|
+
}), r("should accept items prop", () => {
|
|
105
|
+
const e = [{ id: "1" }], { container: t } = i(/* @__PURE__ */ n(s, { items: e })), d = t.querySelector("basic-grid-module");
|
|
106
|
+
o(d).toBeInTheDocument();
|
|
107
|
+
}), r("should accept customClicksHandler prop", () => {
|
|
108
|
+
const e = a.fn(), { container: t } = i(/* @__PURE__ */ n(s, { customClicksHandler: e })), d = t.querySelector("basic-grid-module");
|
|
109
|
+
o(d).toBeInTheDocument();
|
|
110
|
+
}), r("should accept infoPanelComponent prop", () => {
|
|
111
|
+
const e = {
|
|
112
|
+
layout: "CastInfoLayout",
|
|
113
|
+
backButtonLabel: "Back",
|
|
114
|
+
resourceList: [],
|
|
115
|
+
classname: ""
|
|
116
|
+
}, { container: t } = i(/* @__PURE__ */ n(s, { infoPanelComponent: e })), d = t.querySelector("basic-grid-module");
|
|
117
|
+
o(d).toBeInTheDocument();
|
|
118
|
+
});
|
|
119
|
+
}), c("Default Values", () => {
|
|
120
|
+
r("should use default gap when not provided", () => {
|
|
121
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
122
|
+
o(t).toBeInTheDocument();
|
|
123
|
+
}), r("should use default itemsPerRow when not provided", () => {
|
|
124
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
125
|
+
o(t).toBeInTheDocument();
|
|
126
|
+
}), r("should use default classname when not provided", () => {
|
|
127
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
128
|
+
o(t).toBeInTheDocument();
|
|
129
|
+
}), r("should use default title when not provided", () => {
|
|
130
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("h2");
|
|
131
|
+
o(t).not.toBeInTheDocument();
|
|
132
|
+
}), r("should use default itemComponent when not provided", () => {
|
|
133
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
134
|
+
o(t).toBeInTheDocument();
|
|
135
|
+
}), r("should use default items array when not provided", () => {
|
|
136
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
137
|
+
o(t).toBeInTheDocument();
|
|
138
|
+
}), r("should use null customClicksHandler by default", () => {
|
|
139
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
140
|
+
o(t).toBeInTheDocument();
|
|
141
|
+
}), r("should use false for noAnimation by default", () => {
|
|
142
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
143
|
+
o(t).toHaveAttribute("first-entry");
|
|
144
|
+
});
|
|
145
|
+
}), c("Edge Cases", () => {
|
|
146
|
+
r("should handle undefined title", () => {
|
|
147
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { title: void 0 })), t = e.querySelector("h2");
|
|
148
|
+
o(t).not.toBeInTheDocument();
|
|
149
|
+
}), r("should handle empty string title", () => {
|
|
150
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { title: "" })), t = e.querySelector("h2");
|
|
151
|
+
o(t).not.toBeInTheDocument();
|
|
152
|
+
}), r("should handle null customClicksHandler", () => {
|
|
153
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { customClicksHandler: null })), t = e.querySelector("basic-grid-module");
|
|
154
|
+
o(t).toBeInTheDocument();
|
|
155
|
+
}), r("should handle empty items array", () => {
|
|
156
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { items: [] })), t = e.querySelector("basic-grid-module");
|
|
157
|
+
o(t).toBeInTheDocument();
|
|
158
|
+
}), r("should handle gap with different units", () => {
|
|
159
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { gap: "20px" })), t = e.querySelector("basic-grid-module");
|
|
160
|
+
o(t).toBeInTheDocument();
|
|
161
|
+
}), r("should handle itemsPerRow of 1", () => {
|
|
162
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { itemsPerRow: 1 })), t = e.querySelector("basic-grid-module");
|
|
163
|
+
o(t).toBeInTheDocument();
|
|
164
|
+
}), r("should handle itemsPerRow of large number", () => {
|
|
165
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { itemsPerRow: 12 })), t = e.querySelector("basic-grid-module");
|
|
166
|
+
o(t).toBeInTheDocument();
|
|
167
|
+
});
|
|
168
|
+
}), c("Integration Tests", () => {
|
|
169
|
+
r("should render with multiple props combined", () => {
|
|
170
|
+
const { container: e } = i(
|
|
171
|
+
/* @__PURE__ */ n(
|
|
172
|
+
s,
|
|
173
|
+
{
|
|
174
|
+
classname: "custom-grid",
|
|
175
|
+
gap: "2rem",
|
|
176
|
+
itemsPerRow: 3,
|
|
177
|
+
noAnimation: !0,
|
|
178
|
+
title: "My Grid"
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
);
|
|
182
|
+
o(l.getByText("My Grid")).toBeInTheDocument();
|
|
183
|
+
const t = e.querySelector("basic-grid-module");
|
|
184
|
+
o(t).toHaveAttribute("data-state", "entering"), o(t).not.toHaveAttribute("first-entry");
|
|
185
|
+
}), r("should render without title and with animation", () => {
|
|
186
|
+
const { container: e } = i(
|
|
187
|
+
/* @__PURE__ */ n(
|
|
188
|
+
s,
|
|
189
|
+
{
|
|
190
|
+
classname: "no-title-grid",
|
|
191
|
+
noAnimation: !1
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
), t = e.querySelector("h2");
|
|
195
|
+
o(t).not.toBeInTheDocument();
|
|
196
|
+
const d = e.querySelector("basic-grid-module");
|
|
197
|
+
o(d).toHaveAttribute("first-entry");
|
|
198
|
+
}), r("should render with noAnimation true", () => {
|
|
199
|
+
const { container: e } = i(
|
|
200
|
+
/* @__PURE__ */ n(s, { noAnimation: !0 })
|
|
201
|
+
), t = e.querySelector("basic-grid-module");
|
|
202
|
+
o(t).not.toHaveAttribute("first-entry");
|
|
203
|
+
});
|
|
204
|
+
}), c("Conditional Rendering", () => {
|
|
205
|
+
r("should render grid when info panel is not open", () => {
|
|
206
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
207
|
+
o(t).toBeInTheDocument(), o(l.queryByTestId("info-panel")).not.toBeInTheDocument();
|
|
208
|
+
}), r("should render basic-grid-module element", () => {
|
|
209
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
210
|
+
o(t).toBeInTheDocument();
|
|
211
|
+
});
|
|
212
|
+
}), c("State Attributes", () => {
|
|
213
|
+
r("should set data-state attribute", () => {
|
|
214
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
215
|
+
o(t).toHaveAttribute("data-state");
|
|
216
|
+
}), r("should set data-state to entering initially", () => {
|
|
217
|
+
const { container: e } = i(/* @__PURE__ */ n(s, {})), t = e.querySelector("basic-grid-module");
|
|
218
|
+
o(t).toHaveAttribute("data-state", "entering");
|
|
219
|
+
}), r("should handle first-entry attribute correctly with noAnimation false", () => {
|
|
220
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { noAnimation: !1 })), t = e.querySelector("basic-grid-module");
|
|
221
|
+
o(t).toHaveAttribute("first-entry");
|
|
222
|
+
}), r("should not set first-entry attribute when noAnimation is true", () => {
|
|
223
|
+
const { container: e } = i(/* @__PURE__ */ n(s, { noAnimation: !0 })), t = e.querySelector("basic-grid-module");
|
|
224
|
+
o(t).not.toHaveAttribute("first-entry");
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
});
|