@react-text-game/ui 0.3.1 → 0.3.4
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/components/InteractiveMapComponent/Hotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/Hotspot.js +1 -2
- package/dist/components/InteractiveMapComponent/Hotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenu.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenu.js +2 -7
- package/dist/components/InteractiveMapComponent/HotspotMenu.js.map +1 -1
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.d.ts +6 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.d.ts.map +1 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.js +13 -0
- package/dist/components/InteractiveMapComponent/HotspotMenuItem.js.map +1 -0
- package/dist/components/InteractiveMapComponent/ImageHotspot.d.ts +6 -1
- package/dist/components/InteractiveMapComponent/ImageHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/ImageHotspot.js +36 -14
- package/dist/components/InteractiveMapComponent/ImageHotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.d.ts +4 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/LabelHotspot.js +6 -4
- package/dist/components/InteractiveMapComponent/LabelHotspot.js.map +1 -1
- package/dist/components/InteractiveMapComponent/SideHotspot.d.ts.map +1 -1
- package/dist/components/InteractiveMapComponent/SideHotspot.js +1 -2
- package/dist/components/InteractiveMapComponent/SideHotspot.js.map +1 -1
- package/dist/components/StoryComponent/components/Actions.d.ts.map +1 -1
- package/dist/components/StoryComponent/components/Actions.js +7 -2
- package/dist/components/StoryComponent/components/Actions.js.map +1 -1
- package/dist/components/common/Tooltip.d.ts +3 -3
- package/dist/components/common/Tooltip.d.ts.map +1 -1
- package/dist/components/common/Tooltip.js +124 -23
- package/dist/components/common/Tooltip.js.map +1 -1
- package/dist/styles/index.css +4 -45
- package/dist/tests/InteractiveMapComponent/ImageHotspot.test.d.ts +2 -0
- package/dist/tests/InteractiveMapComponent/ImageHotspot.test.d.ts.map +1 -0
- package/dist/tests/InteractiveMapComponent/ImageHotspot.test.js +460 -0
- package/dist/tests/InteractiveMapComponent/ImageHotspot.test.js.map +1 -0
- package/dist/tests/common/Tooltip.test.d.ts +2 -0
- package/dist/tests/common/Tooltip.test.d.ts.map +1 -0
- package/dist/tests/common/Tooltip.test.js +400 -0
- package/dist/tests/common/Tooltip.test.js.map +1 -0
- package/package.json +2 -2
package/dist/styles/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -284,9 +284,6 @@
|
|
|
284
284
|
.inset-0 {
|
|
285
285
|
inset: calc(var(--spacing) * 0);
|
|
286
286
|
}
|
|
287
|
-
.top-1\/2 {
|
|
288
|
-
top: calc(1/2 * 100%);
|
|
289
|
-
}
|
|
290
287
|
.top-2 {
|
|
291
288
|
top: calc(var(--spacing) * 2);
|
|
292
289
|
}
|
|
@@ -296,45 +293,24 @@
|
|
|
296
293
|
.top-10 {
|
|
297
294
|
top: calc(var(--spacing) * 10);
|
|
298
295
|
}
|
|
299
|
-
.top-\[-4px\] {
|
|
300
|
-
top: -4px;
|
|
301
|
-
}
|
|
302
296
|
.top-full {
|
|
303
297
|
top: 100%;
|
|
304
298
|
}
|
|
305
|
-
.right-0 {
|
|
306
|
-
right: calc(var(--spacing) * 0);
|
|
307
|
-
}
|
|
308
299
|
.right-2 {
|
|
309
300
|
right: calc(var(--spacing) * 2);
|
|
310
301
|
}
|
|
311
|
-
.right-3 {
|
|
312
|
-
right: calc(var(--spacing) * 3);
|
|
313
|
-
}
|
|
314
302
|
.right-4 {
|
|
315
303
|
right: calc(var(--spacing) * 4);
|
|
316
304
|
}
|
|
317
305
|
.right-20 {
|
|
318
306
|
right: calc(var(--spacing) * 20);
|
|
319
307
|
}
|
|
320
|
-
.right-\[-4px\] {
|
|
321
|
-
right: -4px;
|
|
322
|
-
}
|
|
323
|
-
.right-full {
|
|
324
|
-
right: 100%;
|
|
325
|
-
}
|
|
326
308
|
.bottom-0 {
|
|
327
309
|
bottom: calc(var(--spacing) * 0);
|
|
328
310
|
}
|
|
329
311
|
.bottom-3 {
|
|
330
312
|
bottom: calc(var(--spacing) * 3);
|
|
331
313
|
}
|
|
332
|
-
.bottom-\[-4px\] {
|
|
333
|
-
bottom: -4px;
|
|
334
|
-
}
|
|
335
|
-
.bottom-full {
|
|
336
|
-
bottom: 100%;
|
|
337
|
-
}
|
|
338
314
|
.left-0 {
|
|
339
315
|
left: calc(var(--spacing) * 0);
|
|
340
316
|
}
|
|
@@ -344,15 +320,9 @@
|
|
|
344
320
|
.left-2 {
|
|
345
321
|
left: calc(var(--spacing) * 2);
|
|
346
322
|
}
|
|
347
|
-
.left-3 {
|
|
348
|
-
left: calc(var(--spacing) * 3);
|
|
349
|
-
}
|
|
350
323
|
.left-10 {
|
|
351
324
|
left: calc(var(--spacing) * 10);
|
|
352
325
|
}
|
|
353
|
-
.left-\[-4px\] {
|
|
354
|
-
left: -4px;
|
|
355
|
-
}
|
|
356
326
|
.left-full {
|
|
357
327
|
left: 100%;
|
|
358
328
|
}
|
|
@@ -419,9 +389,6 @@
|
|
|
419
389
|
.mt-1 {
|
|
420
390
|
margin-top: calc(var(--spacing) * 1);
|
|
421
391
|
}
|
|
422
|
-
.mt-2 {
|
|
423
|
-
margin-top: calc(var(--spacing) * 2);
|
|
424
|
-
}
|
|
425
392
|
.mt-4 {
|
|
426
393
|
margin-top: calc(var(--spacing) * 4);
|
|
427
394
|
}
|
|
@@ -594,10 +561,6 @@
|
|
|
594
561
|
--tw-translate-x: calc(calc(1/2 * 100%) * -1);
|
|
595
562
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
596
563
|
}
|
|
597
|
-
.-translate-y-1\/2 {
|
|
598
|
-
--tw-translate-y: calc(calc(1/2 * 100%) * -1);
|
|
599
|
-
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
600
|
-
}
|
|
601
564
|
.translate-y-0 {
|
|
602
565
|
--tw-translate-y: calc(var(--spacing) * 0);
|
|
603
566
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -1138,6 +1101,9 @@
|
|
|
1138
1101
|
.opacity-0 {
|
|
1139
1102
|
opacity: 0%;
|
|
1140
1103
|
}
|
|
1104
|
+
.opacity-100 {
|
|
1105
|
+
opacity: 100%;
|
|
1106
|
+
}
|
|
1141
1107
|
.shadow {
|
|
1142
1108
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
1143
1109
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -1240,13 +1206,6 @@
|
|
|
1240
1206
|
--tw-duration: 300ms;
|
|
1241
1207
|
transition-duration: 300ms;
|
|
1242
1208
|
}
|
|
1243
|
-
.group-hover\:opacity-100 {
|
|
1244
|
-
&:is(:where(.group):hover *) {
|
|
1245
|
-
@media (hover: hover) {
|
|
1246
|
-
opacity: 100%;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
1209
|
.peer-checked\/modal\:pointer-events-auto {
|
|
1251
1210
|
&:is(:where(.peer\/modal):checked ~ *) {
|
|
1252
1211
|
pointer-events: auto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageHotspot.test.d.ts","sourceRoot":"","sources":["../../../src/tests/InteractiveMapComponent/ImageHotspot.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { cleanup, render, screen, waitFor } from "@testing-library/react";
|
|
2
|
+
import userEvent from "@testing-library/user-event";
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, mock, test } from "bun:test";
|
|
4
|
+
import { createElement } from "react";
|
|
5
|
+
import { ImageHotspot } from "../../components/InteractiveMapComponent/ImageHotspot";
|
|
6
|
+
describe("ImageHotspot", () => {
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
// Any setup if needed
|
|
9
|
+
});
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
cleanup();
|
|
12
|
+
});
|
|
13
|
+
describe("Basic Rendering", () => {
|
|
14
|
+
test("renders idle state by default", () => {
|
|
15
|
+
const mockAction = mock(() => { });
|
|
16
|
+
const hotspot = {
|
|
17
|
+
id: "test-hotspot",
|
|
18
|
+
type: "image",
|
|
19
|
+
position: { x: 50, y: 50 },
|
|
20
|
+
content: {
|
|
21
|
+
idle: "/images/idle.png",
|
|
22
|
+
},
|
|
23
|
+
action: mockAction,
|
|
24
|
+
};
|
|
25
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
26
|
+
const image = screen.getByAltText("test-hotspot");
|
|
27
|
+
expect(image).toBeTruthy();
|
|
28
|
+
expect(image.getAttribute("src")).toBe("/images/idle.png");
|
|
29
|
+
});
|
|
30
|
+
test("renders with custom classNames", () => {
|
|
31
|
+
const mockAction = mock(() => { });
|
|
32
|
+
const hotspot = {
|
|
33
|
+
id: "test-hotspot",
|
|
34
|
+
type: "image",
|
|
35
|
+
position: { x: 50, y: 50 },
|
|
36
|
+
content: {
|
|
37
|
+
idle: "/images/idle.png",
|
|
38
|
+
},
|
|
39
|
+
action: mockAction,
|
|
40
|
+
props: {
|
|
41
|
+
classNames: {
|
|
42
|
+
container: "custom-container",
|
|
43
|
+
idle: "custom-idle",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const { container } = render(createElement(ImageHotspot, { hotspot }));
|
|
48
|
+
const button = container.querySelector(".custom-container");
|
|
49
|
+
expect(button).toBeTruthy();
|
|
50
|
+
const image = container.querySelector(".custom-idle");
|
|
51
|
+
expect(image).toBeTruthy();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe("Interactive States", () => {
|
|
55
|
+
test("shows hover state on mouse enter", async () => {
|
|
56
|
+
const user = userEvent.setup();
|
|
57
|
+
const mockAction = mock(() => { });
|
|
58
|
+
const hotspot = {
|
|
59
|
+
id: "test-hotspot",
|
|
60
|
+
type: "image",
|
|
61
|
+
position: { x: 50, y: 50 },
|
|
62
|
+
content: {
|
|
63
|
+
idle: "/images/idle.png",
|
|
64
|
+
hover: "/images/hover.png",
|
|
65
|
+
},
|
|
66
|
+
action: mockAction,
|
|
67
|
+
};
|
|
68
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
69
|
+
const button = screen.getByRole("button");
|
|
70
|
+
await user.hover(button);
|
|
71
|
+
await waitFor(() => {
|
|
72
|
+
const image = screen.getByAltText("hotspot hover");
|
|
73
|
+
expect(image).toBeTruthy();
|
|
74
|
+
expect(image.getAttribute("src")).toBe("/images/hover.png");
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
test("shows idle state on mouse leave", async () => {
|
|
78
|
+
const user = userEvent.setup();
|
|
79
|
+
const mockAction = mock(() => { });
|
|
80
|
+
const hotspot = {
|
|
81
|
+
id: "test-hotspot",
|
|
82
|
+
type: "image",
|
|
83
|
+
position: { x: 50, y: 50 },
|
|
84
|
+
content: {
|
|
85
|
+
idle: "/images/idle.png",
|
|
86
|
+
hover: "/images/hover.png",
|
|
87
|
+
},
|
|
88
|
+
action: mockAction,
|
|
89
|
+
};
|
|
90
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
91
|
+
const button = screen.getByRole("button");
|
|
92
|
+
// Hover
|
|
93
|
+
await user.hover(button);
|
|
94
|
+
await waitFor(() => {
|
|
95
|
+
expect(screen.getByAltText("hotspot hover")).toBeTruthy();
|
|
96
|
+
});
|
|
97
|
+
// Unhover
|
|
98
|
+
await user.unhover(button);
|
|
99
|
+
await waitFor(() => {
|
|
100
|
+
const image = screen.getByAltText("test-hotspot");
|
|
101
|
+
expect(image).toBeTruthy();
|
|
102
|
+
expect(image.getAttribute("src")).toBe("/images/idle.png");
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
test("shows active state on click", async () => {
|
|
106
|
+
const user = userEvent.setup();
|
|
107
|
+
const mockAction = mock(() => { });
|
|
108
|
+
const hotspot = {
|
|
109
|
+
id: "test-hotspot",
|
|
110
|
+
type: "image",
|
|
111
|
+
position: { x: 50, y: 50 },
|
|
112
|
+
content: {
|
|
113
|
+
idle: "/images/idle.png",
|
|
114
|
+
active: "/images/active.png",
|
|
115
|
+
},
|
|
116
|
+
action: mockAction,
|
|
117
|
+
};
|
|
118
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
119
|
+
const button = screen.getByRole("button");
|
|
120
|
+
await user.click(button);
|
|
121
|
+
// Active state should show briefly
|
|
122
|
+
await waitFor(() => {
|
|
123
|
+
const image = screen.queryByAltText("hotspot active");
|
|
124
|
+
expect(image).toBeTruthy();
|
|
125
|
+
});
|
|
126
|
+
// Should return to idle after timeout
|
|
127
|
+
await waitFor(() => {
|
|
128
|
+
const image = screen.queryByAltText("test-hotspot");
|
|
129
|
+
expect(image).toBeTruthy();
|
|
130
|
+
}, { timeout: 200 });
|
|
131
|
+
});
|
|
132
|
+
test("calls action on click", async () => {
|
|
133
|
+
const user = userEvent.setup();
|
|
134
|
+
const mockAction = mock(() => { });
|
|
135
|
+
const hotspot = {
|
|
136
|
+
id: "test-hotspot",
|
|
137
|
+
type: "image",
|
|
138
|
+
position: { x: 50, y: 50 },
|
|
139
|
+
content: {
|
|
140
|
+
idle: "/images/idle.png",
|
|
141
|
+
},
|
|
142
|
+
action: mockAction,
|
|
143
|
+
};
|
|
144
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
145
|
+
const button = screen.getByRole("button");
|
|
146
|
+
await user.click(button);
|
|
147
|
+
expect(mockAction).toHaveBeenCalledTimes(1);
|
|
148
|
+
});
|
|
149
|
+
test("shows disabled state when isDisabled is true", () => {
|
|
150
|
+
const mockAction = mock(() => { });
|
|
151
|
+
const hotspot = {
|
|
152
|
+
id: "test-hotspot",
|
|
153
|
+
type: "image",
|
|
154
|
+
position: { x: 50, y: 50 },
|
|
155
|
+
content: {
|
|
156
|
+
idle: "/images/idle.png",
|
|
157
|
+
disabled: "/images/disabled.png",
|
|
158
|
+
},
|
|
159
|
+
action: mockAction,
|
|
160
|
+
isDisabled: true,
|
|
161
|
+
};
|
|
162
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
163
|
+
const image = screen.getByAltText("hotspot disabled");
|
|
164
|
+
expect(image).toBeTruthy();
|
|
165
|
+
expect(image.getAttribute("src")).toBe("/images/disabled.png");
|
|
166
|
+
const button = screen.getByRole("button");
|
|
167
|
+
expect(button.hasAttribute("disabled")).toBe(true);
|
|
168
|
+
});
|
|
169
|
+
test("does not call action when disabled and clicked", async () => {
|
|
170
|
+
const user = userEvent.setup();
|
|
171
|
+
const mockAction = mock(() => { });
|
|
172
|
+
const hotspot = {
|
|
173
|
+
id: "test-hotspot",
|
|
174
|
+
type: "image",
|
|
175
|
+
position: { x: 50, y: 50 },
|
|
176
|
+
content: {
|
|
177
|
+
idle: "/images/idle.png",
|
|
178
|
+
},
|
|
179
|
+
action: mockAction,
|
|
180
|
+
isDisabled: true,
|
|
181
|
+
};
|
|
182
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
183
|
+
const button = screen.getByRole("button");
|
|
184
|
+
await user.click(button);
|
|
185
|
+
expect(mockAction).not.toHaveBeenCalled();
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
describe("Dynamic Content (Functions)", () => {
|
|
189
|
+
test("handles content as functions", () => {
|
|
190
|
+
const mockAction = mock(() => { });
|
|
191
|
+
const hotspot = {
|
|
192
|
+
id: "test-hotspot",
|
|
193
|
+
type: "image",
|
|
194
|
+
position: { x: 50, y: 50 },
|
|
195
|
+
content: {
|
|
196
|
+
idle: () => "/images/dynamic-idle.png",
|
|
197
|
+
},
|
|
198
|
+
action: mockAction,
|
|
199
|
+
};
|
|
200
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
201
|
+
const image = screen.getByAltText("test-hotspot");
|
|
202
|
+
expect(image.getAttribute("src")).toBe("/images/dynamic-idle.png");
|
|
203
|
+
});
|
|
204
|
+
test("handles isDisabled as function", () => {
|
|
205
|
+
const mockAction = mock(() => { });
|
|
206
|
+
const hotspot = {
|
|
207
|
+
id: "test-hotspot",
|
|
208
|
+
type: "image",
|
|
209
|
+
position: { x: 50, y: 50 },
|
|
210
|
+
content: {
|
|
211
|
+
idle: "/images/idle.png",
|
|
212
|
+
disabled: "/images/disabled.png",
|
|
213
|
+
},
|
|
214
|
+
action: mockAction,
|
|
215
|
+
isDisabled: () => true,
|
|
216
|
+
};
|
|
217
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
218
|
+
const button = screen.getByRole("button");
|
|
219
|
+
expect(button.hasAttribute("disabled")).toBe(true);
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
describe("Scaling with imagePositionInfo", () => {
|
|
223
|
+
test("applies default scale when no imagePositionInfo provided", () => {
|
|
224
|
+
const mockAction = mock(() => { });
|
|
225
|
+
const hotspot = {
|
|
226
|
+
id: "test-hotspot",
|
|
227
|
+
type: "image",
|
|
228
|
+
position: { x: 50, y: 50 },
|
|
229
|
+
content: {
|
|
230
|
+
idle: "/images/idle.png",
|
|
231
|
+
},
|
|
232
|
+
action: mockAction,
|
|
233
|
+
};
|
|
234
|
+
const { container } = render(createElement(ImageHotspot, { hotspot }));
|
|
235
|
+
const button = container.querySelector("button");
|
|
236
|
+
expect(button).toBeTruthy();
|
|
237
|
+
const style = button.style;
|
|
238
|
+
expect(style.transform).toBe("scale(1)");
|
|
239
|
+
});
|
|
240
|
+
test("applies scaleFactor from imagePositionInfo", () => {
|
|
241
|
+
const mockAction = mock(() => { });
|
|
242
|
+
const hotspot = {
|
|
243
|
+
id: "test-hotspot",
|
|
244
|
+
type: "image",
|
|
245
|
+
position: { x: 50, y: 50 },
|
|
246
|
+
content: {
|
|
247
|
+
idle: "/images/idle.png",
|
|
248
|
+
},
|
|
249
|
+
action: mockAction,
|
|
250
|
+
};
|
|
251
|
+
const imagePositionInfo = {
|
|
252
|
+
scaleFactor: 0.5,
|
|
253
|
+
offsetLeft: 100,
|
|
254
|
+
offsetTop: 100,
|
|
255
|
+
scaledWidth: 500,
|
|
256
|
+
scaledHeight: 500,
|
|
257
|
+
};
|
|
258
|
+
const { container } = render(createElement(ImageHotspot, { hotspot, imagePositionInfo }));
|
|
259
|
+
const button = container.querySelector("button");
|
|
260
|
+
expect(button).toBeTruthy();
|
|
261
|
+
const style = button.style;
|
|
262
|
+
expect(style.transform).toBe("scale(0.5)");
|
|
263
|
+
});
|
|
264
|
+
test("combines scaleFactor with custom zoom prop", () => {
|
|
265
|
+
const mockAction = mock(() => { });
|
|
266
|
+
const hotspot = {
|
|
267
|
+
id: "test-hotspot",
|
|
268
|
+
type: "image",
|
|
269
|
+
position: { x: 50, y: 50 },
|
|
270
|
+
content: {
|
|
271
|
+
idle: "/images/idle.png",
|
|
272
|
+
},
|
|
273
|
+
action: mockAction,
|
|
274
|
+
props: {
|
|
275
|
+
zoom: "200%",
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
const imagePositionInfo = {
|
|
279
|
+
scaleFactor: 0.5,
|
|
280
|
+
offsetLeft: 100,
|
|
281
|
+
offsetTop: 100,
|
|
282
|
+
scaledWidth: 500,
|
|
283
|
+
scaledHeight: 500,
|
|
284
|
+
};
|
|
285
|
+
const { container } = render(createElement(ImageHotspot, { hotspot, imagePositionInfo }));
|
|
286
|
+
const button = container.querySelector("button");
|
|
287
|
+
expect(button).toBeTruthy();
|
|
288
|
+
const style = button.style;
|
|
289
|
+
// 0.5 (scaleFactor) * 2 (200% zoom) = 1
|
|
290
|
+
expect(style.transform).toBe("scale(1)");
|
|
291
|
+
});
|
|
292
|
+
test("updates scale when imagePositionInfo changes", () => {
|
|
293
|
+
const mockAction = mock(() => { });
|
|
294
|
+
const hotspot = {
|
|
295
|
+
id: "test-hotspot",
|
|
296
|
+
type: "image",
|
|
297
|
+
position: { x: 50, y: 50 },
|
|
298
|
+
content: {
|
|
299
|
+
idle: "/images/idle.png",
|
|
300
|
+
},
|
|
301
|
+
action: mockAction,
|
|
302
|
+
};
|
|
303
|
+
const initialImagePositionInfo = {
|
|
304
|
+
scaleFactor: 0.5,
|
|
305
|
+
offsetLeft: 100,
|
|
306
|
+
offsetTop: 100,
|
|
307
|
+
scaledWidth: 500,
|
|
308
|
+
scaledHeight: 500,
|
|
309
|
+
};
|
|
310
|
+
const { container, rerender } = render(createElement(ImageHotspot, {
|
|
311
|
+
hotspot,
|
|
312
|
+
imagePositionInfo: initialImagePositionInfo,
|
|
313
|
+
}));
|
|
314
|
+
let button = container.querySelector("button");
|
|
315
|
+
expect(button.style.transform).toBe("scale(0.5)");
|
|
316
|
+
// Simulate window resize - update imagePositionInfo
|
|
317
|
+
const updatedImagePositionInfo = {
|
|
318
|
+
scaleFactor: 0.75,
|
|
319
|
+
offsetLeft: 150,
|
|
320
|
+
offsetTop: 150,
|
|
321
|
+
scaledWidth: 750,
|
|
322
|
+
scaledHeight: 750,
|
|
323
|
+
};
|
|
324
|
+
rerender(createElement(ImageHotspot, {
|
|
325
|
+
hotspot,
|
|
326
|
+
imagePositionInfo: updatedImagePositionInfo,
|
|
327
|
+
}));
|
|
328
|
+
button = container.querySelector("button");
|
|
329
|
+
expect(button.style.transform).toBe("scale(0.75)");
|
|
330
|
+
});
|
|
331
|
+
test("applies transform origin center center", () => {
|
|
332
|
+
const mockAction = mock(() => { });
|
|
333
|
+
const hotspot = {
|
|
334
|
+
id: "test-hotspot",
|
|
335
|
+
type: "image",
|
|
336
|
+
position: { x: 50, y: 50 },
|
|
337
|
+
content: {
|
|
338
|
+
idle: "/images/idle.png",
|
|
339
|
+
},
|
|
340
|
+
action: mockAction,
|
|
341
|
+
};
|
|
342
|
+
const imagePositionInfo = {
|
|
343
|
+
scaleFactor: 0.5,
|
|
344
|
+
offsetLeft: 100,
|
|
345
|
+
offsetTop: 100,
|
|
346
|
+
scaledWidth: 500,
|
|
347
|
+
scaledHeight: 500,
|
|
348
|
+
};
|
|
349
|
+
const { container } = render(createElement(ImageHotspot, { hotspot, imagePositionInfo }));
|
|
350
|
+
const button = container.querySelector("button");
|
|
351
|
+
expect(button).toBeTruthy();
|
|
352
|
+
const style = button.style;
|
|
353
|
+
expect(style.transformOrigin).toBe("center center");
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
describe("Edge Cases", () => {
|
|
357
|
+
test("handles missing hover content gracefully", async () => {
|
|
358
|
+
const user = userEvent.setup();
|
|
359
|
+
const mockAction = mock(() => { });
|
|
360
|
+
const hotspot = {
|
|
361
|
+
id: "test-hotspot",
|
|
362
|
+
type: "image",
|
|
363
|
+
position: { x: 50, y: 50 },
|
|
364
|
+
content: {
|
|
365
|
+
idle: "/images/idle.png",
|
|
366
|
+
},
|
|
367
|
+
action: mockAction,
|
|
368
|
+
};
|
|
369
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
370
|
+
const button = screen.getByRole("button");
|
|
371
|
+
await user.hover(button);
|
|
372
|
+
// Should still show idle when hover is missing
|
|
373
|
+
const image = screen.getByAltText("test-hotspot");
|
|
374
|
+
expect(image.getAttribute("src")).toBe("/images/idle.png");
|
|
375
|
+
});
|
|
376
|
+
test("handles missing active content gracefully", async () => {
|
|
377
|
+
const user = userEvent.setup();
|
|
378
|
+
const mockAction = mock(() => { });
|
|
379
|
+
const hotspot = {
|
|
380
|
+
id: "test-hotspot",
|
|
381
|
+
type: "image",
|
|
382
|
+
position: { x: 50, y: 50 },
|
|
383
|
+
content: {
|
|
384
|
+
idle: "/images/idle.png",
|
|
385
|
+
},
|
|
386
|
+
action: mockAction,
|
|
387
|
+
};
|
|
388
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
389
|
+
const button = screen.getByRole("button");
|
|
390
|
+
await user.click(button);
|
|
391
|
+
// Should still show idle when active is missing
|
|
392
|
+
const image = screen.getByAltText("test-hotspot");
|
|
393
|
+
expect(image.getAttribute("src")).toBe("/images/idle.png");
|
|
394
|
+
});
|
|
395
|
+
test("handles missing disabled content gracefully", () => {
|
|
396
|
+
const mockAction = mock(() => { });
|
|
397
|
+
const hotspot = {
|
|
398
|
+
id: "test-hotspot",
|
|
399
|
+
type: "image",
|
|
400
|
+
position: { x: 50, y: 50 },
|
|
401
|
+
content: {
|
|
402
|
+
idle: "/images/idle.png",
|
|
403
|
+
},
|
|
404
|
+
action: mockAction,
|
|
405
|
+
isDisabled: true,
|
|
406
|
+
};
|
|
407
|
+
render(createElement(ImageHotspot, { hotspot }));
|
|
408
|
+
// Should show idle when disabled content is missing
|
|
409
|
+
const image = screen.getByAltText("test-hotspot");
|
|
410
|
+
expect(image.getAttribute("src")).toBe("/images/idle.png");
|
|
411
|
+
});
|
|
412
|
+
test("handles zoom prop correctly", () => {
|
|
413
|
+
const mockAction = mock(() => { });
|
|
414
|
+
const hotspot = {
|
|
415
|
+
id: "test-hotspot",
|
|
416
|
+
type: "image",
|
|
417
|
+
position: { x: 50, y: 50 },
|
|
418
|
+
content: {
|
|
419
|
+
idle: "/images/idle.png",
|
|
420
|
+
},
|
|
421
|
+
action: mockAction,
|
|
422
|
+
props: {
|
|
423
|
+
zoom: "150%",
|
|
424
|
+
},
|
|
425
|
+
};
|
|
426
|
+
const { container } = render(createElement(ImageHotspot, { hotspot }));
|
|
427
|
+
const button = container.querySelector("button");
|
|
428
|
+
expect(button).toBeTruthy();
|
|
429
|
+
// parseFloat("150%") / 100 = 1.5
|
|
430
|
+
const style = button.style;
|
|
431
|
+
expect(style.transform).toBe("scale(1.5)");
|
|
432
|
+
});
|
|
433
|
+
test("handles zero scaleFactor", () => {
|
|
434
|
+
const mockAction = mock(() => { });
|
|
435
|
+
const hotspot = {
|
|
436
|
+
id: "test-hotspot",
|
|
437
|
+
type: "image",
|
|
438
|
+
position: { x: 50, y: 50 },
|
|
439
|
+
content: {
|
|
440
|
+
idle: "/images/idle.png",
|
|
441
|
+
},
|
|
442
|
+
action: mockAction,
|
|
443
|
+
};
|
|
444
|
+
const imagePositionInfo = {
|
|
445
|
+
scaleFactor: 0,
|
|
446
|
+
offsetLeft: 100,
|
|
447
|
+
offsetTop: 100,
|
|
448
|
+
scaledWidth: 500,
|
|
449
|
+
scaledHeight: 500,
|
|
450
|
+
};
|
|
451
|
+
const { container } = render(createElement(ImageHotspot, { hotspot, imagePositionInfo }));
|
|
452
|
+
const button = container.querySelector("button");
|
|
453
|
+
expect(button).toBeTruthy();
|
|
454
|
+
const style = button.style;
|
|
455
|
+
// Zero scaleFactor should be preserved (not treated as falsy)
|
|
456
|
+
expect(style.transform).toBe("scale(0)");
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
//# sourceMappingURL=ImageHotspot.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageHotspot.test.js","sourceRoot":"","sources":["../../../src/tests/InteractiveMapComponent/ImageHotspot.test.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AAGhF,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC1B,UAAU,CAAC,GAA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