@rstest/browser 0.9.2 → 0.9.3
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/browser-container/container-static/js/{101.82cdbbe145.js → 927.514b181bd2.js} +1710 -1645
- package/dist/browser-container/container-static/js/927.514b181bd2.js.LICENSE.txt +1 -0
- package/dist/browser-container/container-static/js/{index.602d6770fe.js → index.5acf502b10.js} +505 -434
- package/dist/browser-container/container-static/js/{lib-react.ce60b6aea5.js → lib-react.f905279759.js} +4 -4
- package/dist/browser-container/container-static/js/lib-react.f905279759.js.LICENSE.txt +1 -0
- package/dist/browser-container/index.html +1 -1
- package/dist/index.js +145 -30
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/playwright/runtime.d.ts +2 -1
- package/dist/rslib-runtime.js +20 -0
- package/package.json +4 -3
- package/src/AGENTS.md +1 -1
- package/src/client/AGENTS.md +8 -8
- package/src/configValidation.ts +4 -0
- package/src/hostController.ts +232 -28
- package/src/index.ts +0 -1
- package/src/providers/index.ts +10 -0
- package/src/providers/playwright/implementation.ts +2 -0
- package/src/providers/playwright/runtime.ts +37 -15
- package/dist/browser-container/container-static/js/101.82cdbbe145.js.LICENSE.txt +0 -1
- package/dist/browser-container/container-static/js/lib-react.ce60b6aea5.js.LICENSE.txt +0 -1
package/dist/browser-container/container-static/js/{index.602d6770fe.js → index.5acf502b10.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(()=>{
|
|
2
2
|
"use strict";
|
|
3
3
|
var e, t, s, l, r, o, a = {
|
|
4
|
-
|
|
4
|
+
5645 (e, t, s) {
|
|
5
5
|
var l = s(6730);
|
|
6
|
-
let r = "__rstest_dispatch_response__";
|
|
7
|
-
var
|
|
8
|
-
let
|
|
6
|
+
let r = "__rstest_dispatch_response__", o = "runner";
|
|
7
|
+
var a = s(2650), i = s(1855), n = s(9013), c = s(162), d = s(2739);
|
|
8
|
+
let u = (e)=>{
|
|
9
9
|
let { message: t } = e;
|
|
10
10
|
return (0, l.jsx)("div", {
|
|
11
11
|
className: "absolute inset-0 z-10 flex items-center justify-center bg-black/[0.02]",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
})
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
var
|
|
19
|
-
let
|
|
18
|
+
var p = s(9347), h = s(7660), f = s(4335), x = s(6942), m = s(396);
|
|
19
|
+
let g = (e, t)=>{
|
|
20
20
|
if (!t) return e;
|
|
21
21
|
let s = t.endsWith("/") ? t.slice(0, -1) : t;
|
|
22
22
|
if (e.startsWith(s)) {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
return t.startsWith("/") ? t.slice(1) : t;
|
|
25
25
|
}
|
|
26
26
|
return e;
|
|
27
|
-
},
|
|
27
|
+
}, j = (e)=>{
|
|
28
28
|
window.parent?.postMessage({
|
|
29
29
|
type: "open-in-editor",
|
|
30
30
|
payload: {
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
}
|
|
33
33
|
}, "*"), fetch(`/__open-in-editor?file=${encodeURIComponent(e)}`).catch(()=>{});
|
|
34
34
|
};
|
|
35
|
-
var
|
|
36
|
-
let
|
|
35
|
+
var v = s(1696), y = s(1e3), _ = s(2886), C = s(1538), w = s(6609);
|
|
36
|
+
let b = {
|
|
37
37
|
idle: {
|
|
38
38
|
label: "Idle",
|
|
39
39
|
color: "var(--accents-5)",
|
|
40
|
-
icon: (0, l.jsx)(
|
|
40
|
+
icon: (0, l.jsx)(v.A, {
|
|
41
41
|
size: 14,
|
|
42
42
|
strokeWidth: 2.5
|
|
43
43
|
})
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
running: {
|
|
46
46
|
label: "Running",
|
|
47
47
|
color: "var(--ds-amber-700)",
|
|
48
|
-
icon: (0, l.jsx)(
|
|
48
|
+
icon: (0, l.jsx)(y.A, {
|
|
49
49
|
size: 14,
|
|
50
50
|
className: "animate-spin",
|
|
51
51
|
strokeWidth: 2.5
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
pass: {
|
|
55
55
|
label: "Pass",
|
|
56
56
|
color: "var(--ds-green-700)",
|
|
57
|
-
icon: (0, l.jsx)(
|
|
57
|
+
icon: (0, l.jsx)(_.A, {
|
|
58
58
|
size: 14,
|
|
59
59
|
strokeWidth: 2.5
|
|
60
60
|
})
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
fail: {
|
|
63
63
|
label: "Fail",
|
|
64
64
|
color: "var(--ds-red-800)",
|
|
65
|
-
icon: (0, l.jsx)(
|
|
65
|
+
icon: (0, l.jsx)(C.A, {
|
|
66
66
|
size: 14,
|
|
67
67
|
strokeWidth: 2.5
|
|
68
68
|
})
|
|
69
69
|
}
|
|
70
|
-
},
|
|
71
|
-
...
|
|
70
|
+
}, k = {
|
|
71
|
+
...b,
|
|
72
72
|
skip: {
|
|
73
73
|
label: "Skip",
|
|
74
74
|
color: "var(--accents-4)",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
})
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
var
|
|
81
|
+
var S = s(4532), F = s(9303), N = s(8814), A = s(1309), P = s(5758), M = s(9031), z = s(3168), O = s(2024);
|
|
82
82
|
let R = {
|
|
83
83
|
iPhoneSE: {
|
|
84
84
|
width: 375,
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
width: 1280,
|
|
149
149
|
height: 800
|
|
150
150
|
}
|
|
151
|
-
},
|
|
151
|
+
}, E = {
|
|
152
152
|
iPhoneSE: "iPhone SE",
|
|
153
153
|
iPhoneXR: "iPhone XR",
|
|
154
154
|
iPhone12Pro: "iPhone 12 Pro",
|
|
@@ -188,16 +188,16 @@
|
|
|
188
188
|
let t = R[e];
|
|
189
189
|
return {
|
|
190
190
|
id: e,
|
|
191
|
-
label:
|
|
191
|
+
label: E[e],
|
|
192
192
|
width: t.width,
|
|
193
193
|
height: t.height
|
|
194
194
|
};
|
|
195
|
-
}),
|
|
195
|
+
}), $ = new Set(U.map((e)=>e.id)), T = (e)=>"string" == typeof e && $.has(e), I = (e)=>{
|
|
196
196
|
let t = U.find((t)=>t.id === e);
|
|
197
197
|
if (!t) throw Error(`Unknown device preset: ${e}`);
|
|
198
198
|
return t;
|
|
199
|
-
}, B = (e, t, s)=>Math.min(s, Math.max(t, e)),
|
|
200
|
-
let { token: t, value: s, onChange: r } = e, [o, a] = (0,
|
|
199
|
+
}, B = (e, t, s)=>Math.min(s, Math.max(t, e)), W = (e)=>{
|
|
200
|
+
let { token: t, value: s, onChange: r } = e, [o, a] = (0, c.useState)(!1), i = (0, c.useRef)({
|
|
201
201
|
width: 800,
|
|
202
202
|
height: 600
|
|
203
203
|
});
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
width: s.width,
|
|
206
206
|
height: s.height
|
|
207
207
|
});
|
|
208
|
-
let
|
|
208
|
+
let n = "full" === s.mode ? "full" : "responsive" === s.mode ? "responsive" : s.preset, d = (0, c.useMemo)(()=>[
|
|
209
209
|
{
|
|
210
210
|
value: "full",
|
|
211
211
|
label: "Full"
|
|
@@ -218,18 +218,18 @@
|
|
|
218
218
|
let t;
|
|
219
219
|
return {
|
|
220
220
|
value: e.id,
|
|
221
|
-
label: (t =
|
|
221
|
+
label: (t = I(e.id), `${t.label} (${t.width} x ${t.height})`)
|
|
222
222
|
};
|
|
223
223
|
})
|
|
224
|
-
], []),
|
|
224
|
+
], []), u = (0, l.jsxs)("div", {
|
|
225
225
|
className: "w-[280px]",
|
|
226
226
|
"data-testid": "viewport-popover",
|
|
227
227
|
children: [
|
|
228
228
|
(0, l.jsxs)("div", {
|
|
229
229
|
className: "flex items-center gap-2",
|
|
230
230
|
children: [
|
|
231
|
-
(0, l.jsx)(
|
|
232
|
-
value:
|
|
231
|
+
(0, l.jsx)(S.A, {
|
|
232
|
+
value: n,
|
|
233
233
|
options: d,
|
|
234
234
|
listHeight: 280,
|
|
235
235
|
dropdownStyle: {
|
|
@@ -260,17 +260,17 @@
|
|
|
260
260
|
popupMatchSelectWidth: !1,
|
|
261
261
|
"data-testid": "viewport-preset-select"
|
|
262
262
|
}),
|
|
263
|
-
(0, l.jsx)(
|
|
263
|
+
(0, l.jsx)(p.A, {
|
|
264
264
|
title: "Rotate",
|
|
265
265
|
mouseLeaveDelay: 0,
|
|
266
|
-
children: (0, l.jsx)(
|
|
266
|
+
children: (0, l.jsx)(h.Ay, {
|
|
267
267
|
type: "text",
|
|
268
268
|
size: "small",
|
|
269
269
|
disabled: "full" === s.mode,
|
|
270
270
|
className: "flex h-7 w-7 items-center justify-center rounded-md p-0 text-(--accents-4) hover:text-foreground hover:bg-(--accents-1) transition-all",
|
|
271
271
|
"data-testid": "viewport-rotate",
|
|
272
272
|
"aria-label": "Rotate viewport",
|
|
273
|
-
icon: (0, l.jsx)(
|
|
273
|
+
icon: (0, l.jsx)(O.A, {
|
|
274
274
|
size: 14,
|
|
275
275
|
strokeWidth: 2.2
|
|
276
276
|
}),
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
className: "mt-3 flex items-center gap-2",
|
|
304
304
|
"data-testid": "viewport-inputs",
|
|
305
305
|
children: [
|
|
306
|
-
(0, l.jsx)(
|
|
306
|
+
(0, l.jsx)(F.A, {
|
|
307
307
|
min: 1,
|
|
308
308
|
max: 1e4,
|
|
309
309
|
step: 1,
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
className: "text-(--accents-4) select-none",
|
|
330
330
|
children: "x"
|
|
331
331
|
}),
|
|
332
|
-
(0, l.jsx)(
|
|
332
|
+
(0, l.jsx)(F.A, {
|
|
333
333
|
min: 1,
|
|
334
334
|
max: 1e4,
|
|
335
335
|
step: 1,
|
|
@@ -355,13 +355,13 @@
|
|
|
355
355
|
})
|
|
356
356
|
]
|
|
357
357
|
});
|
|
358
|
-
return (0, l.jsx)(
|
|
359
|
-
content:
|
|
358
|
+
return (0, l.jsx)(N.A, {
|
|
359
|
+
content: u,
|
|
360
360
|
trigger: "click",
|
|
361
361
|
open: o,
|
|
362
362
|
onOpenChange: a,
|
|
363
363
|
placement: "bottomRight",
|
|
364
|
-
children: (0, l.jsxs)(
|
|
364
|
+
children: (0, l.jsxs)(h.Ay, {
|
|
365
365
|
type: "text",
|
|
366
366
|
size: "small",
|
|
367
367
|
className: "flex h-7 items-center gap-2 rounded-md px-2 text-(--accents-6) hover:text-foreground hover:bg-(--accents-1) transition-all",
|
|
@@ -371,19 +371,19 @@
|
|
|
371
371
|
(0, l.jsx)("span", {
|
|
372
372
|
className: "flex h-4 w-4 items-center justify-center text-(--accents-5)",
|
|
373
373
|
children: ((e)=>{
|
|
374
|
-
if ("full" === e.mode) return (0, l.jsx)(
|
|
374
|
+
if ("full" === e.mode) return (0, l.jsx)(A.A, {
|
|
375
375
|
size: 14,
|
|
376
376
|
strokeWidth: 2.2
|
|
377
377
|
});
|
|
378
|
-
if ("responsive" === e.mode) return (0, l.jsx)(
|
|
378
|
+
if ("responsive" === e.mode) return (0, l.jsx)(P.A, {
|
|
379
379
|
size: 14,
|
|
380
380
|
strokeWidth: 2.2
|
|
381
381
|
});
|
|
382
|
-
let t =
|
|
383
|
-
return t.startsWith("iPad") || t.startsWith("Surface") || t.startsWith("Nest Hub") || t.includes("Fold") ? (0, l.jsx)(
|
|
382
|
+
let t = I(e.preset).label;
|
|
383
|
+
return t.startsWith("iPad") || t.startsWith("Surface") || t.startsWith("Nest Hub") || t.includes("Fold") ? (0, l.jsx)(M.A, {
|
|
384
384
|
size: 14,
|
|
385
385
|
strokeWidth: 2.2
|
|
386
|
-
}) : (0, l.jsx)(
|
|
386
|
+
}) : (0, l.jsx)(z.A, {
|
|
387
387
|
size: 14,
|
|
388
388
|
strokeWidth: 2.2
|
|
389
389
|
});
|
|
@@ -394,15 +394,15 @@
|
|
|
394
394
|
style: {
|
|
395
395
|
color: t.colorTextSecondary
|
|
396
396
|
},
|
|
397
|
-
children: "full" === s.mode ? "Full" : "responsive" === s.mode ? `${s.width} x ${s.height}` :
|
|
397
|
+
children: "full" === s.mode ? "Full" : "responsive" === s.mode ? `${s.width} x ${s.height}` : I(s.preset).label
|
|
398
398
|
})
|
|
399
399
|
]
|
|
400
400
|
})
|
|
401
401
|
});
|
|
402
402
|
}, D = (e)=>{
|
|
403
|
-
let { token: t, activeFile: s, rootPath: r, status: o, viewport: a, onViewportChange:
|
|
404
|
-
|
|
405
|
-
},
|
|
403
|
+
let { token: t, activeFile: s, rootPath: r, status: o, viewport: a, onViewportChange: i } = e, { message: c } = n.A.useApp(), d = o ? b[o] : void 0, u = s ? g(s, r) : "", v = u.split("/"), y = v.pop(), _ = v.join("/"), C = async ()=>{
|
|
404
|
+
u && (await navigator.clipboard.writeText(u), c.success("relative path copied"));
|
|
405
|
+
}, w = "pass" === o ? "green" : "fail" === o ? "red" : "running" === o ? "amber" : null;
|
|
406
406
|
return (0, l.jsxs)("div", {
|
|
407
407
|
className: "flex h-[48px] items-center justify-between px-4",
|
|
408
408
|
"data-testid": "preview-header",
|
|
@@ -414,7 +414,7 @@
|
|
|
414
414
|
(0, l.jsxs)("div", {
|
|
415
415
|
className: "flex items-center gap-2 overflow-hidden",
|
|
416
416
|
children: [
|
|
417
|
-
(0, l.jsx)(
|
|
417
|
+
(0, l.jsx)(f.A, {
|
|
418
418
|
size: 16,
|
|
419
419
|
strokeWidth: 2,
|
|
420
420
|
className: "shrink-0 text-(--accents-7)"
|
|
@@ -445,10 +445,10 @@
|
|
|
445
445
|
s && (0, l.jsxs)("div", {
|
|
446
446
|
className: "flex items-center",
|
|
447
447
|
children: [
|
|
448
|
-
(0, l.jsx)(
|
|
448
|
+
(0, l.jsx)(p.A, {
|
|
449
449
|
title: "Copy relative path",
|
|
450
450
|
mouseLeaveDelay: 0,
|
|
451
|
-
children: (0, l.jsx)(
|
|
451
|
+
children: (0, l.jsx)(h.Ay, {
|
|
452
452
|
type: "text",
|
|
453
453
|
size: "small",
|
|
454
454
|
className: "flex ml-1 h-5 w-5 items-center justify-center rounded-md p-0 text-(--accents-4) hover:text-foreground hover:bg-(--accents-1) transition-all",
|
|
@@ -456,26 +456,26 @@
|
|
|
456
456
|
color: t.colorTextDescription
|
|
457
457
|
},
|
|
458
458
|
"data-testid": "preview-copy-path",
|
|
459
|
-
icon: (0, l.jsx)(
|
|
459
|
+
icon: (0, l.jsx)(x.A, {
|
|
460
460
|
size: 12,
|
|
461
461
|
strokeWidth: 2.5
|
|
462
462
|
}),
|
|
463
|
-
onClick:
|
|
463
|
+
onClick: C
|
|
464
464
|
})
|
|
465
465
|
}),
|
|
466
|
-
(0, l.jsx)(
|
|
466
|
+
(0, l.jsx)(p.A, {
|
|
467
467
|
title: "Open in Editor",
|
|
468
468
|
mouseLeaveDelay: 0,
|
|
469
|
-
children: (0, l.jsx)(
|
|
469
|
+
children: (0, l.jsx)(h.Ay, {
|
|
470
470
|
type: "text",
|
|
471
471
|
size: "small",
|
|
472
472
|
className: "flex h-5 w-5 items-center justify-center rounded-md p-0 text-(--accents-4) hover:text-foreground hover:bg-(--accents-1) transition-all",
|
|
473
473
|
"data-testid": "preview-open-editor",
|
|
474
|
-
icon: (0, l.jsx)(
|
|
474
|
+
icon: (0, l.jsx)(m.A, {
|
|
475
475
|
size: 12,
|
|
476
476
|
strokeWidth: 2.5
|
|
477
477
|
}),
|
|
478
|
-
onClick: ()=>
|
|
478
|
+
onClick: ()=>j(s),
|
|
479
479
|
style: {
|
|
480
480
|
color: t.colorTextDescription
|
|
481
481
|
}
|
|
@@ -495,17 +495,17 @@
|
|
|
495
495
|
(0, l.jsxs)("div", {
|
|
496
496
|
className: "flex items-center gap-3 shrink-0",
|
|
497
497
|
children: [
|
|
498
|
-
a &&
|
|
498
|
+
a && i && (0, l.jsx)(W, {
|
|
499
499
|
token: t,
|
|
500
500
|
value: a,
|
|
501
|
-
onChange:
|
|
501
|
+
onChange: i
|
|
502
502
|
}),
|
|
503
|
-
d &&
|
|
503
|
+
d && w && (0, l.jsx)("div", {
|
|
504
504
|
className: "flex items-center rounded-md px-2 py-0.5 text-[10px] font-semibold tracking-wider transition-colors shrink-0",
|
|
505
505
|
style: {
|
|
506
|
-
backgroundColor: `var(--ds-${
|
|
507
|
-
color: `var(--ds-${
|
|
508
|
-
border: `1px solid var(--ds-${
|
|
506
|
+
backgroundColor: `var(--ds-${w}-100)`,
|
|
507
|
+
color: `var(--ds-${w}-900)`,
|
|
508
|
+
border: `1px solid var(--ds-${w}-300)`
|
|
509
509
|
},
|
|
510
510
|
children: d.label.toUpperCase()
|
|
511
511
|
})
|
|
@@ -514,22 +514,22 @@
|
|
|
514
514
|
]
|
|
515
515
|
});
|
|
516
516
|
};
|
|
517
|
-
var
|
|
518
|
-
let
|
|
519
|
-
let { className: t, style: s, direction: r = "horizontal", children: o, autoSaveId: a, ...i } = e,
|
|
517
|
+
var G = s(2936);
|
|
518
|
+
let Z = (e)=>{
|
|
519
|
+
let { className: t, style: s, direction: r = "horizontal", children: o, autoSaveId: a, ...i } = e, n = c.Children.toArray(o).filter((e)=>c.isValidElement(e) && e.type === L), d = c.useCallback(()=>{
|
|
520
520
|
if (!a) return null;
|
|
521
521
|
try {
|
|
522
522
|
let e = localStorage.getItem(a);
|
|
523
523
|
if (e) {
|
|
524
524
|
let t = JSON.parse(e);
|
|
525
|
-
if (Array.isArray(t) && t.length ===
|
|
525
|
+
if (Array.isArray(t) && t.length === n.length) return t;
|
|
526
526
|
}
|
|
527
527
|
} catch {}
|
|
528
528
|
return null;
|
|
529
529
|
}, [
|
|
530
530
|
a,
|
|
531
|
-
|
|
532
|
-
])(), u =
|
|
531
|
+
n.length
|
|
532
|
+
])(), u = n.map((e, t)=>{
|
|
533
533
|
let { defaultSize: s, minSize: l, maxSize: r, children: o } = e.props, a = d?.[t] ?? s;
|
|
534
534
|
return {
|
|
535
535
|
defaultSize: a ? `${a}%` : void 0,
|
|
@@ -537,14 +537,14 @@
|
|
|
537
537
|
max: r ? `${r}%` : void 0,
|
|
538
538
|
children: o
|
|
539
539
|
};
|
|
540
|
-
}), p =
|
|
540
|
+
}), p = c.useCallback((e)=>{
|
|
541
541
|
if (a) try {
|
|
542
542
|
localStorage.setItem(a, JSON.stringify(e));
|
|
543
543
|
} catch {}
|
|
544
544
|
}, [
|
|
545
545
|
a
|
|
546
546
|
]);
|
|
547
|
-
return (0, l.jsx)(
|
|
547
|
+
return (0, l.jsx)(G.A, {
|
|
548
548
|
layout: "horizontal" === r ? "horizontal" : "vertical",
|
|
549
549
|
className: t,
|
|
550
550
|
style: {
|
|
@@ -556,19 +556,19 @@
|
|
|
556
556
|
},
|
|
557
557
|
onResizeEnd: p,
|
|
558
558
|
...i,
|
|
559
|
-
children: u.map((e)=>(0, l.jsx)(
|
|
559
|
+
children: u.map((e)=>(0, l.jsx)(G.A.Panel, {
|
|
560
560
|
...e,
|
|
561
561
|
children: e.children
|
|
562
562
|
}, `panel-${e.defaultSize}-${e.min}-${e.max}`))
|
|
563
563
|
});
|
|
564
|
-
},
|
|
564
|
+
}, L = (e)=>{
|
|
565
565
|
let { children: t } = e;
|
|
566
566
|
return (0, l.jsx)(l.Fragment, {
|
|
567
567
|
children: t
|
|
568
568
|
});
|
|
569
569
|
};
|
|
570
|
-
var
|
|
571
|
-
let
|
|
570
|
+
var q = s(7419), H = s(9241), J = s(4562);
|
|
571
|
+
let V = (e)=>(0, l.jsxs)("svg", {
|
|
572
572
|
xmlns: "http://www.w3.org/2000/svg",
|
|
573
573
|
fill: "none",
|
|
574
574
|
viewBox: "0 0 217 200",
|
|
@@ -1461,13 +1461,13 @@
|
|
|
1461
1461
|
]
|
|
1462
1462
|
})
|
|
1463
1463
|
]
|
|
1464
|
-
}),
|
|
1465
|
-
let { theme: t, onThemeToggle: s, isConnected: r, token: o, counts: a } = e, [i,
|
|
1466
|
-
(0,
|
|
1464
|
+
}), X = (e)=>{
|
|
1465
|
+
let { theme: t, onThemeToggle: s, isConnected: r, token: o, counts: a } = e, [i, n] = (0, c.useState)(0), d = (0, c.useRef)(a);
|
|
1466
|
+
(0, c.useEffect)(()=>{
|
|
1467
1467
|
let e = d.current;
|
|
1468
1468
|
if (e.pass !== a.pass || e.fail !== a.fail || e.running !== a.running) {
|
|
1469
1469
|
let e = setTimeout(()=>{
|
|
1470
|
-
|
|
1470
|
+
n((e)=>e + 1);
|
|
1471
1471
|
}, 100);
|
|
1472
1472
|
return ()=>clearTimeout(e);
|
|
1473
1473
|
}
|
|
@@ -1475,10 +1475,10 @@
|
|
|
1475
1475
|
}, [
|
|
1476
1476
|
a
|
|
1477
1477
|
]);
|
|
1478
|
-
let
|
|
1479
|
-
system:
|
|
1480
|
-
light:
|
|
1481
|
-
dark:
|
|
1478
|
+
let u = a.idle + a.running + a.pass + a.fail + a.skip, f = (e)=>0 === u ? 0 : e / u * 100, x = f(a.pass), m = f(a.fail), g = f(a.running), j = {
|
|
1479
|
+
system: q.A,
|
|
1480
|
+
light: H.A,
|
|
1481
|
+
dark: J.A
|
|
1482
1482
|
}[t];
|
|
1483
1483
|
return (0, l.jsxs)("div", {
|
|
1484
1484
|
className: "relative flex h-[48px] items-center justify-between px-4",
|
|
@@ -1490,7 +1490,7 @@
|
|
|
1490
1490
|
(0, l.jsxs)("div", {
|
|
1491
1491
|
className: "flex items-center gap-2",
|
|
1492
1492
|
children: [
|
|
1493
|
-
(0, l.jsx)(
|
|
1493
|
+
(0, l.jsx)(V, {
|
|
1494
1494
|
className: "h-6 transition-all"
|
|
1495
1495
|
}),
|
|
1496
1496
|
(0, l.jsxs)("div", {
|
|
@@ -1511,7 +1511,7 @@
|
|
|
1511
1511
|
(0, l.jsxs)("div", {
|
|
1512
1512
|
className: "flex items-center gap-3",
|
|
1513
1513
|
children: [
|
|
1514
|
-
(0, l.jsx)(
|
|
1514
|
+
(0, l.jsx)(p.A, {
|
|
1515
1515
|
title: r ? "Connected" : "Connecting...",
|
|
1516
1516
|
mouseLeaveDelay: 0,
|
|
1517
1517
|
children: (0, l.jsx)("span", {
|
|
@@ -1521,14 +1521,14 @@
|
|
|
1521
1521
|
}
|
|
1522
1522
|
})
|
|
1523
1523
|
}),
|
|
1524
|
-
(0, l.jsx)(
|
|
1524
|
+
(0, l.jsx)(p.A, {
|
|
1525
1525
|
title: {
|
|
1526
1526
|
system: "Theme: System",
|
|
1527
1527
|
light: "Theme: Light",
|
|
1528
1528
|
dark: "Theme: Dark"
|
|
1529
1529
|
}[t],
|
|
1530
1530
|
mouseLeaveDelay: 0,
|
|
1531
|
-
children: (0, l.jsx)(
|
|
1531
|
+
children: (0, l.jsx)(h.Ay, {
|
|
1532
1532
|
type: "text",
|
|
1533
1533
|
size: "small",
|
|
1534
1534
|
className: "flex h-8 w-8 items-center justify-center rounded-md p-0",
|
|
@@ -1585,8 +1585,8 @@
|
|
|
1585
1585
|
]
|
|
1586
1586
|
});
|
|
1587
1587
|
};
|
|
1588
|
-
var
|
|
1589
|
-
let
|
|
1588
|
+
var K = s(6920), Y = s(4923), Q = s(8346), ee = s(407), et = s(5952), es = s(5283);
|
|
1589
|
+
let el = (0, c.memo)((e)=>{
|
|
1590
1590
|
let { counts: t, isRunning: s } = e, r = s && 0 === t.running;
|
|
1591
1591
|
return (0, l.jsx)("div", {
|
|
1592
1592
|
className: "flex h-6 cursor-default select-none items-center",
|
|
@@ -1610,7 +1610,7 @@
|
|
|
1610
1610
|
}
|
|
1611
1611
|
].map((e)=>{
|
|
1612
1612
|
let s = t[e.key] || 0, o = "running" === e.key;
|
|
1613
|
-
return (0, l.jsxs)(
|
|
1613
|
+
return (0, l.jsxs)(es.A, {
|
|
1614
1614
|
className: `m-0 flex items-center gap-1 px-2 py-0 border-0 ${o && r ? "animate-pulse" : ""}`,
|
|
1615
1615
|
style: {
|
|
1616
1616
|
display: "flex",
|
|
@@ -1644,7 +1644,7 @@
|
|
|
1644
1644
|
})
|
|
1645
1645
|
})
|
|
1646
1646
|
});
|
|
1647
|
-
}),
|
|
1647
|
+
}), er = (e)=>{
|
|
1648
1648
|
let { token: t, filterText: s, onFilterChange: r, isAllExpanded: o, onToggleExpandAll: a, onRerun: i, counts: n, isRunning: c } = e;
|
|
1649
1649
|
return (0, l.jsxs)("div", {
|
|
1650
1650
|
className: "flex flex-col gap-3 px-4 py-3",
|
|
@@ -1657,7 +1657,7 @@
|
|
|
1657
1657
|
className: "flex items-center justify-between",
|
|
1658
1658
|
children: [
|
|
1659
1659
|
(0, l.jsx)("div", {
|
|
1660
|
-
children: (0, l.jsx)(
|
|
1660
|
+
children: (0, l.jsx)(el, {
|
|
1661
1661
|
counts: n,
|
|
1662
1662
|
isRunning: c
|
|
1663
1663
|
})
|
|
@@ -1665,16 +1665,16 @@
|
|
|
1665
1665
|
(0, l.jsxs)("div", {
|
|
1666
1666
|
className: "flex items-center gap-1",
|
|
1667
1667
|
children: [
|
|
1668
|
-
(0, l.jsx)(
|
|
1668
|
+
(0, l.jsx)(p.A, {
|
|
1669
1669
|
title: o ? "Collapse all" : "Expand all",
|
|
1670
1670
|
mouseLeaveDelay: 0,
|
|
1671
|
-
children: (0, l.jsx)(
|
|
1671
|
+
children: (0, l.jsx)(h.Ay, {
|
|
1672
1672
|
type: "text",
|
|
1673
1673
|
size: "small",
|
|
1674
|
-
icon: o ? (0, l.jsx)(
|
|
1674
|
+
icon: o ? (0, l.jsx)(Y.A, {
|
|
1675
1675
|
size: 13,
|
|
1676
1676
|
strokeWidth: 2.5
|
|
1677
|
-
}) : (0, l.jsx)(
|
|
1677
|
+
}) : (0, l.jsx)(Q.A, {
|
|
1678
1678
|
size: 13,
|
|
1679
1679
|
strokeWidth: 2.5
|
|
1680
1680
|
}),
|
|
@@ -1686,13 +1686,13 @@
|
|
|
1686
1686
|
}
|
|
1687
1687
|
})
|
|
1688
1688
|
}),
|
|
1689
|
-
(0, l.jsx)(
|
|
1689
|
+
(0, l.jsx)(p.A, {
|
|
1690
1690
|
title: "Re-run all tests",
|
|
1691
1691
|
mouseLeaveDelay: 0,
|
|
1692
|
-
children: (0, l.jsx)(
|
|
1692
|
+
children: (0, l.jsx)(h.Ay, {
|
|
1693
1693
|
type: "text",
|
|
1694
1694
|
size: "small",
|
|
1695
|
-
icon: (0, l.jsx)(
|
|
1695
|
+
icon: (0, l.jsx)(ee.A, {
|
|
1696
1696
|
size: 15,
|
|
1697
1697
|
strokeWidth: 2.5
|
|
1698
1698
|
}),
|
|
@@ -1709,9 +1709,9 @@
|
|
|
1709
1709
|
})
|
|
1710
1710
|
]
|
|
1711
1711
|
}),
|
|
1712
|
-
(0, l.jsx)(
|
|
1712
|
+
(0, l.jsx)(K.A, {
|
|
1713
1713
|
placeholder: "Search tests...",
|
|
1714
|
-
prefix: (0, l.jsx)(
|
|
1714
|
+
prefix: (0, l.jsx)(et.A, {
|
|
1715
1715
|
size: 14,
|
|
1716
1716
|
strokeWidth: 2.5,
|
|
1717
1717
|
className: "opacity-40"
|
|
@@ -1725,14 +1725,14 @@
|
|
|
1725
1725
|
]
|
|
1726
1726
|
});
|
|
1727
1727
|
};
|
|
1728
|
-
var
|
|
1729
|
-
let
|
|
1728
|
+
var eo = s(3451), ea = s(4947), ei = s(2559), en = s(7957), ec = s(719);
|
|
1729
|
+
let ed = [
|
|
1730
1730
|
"pass",
|
|
1731
1731
|
"fail",
|
|
1732
1732
|
"skip"
|
|
1733
|
-
],
|
|
1734
|
-
let { icon: t, iconColor: s, status: r, label: o, caseId: a, onRerun: i, buttonTextColor:
|
|
1735
|
-
return (0,
|
|
1733
|
+
], eu = (e)=>{
|
|
1734
|
+
let { icon: t, iconColor: s, status: r, label: o, caseId: a, onRerun: i, buttonTextColor: n } = e, d = (0, c.useRef)(null), [u, f] = (0, c.useState)(0), x = ed.includes(r);
|
|
1735
|
+
return (0, c.useEffect)(()=>{
|
|
1736
1736
|
x && null !== d.current && d.current !== r && f((e)=>e + 1), d.current = r;
|
|
1737
1737
|
}, [
|
|
1738
1738
|
r,
|
|
@@ -1743,13 +1743,13 @@
|
|
|
1743
1743
|
"data-test-case": a,
|
|
1744
1744
|
children: [
|
|
1745
1745
|
t && (0, l.jsx)("span", {
|
|
1746
|
-
className: `flex w-[16px] shrink-0 items-center justify-center ${
|
|
1746
|
+
className: `flex w-[16px] shrink-0 items-center justify-center ${u > 0 ? "status-icon-flash" : ""}`,
|
|
1747
1747
|
style: {
|
|
1748
1748
|
color: s
|
|
1749
1749
|
},
|
|
1750
1750
|
children: t
|
|
1751
|
-
},
|
|
1752
|
-
(0, l.jsx)(
|
|
1751
|
+
}, u),
|
|
1752
|
+
(0, l.jsx)(p.A, {
|
|
1753
1753
|
title: o,
|
|
1754
1754
|
mouseLeaveDelay: 0,
|
|
1755
1755
|
children: (0, l.jsx)("span", {
|
|
@@ -1759,13 +1759,13 @@
|
|
|
1759
1759
|
}),
|
|
1760
1760
|
(0, l.jsx)("div", {
|
|
1761
1761
|
className: "opacity-0 transition-opacity duration-200 group-hover:opacity-100",
|
|
1762
|
-
children: (0, l.jsx)(
|
|
1762
|
+
children: (0, l.jsx)(p.A, {
|
|
1763
1763
|
title: "Re-run this test",
|
|
1764
1764
|
mouseLeaveDelay: 0,
|
|
1765
|
-
children: (0, l.jsx)(
|
|
1765
|
+
children: (0, l.jsx)(h.Ay, {
|
|
1766
1766
|
type: "text",
|
|
1767
1767
|
size: "small",
|
|
1768
|
-
icon: (0, l.jsx)(
|
|
1768
|
+
icon: (0, l.jsx)(ee.A, {
|
|
1769
1769
|
size: 14,
|
|
1770
1770
|
strokeWidth: 2.5
|
|
1771
1771
|
}),
|
|
@@ -1776,20 +1776,20 @@
|
|
|
1776
1776
|
className: "inline-flex h-5 w-5 items-center justify-center p-0",
|
|
1777
1777
|
"data-testid": "test-case-rerun",
|
|
1778
1778
|
style: {
|
|
1779
|
-
color:
|
|
1779
|
+
color: n
|
|
1780
1780
|
}
|
|
1781
1781
|
})
|
|
1782
1782
|
})
|
|
1783
1783
|
})
|
|
1784
1784
|
]
|
|
1785
1785
|
});
|
|
1786
|
-
},
|
|
1786
|
+
}, ep = [
|
|
1787
1787
|
"pass",
|
|
1788
1788
|
"fail"
|
|
1789
|
-
],
|
|
1790
|
-
let { icon: t, iconColor: s, status: r, relativePath: o, filePath: a, onOpen: i, onRerun:
|
|
1791
|
-
return (0,
|
|
1792
|
-
g && null !==
|
|
1789
|
+
], eh = (e)=>{
|
|
1790
|
+
let { icon: t, iconColor: s, status: r, relativePath: o, filePath: a, onOpen: i, onRerun: n, textColor: d } = e, u = (0, c.useRef)(null), [f, x] = (0, c.useState)(0), g = ep.includes(r);
|
|
1791
|
+
return (0, c.useEffect)(()=>{
|
|
1792
|
+
g && null !== u.current && u.current !== r && x((e)=>e + 1), u.current = r;
|
|
1793
1793
|
}, [
|
|
1794
1794
|
r,
|
|
1795
1795
|
g
|
|
@@ -1805,7 +1805,7 @@
|
|
|
1805
1805
|
},
|
|
1806
1806
|
children: t
|
|
1807
1807
|
}, f),
|
|
1808
|
-
(0, l.jsx)(
|
|
1808
|
+
(0, l.jsx)(p.A, {
|
|
1809
1809
|
title: o,
|
|
1810
1810
|
styles: {
|
|
1811
1811
|
container: {
|
|
@@ -1822,13 +1822,13 @@
|
|
|
1822
1822
|
(0, l.jsxs)("div", {
|
|
1823
1823
|
className: "flex items-center gap-1 opacity-0 transition-opacity duration-200 group-hover:opacity-100",
|
|
1824
1824
|
children: [
|
|
1825
|
-
(0, l.jsx)(
|
|
1825
|
+
(0, l.jsx)(p.A, {
|
|
1826
1826
|
title: "Open in editor",
|
|
1827
1827
|
mouseLeaveDelay: 0,
|
|
1828
|
-
children: (0, l.jsx)(
|
|
1828
|
+
children: (0, l.jsx)(h.Ay, {
|
|
1829
1829
|
type: "text",
|
|
1830
1830
|
size: "small",
|
|
1831
|
-
icon: (0, l.jsx)(
|
|
1831
|
+
icon: (0, l.jsx)(m.A, {
|
|
1832
1832
|
size: 14,
|
|
1833
1833
|
strokeWidth: 2.5
|
|
1834
1834
|
}),
|
|
@@ -1842,19 +1842,19 @@
|
|
|
1842
1842
|
}
|
|
1843
1843
|
})
|
|
1844
1844
|
}),
|
|
1845
|
-
(0, l.jsx)(
|
|
1845
|
+
(0, l.jsx)(p.A, {
|
|
1846
1846
|
title: "Re-run this file",
|
|
1847
1847
|
mouseLeaveDelay: 0,
|
|
1848
|
-
children: (0, l.jsx)(
|
|
1848
|
+
children: (0, l.jsx)(h.Ay, {
|
|
1849
1849
|
type: "text",
|
|
1850
1850
|
size: "small",
|
|
1851
|
-
icon: (0, l.jsx)(
|
|
1851
|
+
icon: (0, l.jsx)(ee.A, {
|
|
1852
1852
|
size: 14,
|
|
1853
1853
|
strokeWidth: 2.5
|
|
1854
1854
|
}),
|
|
1855
|
-
disabled: !
|
|
1855
|
+
disabled: !n,
|
|
1856
1856
|
onClick: (e)=>{
|
|
1857
|
-
e.stopPropagation(),
|
|
1857
|
+
e.stopPropagation(), n?.();
|
|
1858
1858
|
},
|
|
1859
1859
|
className: "inline-flex h-5 w-5 items-center justify-center p-0",
|
|
1860
1860
|
"data-testid": "test-file-rerun",
|
|
@@ -1867,13 +1867,13 @@
|
|
|
1867
1867
|
})
|
|
1868
1868
|
]
|
|
1869
1869
|
});
|
|
1870
|
-
},
|
|
1870
|
+
}, ef = [
|
|
1871
1871
|
"pass",
|
|
1872
1872
|
"fail",
|
|
1873
1873
|
"skip"
|
|
1874
|
-
],
|
|
1875
|
-
let { icon: t, iconColor: s, status: r, name: o, fullName: a, onRerun: i, buttonTextColor:
|
|
1876
|
-
return (0,
|
|
1874
|
+
], ex = (e)=>{
|
|
1875
|
+
let { icon: t, iconColor: s, status: r, name: o, fullName: a, onRerun: i, buttonTextColor: n } = e, d = (0, c.useRef)(null), [u, f] = (0, c.useState)(0), x = ef.includes(r);
|
|
1876
|
+
return (0, c.useEffect)(()=>{
|
|
1877
1877
|
x && null !== d.current && d.current !== r && f((e)=>e + 1), d.current = r;
|
|
1878
1878
|
}, [
|
|
1879
1879
|
r,
|
|
@@ -1884,13 +1884,13 @@
|
|
|
1884
1884
|
"data-test-suite": a,
|
|
1885
1885
|
children: [
|
|
1886
1886
|
t && (0, l.jsx)("span", {
|
|
1887
|
-
className: `flex w-[16px] shrink-0 items-center justify-center ${
|
|
1887
|
+
className: `flex w-[16px] shrink-0 items-center justify-center ${u > 0 ? "status-icon-flash" : ""}`,
|
|
1888
1888
|
style: {
|
|
1889
1889
|
color: s
|
|
1890
1890
|
},
|
|
1891
1891
|
children: t
|
|
1892
|
-
},
|
|
1893
|
-
(0, l.jsx)(
|
|
1892
|
+
}, u),
|
|
1893
|
+
(0, l.jsx)(p.A, {
|
|
1894
1894
|
title: o,
|
|
1895
1895
|
mouseLeaveDelay: 0,
|
|
1896
1896
|
children: (0, l.jsx)("span", {
|
|
@@ -1900,13 +1900,13 @@
|
|
|
1900
1900
|
}),
|
|
1901
1901
|
(0, l.jsx)("div", {
|
|
1902
1902
|
className: "opacity-0 transition-opacity duration-200 group-hover:opacity-100",
|
|
1903
|
-
children: (0, l.jsx)(
|
|
1903
|
+
children: (0, l.jsx)(p.A, {
|
|
1904
1904
|
title: "Re-run this suite",
|
|
1905
1905
|
mouseLeaveDelay: 0,
|
|
1906
|
-
children: (0, l.jsx)(
|
|
1906
|
+
children: (0, l.jsx)(h.Ay, {
|
|
1907
1907
|
type: "text",
|
|
1908
1908
|
size: "small",
|
|
1909
|
-
icon: (0, l.jsx)(
|
|
1909
|
+
icon: (0, l.jsx)(ee.A, {
|
|
1910
1910
|
size: 14,
|
|
1911
1911
|
strokeWidth: 2.5
|
|
1912
1912
|
}),
|
|
@@ -1917,15 +1917,15 @@
|
|
|
1917
1917
|
className: "inline-flex h-5 w-5 items-center justify-center p-0",
|
|
1918
1918
|
"data-testid": "test-suite-rerun",
|
|
1919
1919
|
style: {
|
|
1920
|
-
color:
|
|
1920
|
+
color: n
|
|
1921
1921
|
}
|
|
1922
1922
|
})
|
|
1923
1923
|
})
|
|
1924
1924
|
})
|
|
1925
1925
|
]
|
|
1926
1926
|
});
|
|
1927
|
-
},
|
|
1928
|
-
let { testFiles: t, statusMap: s, caseMap: r, rootPath: o, projects: a, loading: i, connected:
|
|
1927
|
+
}, em = (e)=>{
|
|
1928
|
+
let { testFiles: t, statusMap: s, caseMap: r, rootPath: o, projects: a, loading: i, connected: n, openFiles: d, activeFile: u, token: p, filterText: h, onExpandChange: f, onSelect: x, onRerunFile: m, onRerunTestCase: v } = e, { filteredTestFiles: y, filteredCaseMap: _ } = (0, c.useMemo)(()=>{
|
|
1929
1929
|
if (!h.trim()) return {
|
|
1930
1930
|
filteredTestFiles: t,
|
|
1931
1931
|
filteredCaseMap: r
|
|
@@ -1944,7 +1944,7 @@
|
|
|
1944
1944
|
t,
|
|
1945
1945
|
r,
|
|
1946
1946
|
h
|
|
1947
|
-
]),
|
|
1947
|
+
]), C = (0, c.useCallback)((e, t)=>{
|
|
1948
1948
|
if (0 === t.length) return [
|
|
1949
1949
|
{
|
|
1950
1950
|
key: `${e}::__empty`,
|
|
@@ -1985,16 +1985,16 @@
|
|
|
1985
1985
|
}, o = (t, s)=>{
|
|
1986
1986
|
let a = [];
|
|
1987
1987
|
for (let i of t.children.values()){
|
|
1988
|
-
let t = r(i),
|
|
1988
|
+
let t = r(i), c = k[t], d = `${s}::suite::${i.fullPath.join("::")}`, u = i.fullPath.join(" ");
|
|
1989
1989
|
a.push({
|
|
1990
1990
|
key: d,
|
|
1991
|
-
title: (0, l.jsx)(
|
|
1992
|
-
icon:
|
|
1993
|
-
iconColor:
|
|
1991
|
+
title: (0, l.jsx)(ex, {
|
|
1992
|
+
icon: c.icon,
|
|
1993
|
+
iconColor: c.color,
|
|
1994
1994
|
status: t,
|
|
1995
1995
|
name: i.name,
|
|
1996
1996
|
fullName: u,
|
|
1997
|
-
onRerun:
|
|
1997
|
+
onRerun: n ? ()=>{
|
|
1998
1998
|
v(e, u);
|
|
1999
1999
|
} : void 0,
|
|
2000
2000
|
buttonTextColor: p.colorTextSecondary
|
|
@@ -2004,16 +2004,16 @@
|
|
|
2004
2004
|
});
|
|
2005
2005
|
}
|
|
2006
2006
|
for (let r of t.cases){
|
|
2007
|
-
let t =
|
|
2007
|
+
let t = k[r.status];
|
|
2008
2008
|
a.push({
|
|
2009
2009
|
key: `${s}::case::${r.id}`,
|
|
2010
|
-
title: (0, l.jsx)(
|
|
2010
|
+
title: (0, l.jsx)(eu, {
|
|
2011
2011
|
icon: t.icon,
|
|
2012
2012
|
iconColor: t.color,
|
|
2013
2013
|
status: r.status,
|
|
2014
2014
|
label: r.name,
|
|
2015
2015
|
caseId: r.id,
|
|
2016
|
-
onRerun:
|
|
2016
|
+
onRerun: n ? ()=>{
|
|
2017
2017
|
v(e, r.fullName);
|
|
2018
2018
|
} : void 0,
|
|
2019
2019
|
buttonTextColor: p.colorTextSecondary
|
|
@@ -2026,37 +2026,37 @@
|
|
|
2026
2026
|
};
|
|
2027
2027
|
return o(s, e);
|
|
2028
2028
|
}, [
|
|
2029
|
-
|
|
2029
|
+
n,
|
|
2030
2030
|
v,
|
|
2031
2031
|
p.colorTextSecondary
|
|
2032
|
-
]),
|
|
2032
|
+
]), w = (0, c.useMemo)(()=>{
|
|
2033
2033
|
let e = [
|
|
2034
2034
|
...new Set(y.map((e)=>e.projectName))
|
|
2035
2035
|
], t = new Map;
|
|
2036
2036
|
for (let e of a)t.set(e.name, e.projectRoot);
|
|
2037
2037
|
let r = (e, t)=>{
|
|
2038
|
-
let r = e.testPath, a = s[r] ?? "idle", i =
|
|
2038
|
+
let r = e.testPath, a = s[r] ?? "idle", i = b[a], c = g(r, t ?? o), d = Object.values(_[r] ?? {});
|
|
2039
2039
|
return {
|
|
2040
2040
|
key: r,
|
|
2041
|
-
title: (0, l.jsx)(
|
|
2041
|
+
title: (0, l.jsx)(eh, {
|
|
2042
2042
|
icon: i.icon,
|
|
2043
2043
|
iconColor: i.color,
|
|
2044
2044
|
status: a,
|
|
2045
|
-
relativePath:
|
|
2045
|
+
relativePath: c,
|
|
2046
2046
|
filePath: r,
|
|
2047
|
-
onOpen: ()=>
|
|
2048
|
-
onRerun:
|
|
2049
|
-
|
|
2047
|
+
onOpen: ()=>j(r),
|
|
2048
|
+
onRerun: n ? ()=>{
|
|
2049
|
+
m(r);
|
|
2050
2050
|
} : void 0,
|
|
2051
2051
|
textColor: p.colorTextSecondary
|
|
2052
2052
|
}),
|
|
2053
|
-
children:
|
|
2053
|
+
children: C(r, d)
|
|
2054
2054
|
};
|
|
2055
2055
|
};
|
|
2056
2056
|
return e.length > 1 ? e.map((e)=>{
|
|
2057
2057
|
let o = y.filter((t)=>t.projectName === e), a = `__project__${e}`, i = t.get(e), n = o.map((e)=>s[e.testPath] ?? "idle"), c = "idle";
|
|
2058
2058
|
n.some((e)=>"fail" === e) ? c = "fail" : n.some((e)=>"running" === e) ? c = "running" : n.length > 0 && n.every((e)=>"pass" === e) && (c = "pass");
|
|
2059
|
-
let d =
|
|
2059
|
+
let d = b[c];
|
|
2060
2060
|
return {
|
|
2061
2061
|
key: a,
|
|
2062
2062
|
title: (0, l.jsxs)("div", {
|
|
@@ -2064,7 +2064,7 @@
|
|
|
2064
2064
|
"data-testid": "test-project-title",
|
|
2065
2065
|
"data-test-project": e,
|
|
2066
2066
|
children: [
|
|
2067
|
-
(0, l.jsx)(
|
|
2067
|
+
(0, l.jsx)(ei.A, {
|
|
2068
2068
|
size: 14,
|
|
2069
2069
|
style: {
|
|
2070
2070
|
color: d.color
|
|
@@ -2086,10 +2086,10 @@
|
|
|
2086
2086
|
};
|
|
2087
2087
|
}) : y.map((e)=>r(e));
|
|
2088
2088
|
}, [
|
|
2089
|
-
|
|
2089
|
+
C,
|
|
2090
2090
|
_,
|
|
2091
|
-
|
|
2092
|
-
|
|
2091
|
+
n,
|
|
2092
|
+
m,
|
|
2093
2093
|
a,
|
|
2094
2094
|
o,
|
|
2095
2095
|
s,
|
|
@@ -2105,12 +2105,12 @@
|
|
|
2105
2105
|
].map((e)=>(0, l.jsxs)("div", {
|
|
2106
2106
|
className: "flex items-center gap-2",
|
|
2107
2107
|
children: [
|
|
2108
|
-
(0, l.jsx)(
|
|
2108
|
+
(0, l.jsx)(eo.A.Avatar, {
|
|
2109
2109
|
active: !0,
|
|
2110
2110
|
size: "small",
|
|
2111
2111
|
shape: "circle"
|
|
2112
2112
|
}),
|
|
2113
|
-
(0, l.jsx)(
|
|
2113
|
+
(0, l.jsx)(eo.A.Input, {
|
|
2114
2114
|
active: !0,
|
|
2115
2115
|
size: "small",
|
|
2116
2116
|
style: {
|
|
@@ -2119,7 +2119,7 @@
|
|
|
2119
2119
|
})
|
|
2120
2120
|
]
|
|
2121
2121
|
}, e))
|
|
2122
|
-
}) :
|
|
2122
|
+
}) : n ? 0 === t.length ? (0, l.jsx)("div", {
|
|
2123
2123
|
className: "flex h-full items-center justify-center",
|
|
2124
2124
|
children: (0, l.jsx)("span", {
|
|
2125
2125
|
className: "text-(--muted-foreground)",
|
|
@@ -2131,14 +2131,14 @@
|
|
|
2131
2131
|
className: "text-(--muted-foreground)",
|
|
2132
2132
|
children: "No matching tests found"
|
|
2133
2133
|
})
|
|
2134
|
-
}) : (0, l.jsx)(
|
|
2134
|
+
}) : (0, l.jsx)(ea.A, {
|
|
2135
2135
|
blockNode: !0,
|
|
2136
2136
|
"data-testid": "test-files-tree",
|
|
2137
2137
|
showLine: !1,
|
|
2138
|
-
switcherIcon: (e)=>e.expanded ? (0, l.jsx)(
|
|
2138
|
+
switcherIcon: (e)=>e.expanded ? (0, l.jsx)(en.A, {
|
|
2139
2139
|
size: 12,
|
|
2140
2140
|
strokeWidth: 2.5
|
|
2141
|
-
}) : (0, l.jsx)(
|
|
2141
|
+
}) : (0, l.jsx)(ec.A, {
|
|
2142
2142
|
size: 12,
|
|
2143
2143
|
strokeWidth: 2.5
|
|
2144
2144
|
}),
|
|
@@ -2153,7 +2153,7 @@
|
|
|
2153
2153
|
let s = t.node.key, l = y.map((e)=>e.testPath);
|
|
2154
2154
|
"string" == typeof s && l.includes(s) && x(s);
|
|
2155
2155
|
},
|
|
2156
|
-
treeData:
|
|
2156
|
+
treeData: w,
|
|
2157
2157
|
className: "bg-transparent",
|
|
2158
2158
|
style: {
|
|
2159
2159
|
marginLeft: "16px"
|
|
@@ -2165,11 +2165,11 @@
|
|
|
2165
2165
|
children: "Reconnecting..."
|
|
2166
2166
|
})
|
|
2167
2167
|
});
|
|
2168
|
-
},
|
|
2168
|
+
}, eg = (e)=>{
|
|
2169
2169
|
if (!e) return {
|
|
2170
2170
|
mode: "full"
|
|
2171
2171
|
};
|
|
2172
|
-
if ("string" == typeof e &&
|
|
2172
|
+
if ("string" == typeof e && T(e)) return {
|
|
2173
2173
|
mode: "preset",
|
|
2174
2174
|
preset: e,
|
|
2175
2175
|
orientation: "portrait"
|
|
@@ -2185,14 +2185,14 @@
|
|
|
2185
2185
|
return {
|
|
2186
2186
|
mode: "full"
|
|
2187
2187
|
};
|
|
2188
|
-
},
|
|
2189
|
-
let { token: t, selection: s, active: r, onResponsiveResize: o, children: a, ...i } = e,
|
|
2188
|
+
}, ej = (e, t, s)=>Math.min(s, Math.max(t, e)), ev = (e)=>{
|
|
2189
|
+
let { token: t, selection: s, active: r, onResponsiveResize: o, children: a, ...i } = e, n = (0, c.useRef)(null), d = ((e)=>{
|
|
2190
2190
|
if ("full" === e.mode) return null;
|
|
2191
2191
|
if ("responsive" === e.mode) return {
|
|
2192
2192
|
width: e.width,
|
|
2193
2193
|
height: e.height
|
|
2194
2194
|
};
|
|
2195
|
-
let t =
|
|
2195
|
+
let t = I(e.preset);
|
|
2196
2196
|
return "landscape" === e.orientation ? {
|
|
2197
2197
|
width: t.height,
|
|
2198
2198
|
height: t.width
|
|
@@ -2201,9 +2201,9 @@
|
|
|
2201
2201
|
height: t.height
|
|
2202
2202
|
};
|
|
2203
2203
|
})(s);
|
|
2204
|
-
return ((0,
|
|
2204
|
+
return ((0, c.useLayoutEffect)(()=>{
|
|
2205
2205
|
if (!r || "responsive" !== s.mode || !o) return;
|
|
2206
|
-
let e =
|
|
2206
|
+
let e = n.current;
|
|
2207
2207
|
if (!e) return;
|
|
2208
2208
|
let t = !0, l = new ResizeObserver((e)=>{
|
|
2209
2209
|
let l = e[0]?.contentRect;
|
|
@@ -2213,7 +2213,7 @@
|
|
|
2213
2213
|
return;
|
|
2214
2214
|
}
|
|
2215
2215
|
if (l.width <= 0 || l.height <= 0) return;
|
|
2216
|
-
let r =
|
|
2216
|
+
let r = ej(Math.round(l.width), 1, 1e4), a = ej(Math.round(l.height), 1, 1e4);
|
|
2217
2217
|
(r !== s.width || a !== s.height) && o({
|
|
2218
2218
|
width: r,
|
|
2219
2219
|
height: a
|
|
@@ -2227,7 +2227,7 @@
|
|
|
2227
2227
|
]), d) ? (0, l.jsx)("div", {
|
|
2228
2228
|
className: "flex h-full w-full items-start justify-center p-4 overflow-auto",
|
|
2229
2229
|
children: (0, l.jsx)("div", {
|
|
2230
|
-
ref:
|
|
2230
|
+
ref: n,
|
|
2231
2231
|
className: "shrink-0 relative group",
|
|
2232
2232
|
style: {
|
|
2233
2233
|
width: d.width,
|
|
@@ -2254,7 +2254,21 @@
|
|
|
2254
2254
|
...i,
|
|
2255
2255
|
children: a
|
|
2256
2256
|
});
|
|
2257
|
-
},
|
|
2257
|
+
}, ey = (e)=>"object" == typeof e && null !== e, e_ = (e, t)=>"string" == typeof e[t], eC = (e)=>{
|
|
2258
|
+
let { filePath: t, test: s, status: l, previousCase: r } = e, o = (s.parentNames ?? []).filter(Boolean), a = [
|
|
2259
|
+
...o,
|
|
2260
|
+
s.name
|
|
2261
|
+
].join(" ") || s.name;
|
|
2262
|
+
return {
|
|
2263
|
+
id: s.testId,
|
|
2264
|
+
name: s.name,
|
|
2265
|
+
parentNames: o,
|
|
2266
|
+
fullName: a,
|
|
2267
|
+
status: l,
|
|
2268
|
+
filePath: s.testPath || r?.filePath || t,
|
|
2269
|
+
location: s.location ?? r?.location
|
|
2270
|
+
};
|
|
2271
|
+
}, ew = (e)=>"object" == typeof e && null !== e && "requestId" in e && "string" == typeof e.requestId ? e.requestId : "unknown-request", eb = async (e, t, s)=>{
|
|
2258
2272
|
if (null === s || "function" != typeof s.postMessage) return;
|
|
2259
2273
|
let l = (e)=>{
|
|
2260
2274
|
s.postMessage({
|
|
@@ -2262,8 +2276,8 @@
|
|
|
2262
2276
|
payload: e
|
|
2263
2277
|
}, "*");
|
|
2264
2278
|
};
|
|
2265
|
-
if ("unknown-request" ===
|
|
2266
|
-
requestId:
|
|
2279
|
+
if ("unknown-request" === ew(t)) return void l({
|
|
2280
|
+
requestId: ew(t),
|
|
2267
2281
|
error: "Invalid dispatch request payload: expected an object with string requestId."
|
|
2268
2282
|
});
|
|
2269
2283
|
if (!e) return void l({
|
|
@@ -2278,35 +2292,35 @@
|
|
|
2278
2292
|
error: e instanceof Error ? e.message : String(e)
|
|
2279
2293
|
});
|
|
2280
2294
|
}
|
|
2281
|
-
},
|
|
2295
|
+
}, ek = [
|
|
2282
2296
|
1e3,
|
|
2283
2297
|
2e3,
|
|
2284
2298
|
4e3,
|
|
2285
2299
|
8e3,
|
|
2286
2300
|
16e3,
|
|
2287
2301
|
3e4
|
|
2288
|
-
],
|
|
2302
|
+
], eS = function(e, t, s) {
|
|
2289
2303
|
let l = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], r = arguments.length > 4 ? arguments[4] : void 0, o = new URL("/runner.html", t || window.location.origin);
|
|
2290
2304
|
return o.searchParams.set("testFile", e), s && o.searchParams.set("testNamePattern", s), r && o.searchParams.set("runId", r), l && o.searchParams.set("t", Date.now().toString()), o.toString();
|
|
2291
2305
|
};
|
|
2292
|
-
var
|
|
2293
|
-
let
|
|
2306
|
+
var eF = s(5999);
|
|
2307
|
+
let eN = function() {
|
|
2294
2308
|
for(var e = arguments.length, t = Array(e), s = 0; s < e; s++)t[s] = arguments[s];
|
|
2295
2309
|
window.__RSTEST_BROWSER_OPTIONS__?.debug === !0 && console.log(...t);
|
|
2296
|
-
},
|
|
2310
|
+
}, eA = (e)=>{
|
|
2297
2311
|
try {
|
|
2298
2312
|
return new URL(e.src, window.location.href).searchParams.get("runId") ?? void 0;
|
|
2299
2313
|
} catch {
|
|
2300
2314
|
return;
|
|
2301
2315
|
}
|
|
2302
|
-
},
|
|
2303
|
-
let { options: t, theme: s, setTheme:
|
|
2316
|
+
}, eP = (e)=>Array.from(document.querySelectorAll("iframe[data-test-file]")).find((t)=>t.dataset.testFile === e), eM = (e)=>{
|
|
2317
|
+
let { options: t, theme: s, setTheme: i } = e, { token: n } = a.A.useToken(), [d, p] = (0, c.useState)([]), [h, f] = (0, c.useState)(null), [x, m] = (0, c.useState)({}), [g, j] = (0, c.useState)({}), [v, y] = (0, c.useState)([]), [_, C] = (0, c.useState)(""), [w, b] = (0, c.useState)({}), k = (0, c.useCallback)((e)=>{
|
|
2304
2318
|
let s = 5381;
|
|
2305
2319
|
for(let e = 0; e < t.rootPath.length; e++)s = 33 * s ^ t.rootPath.charCodeAt(e);
|
|
2306
2320
|
return `rstest-viewport:${(s >>> 0).toString(16)}:${e}`;
|
|
2307
2321
|
}, [
|
|
2308
2322
|
t.rootPath
|
|
2309
|
-
]), S = (0,
|
|
2323
|
+
]), S = (0, c.useCallback)((e)=>{
|
|
2310
2324
|
try {
|
|
2311
2325
|
let t = localStorage.getItem(k(e));
|
|
2312
2326
|
if (!t) return null;
|
|
@@ -2327,7 +2341,7 @@
|
|
|
2327
2341
|
}
|
|
2328
2342
|
if ("preset" === l) {
|
|
2329
2343
|
let e = s.preset, t = s.orientation;
|
|
2330
|
-
if (
|
|
2344
|
+
if (T(e) && ("portrait" === t || "landscape" === t)) return {
|
|
2331
2345
|
mode: "preset",
|
|
2332
2346
|
preset: e,
|
|
2333
2347
|
orientation: t
|
|
@@ -2339,120 +2353,121 @@
|
|
|
2339
2353
|
}
|
|
2340
2354
|
}, [
|
|
2341
2355
|
k
|
|
2342
|
-
]), F = (0,
|
|
2356
|
+
]), F = (0, c.useCallback)((e, t)=>{
|
|
2343
2357
|
try {
|
|
2344
2358
|
localStorage.setItem(k(e), JSON.stringify(t));
|
|
2345
2359
|
} catch {}
|
|
2346
2360
|
}, [
|
|
2347
2361
|
k
|
|
2348
|
-
]), [N, A] = (0,
|
|
2362
|
+
]), [N, A] = (0, c.useState)(()=>{
|
|
2349
2363
|
let e = {};
|
|
2350
|
-
for (let s of t.projects ?? [])e[s.name] = S(s.name) ??
|
|
2364
|
+
for (let s of t.projects ?? [])e[s.name] = S(s.name) ?? eg(s.viewport);
|
|
2351
2365
|
return e;
|
|
2352
2366
|
});
|
|
2353
|
-
(0,
|
|
2367
|
+
(0, c.useEffect)(()=>{
|
|
2354
2368
|
A((e)=>{
|
|
2355
2369
|
let s = {
|
|
2356
2370
|
...e
|
|
2357
2371
|
};
|
|
2358
|
-
for (let e of t.projects ?? [])s[e.name] || (s[e.name] = S(e.name) ??
|
|
2372
|
+
for (let e of t.projects ?? [])s[e.name] || (s[e.name] = S(e.name) ?? eg(e.viewport));
|
|
2359
2373
|
return s;
|
|
2360
2374
|
});
|
|
2361
2375
|
}, [
|
|
2362
2376
|
t.projects,
|
|
2363
2377
|
S
|
|
2364
2378
|
]);
|
|
2365
|
-
let P = (0,
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
};
|
|
2393
|
-
});
|
|
2394
|
-
let n = eb(e, t.runnerUrl, s, !1, i);
|
|
2395
|
-
eS("[Container] Setting iframe.src to:", n), a.src = n;
|
|
2396
|
-
})), [
|
|
2379
|
+
let P = (0, c.useCallback)(async (e, s)=>{
|
|
2380
|
+
eN("[Container] handleReloadTestFile called:", e, s), f(e);
|
|
2381
|
+
let l = document.querySelector(`iframe[data-test-file="${e}"]`);
|
|
2382
|
+
if (eN("[Container] Found iframe:", l), !l) throw Error(`Cannot reload test file "${e}": iframe not found`);
|
|
2383
|
+
let r = "function" == typeof globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : `run-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
2384
|
+
b((t)=>({
|
|
2385
|
+
...t,
|
|
2386
|
+
[e]: r
|
|
2387
|
+
})), m((t)=>({
|
|
2388
|
+
...t,
|
|
2389
|
+
[e]: "running"
|
|
2390
|
+
})), j((t)=>{
|
|
2391
|
+
let s = t[e] ?? {}, l = {};
|
|
2392
|
+
for (let [e, t] of Object.entries(s))l[e] = {
|
|
2393
|
+
...t,
|
|
2394
|
+
status: "running"
|
|
2395
|
+
};
|
|
2396
|
+
return {
|
|
2397
|
+
...t,
|
|
2398
|
+
[e]: l
|
|
2399
|
+
};
|
|
2400
|
+
});
|
|
2401
|
+
let o = eS(e, t.runnerUrl, s, !1, r);
|
|
2402
|
+
return eN("[Container] Setting iframe.src to:", o), l.src = o, {
|
|
2403
|
+
runId: r
|
|
2404
|
+
};
|
|
2405
|
+
}, [
|
|
2397
2406
|
t.runnerUrl
|
|
2398
|
-
]), { rpc: M, loading: z, connected:
|
|
2399
|
-
let [l, r] = (0,
|
|
2400
|
-
return (0,
|
|
2407
|
+
]), { rpc: M, loading: z, connected: O } = ((e, t, s)=>{
|
|
2408
|
+
let [l, r] = (0, c.useState)(null), [o, a] = (0, c.useState)(!0), [i, n] = (0, c.useState)(!1), d = (0, c.useRef)(e), u = (0, c.useRef)(s), p = (0, c.useRef)(null);
|
|
2409
|
+
return (0, c.useEffect)(()=>{
|
|
2401
2410
|
d.current = e;
|
|
2402
2411
|
}, [
|
|
2403
2412
|
e
|
|
2404
|
-
]), (0,
|
|
2413
|
+
]), (0, c.useEffect)(()=>{
|
|
2405
2414
|
u.current = s;
|
|
2406
2415
|
}, [
|
|
2407
2416
|
s
|
|
2408
|
-
]), (0,
|
|
2417
|
+
]), (0, c.useEffect)(()=>{
|
|
2409
2418
|
if (!t) return void a(!1);
|
|
2410
|
-
let e = null, s =
|
|
2411
|
-
let
|
|
2412
|
-
if (!
|
|
2413
|
-
p.current = e = new WebSocket((
|
|
2414
|
-
let
|
|
2419
|
+
let e = null, s = null, l = 0, o = null, i = !0, c = ()=>{
|
|
2420
|
+
let h;
|
|
2421
|
+
if (!i) return;
|
|
2422
|
+
p.current = e = new WebSocket((h = "https:" === window.location.protocol ? "wss:" : "ws:", `${h}//${window.location.hostname}:${t}`));
|
|
2423
|
+
let f = new WeakMap, x = {
|
|
2415
2424
|
onTestFileUpdate (e) {
|
|
2416
|
-
|
|
2425
|
+
eN("[Container RPC] onTestFileUpdate called:", e), d.current(e);
|
|
2417
2426
|
},
|
|
2418
2427
|
async reloadTestFile (e, t) {
|
|
2419
|
-
|
|
2428
|
+
if (eN("[Container RPC] reloadTestFile called:", e, t), !u.current) throw Error("reloadTestFile handler is not available");
|
|
2429
|
+
return u.current(e, t);
|
|
2420
2430
|
}
|
|
2421
2431
|
};
|
|
2422
2432
|
e.onopen = ()=>{
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
let t = (0, ek.L)(h, {
|
|
2433
|
+
i && e && (eN("[Container] WebSocket connected"), l = 0, n(!0), r(s = (0, eF.L)(x, {
|
|
2434
|
+
timeout: -1,
|
|
2426
2435
|
post: (t)=>{
|
|
2427
2436
|
e?.readyState === WebSocket.OPEN && e.send(JSON.stringify(t));
|
|
2428
2437
|
},
|
|
2429
2438
|
on: (t)=>{
|
|
2430
|
-
|
|
2439
|
+
if (!e) return;
|
|
2440
|
+
let s = (e)=>{
|
|
2431
2441
|
try {
|
|
2432
2442
|
let s = JSON.parse(e.data);
|
|
2433
2443
|
t(s);
|
|
2434
2444
|
} catch {}
|
|
2435
|
-
}
|
|
2445
|
+
};
|
|
2446
|
+
f.set(t, s), e.addEventListener("message", s);
|
|
2447
|
+
},
|
|
2448
|
+
off: (t)=>{
|
|
2449
|
+
if (!e) return;
|
|
2450
|
+
let s = f.get(t);
|
|
2451
|
+
s && (e.removeEventListener("message", s), f.delete(t));
|
|
2436
2452
|
}
|
|
2437
|
-
})
|
|
2438
|
-
|
|
2439
|
-
o && (d.current(e), a(!1));
|
|
2453
|
+
})), s.getTestFiles().then((e)=>{
|
|
2454
|
+
i && (d.current(e), a(!1));
|
|
2440
2455
|
}).catch(()=>{
|
|
2441
|
-
|
|
2442
|
-
});
|
|
2456
|
+
i && a(!1);
|
|
2457
|
+
}));
|
|
2443
2458
|
}, e.onclose = ()=>{
|
|
2444
|
-
if (p.current !== e || !
|
|
2445
|
-
|
|
2446
|
-
let t =
|
|
2447
|
-
|
|
2448
|
-
|
|
2459
|
+
if (p.current !== e || !i) return;
|
|
2460
|
+
eN("[Container] WebSocket disconnected"), s?.$close(Error("Container WebSocket disconnected")), r(null), n(!1);
|
|
2461
|
+
let t = ek[Math.min(l, ek.length - 1)];
|
|
2462
|
+
eN(`[Container] Reconnecting in ${t}ms (attempt ${l + 1})`), l++, o = setTimeout(()=>{
|
|
2463
|
+
i && c();
|
|
2449
2464
|
}, t);
|
|
2450
2465
|
}, e.onerror = ()=>{
|
|
2451
|
-
|
|
2466
|
+
i && eN("[Container] WebSocket error");
|
|
2452
2467
|
};
|
|
2453
2468
|
};
|
|
2454
|
-
return
|
|
2455
|
-
|
|
2469
|
+
return c(), ()=>{
|
|
2470
|
+
i = !1, o && clearTimeout(o), s?.$close(Error("Container RPC disposed")), e && e.close();
|
|
2456
2471
|
};
|
|
2457
2472
|
}, [
|
|
2458
2473
|
t
|
|
@@ -2461,47 +2476,42 @@
|
|
|
2461
2476
|
loading: o,
|
|
2462
2477
|
connected: i
|
|
2463
2478
|
};
|
|
2464
|
-
})(
|
|
2465
|
-
(0,
|
|
2466
|
-
|
|
2467
|
-
let e = Error("Browser runner unmounted before reload completed");
|
|
2468
|
-
for (let t of w.current.values())t.reject(e);
|
|
2469
|
-
w.current.clear();
|
|
2470
|
-
}, []), (0, n.useEffect)(()=>{
|
|
2471
|
-
x((e)=>{
|
|
2479
|
+
})(p, t?.wsPort, P);
|
|
2480
|
+
(0, c.useEffect)(()=>{
|
|
2481
|
+
m((e)=>{
|
|
2472
2482
|
let t = {};
|
|
2473
|
-
for (let s of
|
|
2483
|
+
for (let s of d)t[s.testPath] = e[s.testPath] ?? "idle";
|
|
2474
2484
|
return t;
|
|
2475
|
-
}),
|
|
2485
|
+
}), j((e)=>{
|
|
2476
2486
|
let t = {};
|
|
2477
|
-
for (let s of
|
|
2487
|
+
for (let s of d)t[s.testPath] = e[s.testPath] ?? {};
|
|
2478
2488
|
return t;
|
|
2479
2489
|
}), b((e)=>{
|
|
2480
2490
|
let t = {};
|
|
2481
|
-
for (let s of
|
|
2491
|
+
for (let s of d)e[s.testPath] && (t[s.testPath] = e[s.testPath]);
|
|
2482
2492
|
return t;
|
|
2483
2493
|
});
|
|
2484
|
-
let e =
|
|
2485
|
-
|
|
2494
|
+
let e = d.map((e)=>e.testPath);
|
|
2495
|
+
y((t)=>t.filter((t)=>e.includes(t))), f((t)=>!t && d.length > 0 || t && !e.includes(t) && d.length > 0 ? d[0].testPath : t);
|
|
2486
2496
|
}, [
|
|
2487
|
-
|
|
2488
|
-
]), (0,
|
|
2489
|
-
M &&
|
|
2490
|
-
|
|
2497
|
+
d
|
|
2498
|
+
]), (0, c.useEffect)(()=>{
|
|
2499
|
+
M && O && M.onRunnerFramesReady(d.map((e)=>e.testPath)).catch((e)=>{
|
|
2500
|
+
eN("[Container RPC] Failed to notify runner frames ready:", e);
|
|
2491
2501
|
});
|
|
2492
2502
|
}, [
|
|
2493
2503
|
M,
|
|
2494
|
-
|
|
2495
|
-
|
|
2504
|
+
O,
|
|
2505
|
+
d
|
|
2496
2506
|
]);
|
|
2497
|
-
let
|
|
2498
|
-
|
|
2499
|
-
}, []),
|
|
2507
|
+
let R = (0, c.useCallback)((e)=>"pass" === e ? "pass" : "fail" === e ? "fail" : "skip" === e || "todo" === e ? "skip" : "running", []), E = (0, c.useCallback)((e)=>{
|
|
2508
|
+
f(e);
|
|
2509
|
+
}, []), U = (0, c.useCallback)((e, t)=>{
|
|
2500
2510
|
let s = (t.parentNames ?? []).filter(Boolean), l = [
|
|
2501
2511
|
...s,
|
|
2502
2512
|
t.name
|
|
2503
2513
|
].join(" ") || t.name;
|
|
2504
|
-
|
|
2514
|
+
j((r)=>{
|
|
2505
2515
|
let o = r[e] ?? {};
|
|
2506
2516
|
return {
|
|
2507
2517
|
...r,
|
|
@@ -2512,7 +2522,7 @@
|
|
|
2512
2522
|
name: t.name,
|
|
2513
2523
|
parentNames: s,
|
|
2514
2524
|
fullName: l,
|
|
2515
|
-
status:
|
|
2525
|
+
status: R(t.status),
|
|
2516
2526
|
filePath: t.testPath || e,
|
|
2517
2527
|
location: t.location
|
|
2518
2528
|
}
|
|
@@ -2520,34 +2530,85 @@
|
|
|
2520
2530
|
};
|
|
2521
2531
|
});
|
|
2522
2532
|
}, [
|
|
2523
|
-
|
|
2524
|
-
]),
|
|
2525
|
-
|
|
2533
|
+
R
|
|
2534
|
+
]), $ = (0, c.useCallback)((e, t)=>{
|
|
2535
|
+
j((s)=>{
|
|
2536
|
+
let l = s[e] ?? {}, r = ((e)=>{
|
|
2537
|
+
let { filePath: t, tests: s, previousCases: l } = e, r = {}, o = (e)=>{
|
|
2538
|
+
if ("suite" === e.type) {
|
|
2539
|
+
for (let t of e.tests)o(t);
|
|
2540
|
+
return;
|
|
2541
|
+
}
|
|
2542
|
+
let s = l[e.testId];
|
|
2543
|
+
r[e.testId] = eC({
|
|
2544
|
+
filePath: t,
|
|
2545
|
+
test: e,
|
|
2546
|
+
status: s?.status ?? "idle",
|
|
2547
|
+
previousCase: s
|
|
2548
|
+
});
|
|
2549
|
+
};
|
|
2550
|
+
for (let e of s)o(e);
|
|
2551
|
+
return r;
|
|
2552
|
+
})({
|
|
2553
|
+
filePath: e,
|
|
2554
|
+
tests: t.tests,
|
|
2555
|
+
previousCases: l
|
|
2556
|
+
});
|
|
2557
|
+
return {
|
|
2558
|
+
...s,
|
|
2559
|
+
[e]: r
|
|
2560
|
+
};
|
|
2561
|
+
});
|
|
2562
|
+
}, []), I = (0, c.useCallback)((e, t)=>{
|
|
2563
|
+
j((s)=>{
|
|
2564
|
+
let l = s[e] ?? {};
|
|
2565
|
+
return {
|
|
2566
|
+
...s,
|
|
2567
|
+
[e]: ((e)=>{
|
|
2568
|
+
let { filePath: t, test: s, previousCases: l } = e, r = l[s.testId];
|
|
2569
|
+
return {
|
|
2570
|
+
...l,
|
|
2571
|
+
[s.testId]: eC({
|
|
2572
|
+
filePath: t,
|
|
2573
|
+
test: s,
|
|
2574
|
+
status: "running",
|
|
2575
|
+
previousCase: r
|
|
2576
|
+
})
|
|
2577
|
+
};
|
|
2578
|
+
})({
|
|
2579
|
+
filePath: e,
|
|
2580
|
+
test: t,
|
|
2581
|
+
previousCases: l
|
|
2582
|
+
})
|
|
2583
|
+
};
|
|
2584
|
+
});
|
|
2585
|
+
}, []), B = (0, c.useCallback)((e)=>{
|
|
2586
|
+
f(e), M && O && M.rerunTest(e);
|
|
2526
2587
|
}, [
|
|
2527
2588
|
M,
|
|
2528
|
-
|
|
2529
|
-
]),
|
|
2530
|
-
|
|
2589
|
+
O
|
|
2590
|
+
]), W = (0, c.useCallback)((e, t)=>{
|
|
2591
|
+
f(e), M && O && M.rerunTest(e, t);
|
|
2531
2592
|
}, [
|
|
2532
2593
|
M,
|
|
2533
|
-
|
|
2534
|
-
]),
|
|
2535
|
-
if (M &&
|
|
2594
|
+
O
|
|
2595
|
+
]), G = (0, c.useCallback)(()=>{
|
|
2596
|
+
if (M && O) for (let e of d)M.rerunTest(e.testPath);
|
|
2536
2597
|
}, [
|
|
2537
|
-
|
|
2598
|
+
d,
|
|
2538
2599
|
M,
|
|
2539
|
-
|
|
2600
|
+
O
|
|
2540
2601
|
]);
|
|
2541
|
-
(0,
|
|
2602
|
+
(0, c.useEffect)(()=>{
|
|
2542
2603
|
let e = (e)=>{
|
|
2543
2604
|
let t = e.data?.type !== "__rstest_dispatch__" ? null : e.data.payload;
|
|
2544
2605
|
if (t) {
|
|
2545
2606
|
if ("file-start" === t.type) {
|
|
2546
2607
|
let e = t.payload, s = e.testPath;
|
|
2547
|
-
"string" == typeof s && (
|
|
2608
|
+
"string" == typeof s && (m((e)=>({
|
|
2548
2609
|
...e,
|
|
2549
2610
|
[s]: "running"
|
|
2550
|
-
})),
|
|
2611
|
+
})), j((e)=>{
|
|
2551
2612
|
let t = e[s] ?? {}, l = {};
|
|
2552
2613
|
for (let [e, s] of Object.entries(t))l[e] = {
|
|
2553
2614
|
...s,
|
|
@@ -2563,87 +2624,97 @@
|
|
|
2563
2624
|
}));
|
|
2564
2625
|
} else if ("case-result" === t.type) {
|
|
2565
2626
|
let e = t.payload;
|
|
2566
|
-
e?.testPath && (
|
|
2627
|
+
e?.testPath && (U(e.testPath, e), M?.onTestCaseResult(e));
|
|
2567
2628
|
} else if ("file-complete" === t.type) {
|
|
2568
|
-
let
|
|
2569
|
-
if ("string" == typeof
|
|
2570
|
-
let t =
|
|
2571
|
-
|
|
2629
|
+
let s = t.payload, l = s.testPath;
|
|
2630
|
+
if ("string" == typeof l) {
|
|
2631
|
+
let t = ((e)=>{
|
|
2632
|
+
if (e) return Array.from(document.querySelectorAll("iframe[data-test-file]")).find((t)=>t.contentWindow === e);
|
|
2633
|
+
})(e.source) ?? eP(l), r = (t ? eA(t) : void 0) ?? w[l], o = "pass" === s.status || "skip" === s.status;
|
|
2634
|
+
m((e)=>({
|
|
2572
2635
|
...e,
|
|
2573
|
-
[
|
|
2574
|
-
})),
|
|
2575
|
-
let
|
|
2576
|
-
for (let
|
|
2577
|
-
let
|
|
2578
|
-
...
|
|
2579
|
-
|
|
2580
|
-
].join(" ") ||
|
|
2581
|
-
|
|
2582
|
-
id:
|
|
2583
|
-
name:
|
|
2584
|
-
parentNames:
|
|
2636
|
+
[l]: o ? "pass" : "fail"
|
|
2637
|
+
})), j((e)=>{
|
|
2638
|
+
let t = {};
|
|
2639
|
+
for (let e of s.results ?? [])if (e?.testId) {
|
|
2640
|
+
let s = (e.parentNames ?? []).filter(Boolean), r = [
|
|
2641
|
+
...s,
|
|
2642
|
+
e.name
|
|
2643
|
+
].join(" ") || e.name;
|
|
2644
|
+
t[e.testId] = {
|
|
2645
|
+
id: e.testId,
|
|
2646
|
+
name: e.name,
|
|
2647
|
+
parentNames: s,
|
|
2585
2648
|
fullName: r,
|
|
2586
|
-
status:
|
|
2587
|
-
filePath:
|
|
2588
|
-
location:
|
|
2649
|
+
status: R(e.status),
|
|
2650
|
+
filePath: e.testPath || l,
|
|
2651
|
+
location: e.location
|
|
2589
2652
|
};
|
|
2590
2653
|
}
|
|
2591
2654
|
return {
|
|
2592
|
-
...
|
|
2593
|
-
[
|
|
2655
|
+
...e,
|
|
2656
|
+
[l]: t
|
|
2594
2657
|
};
|
|
2658
|
+
}), M?.onTestFileComplete({
|
|
2659
|
+
...s,
|
|
2660
|
+
runId: r
|
|
2595
2661
|
});
|
|
2596
|
-
let l = w.current.get(s);
|
|
2597
|
-
l && (w.current.delete(s), l.resolve()), M?.onTestFileComplete(e);
|
|
2598
2662
|
}
|
|
2599
2663
|
} else if ("fatal" === t.type) {
|
|
2600
2664
|
let e = t.payload;
|
|
2601
|
-
|
|
2665
|
+
h && m((e)=>({
|
|
2602
2666
|
...e,
|
|
2603
|
-
[
|
|
2604
|
-
})),
|
|
2605
|
-
let t = Error(e.message || "Browser runner fatal");
|
|
2606
|
-
for (let e of w.current.values())e.reject(t);
|
|
2607
|
-
w.current.clear();
|
|
2608
|
-
}
|
|
2609
|
-
M?.onFatal(e);
|
|
2667
|
+
[h]: "fail"
|
|
2668
|
+
})), M?.onFatal(e);
|
|
2610
2669
|
} else if ("log" === t.type) {
|
|
2611
2670
|
let e = t.payload;
|
|
2612
2671
|
M?.onLog(e);
|
|
2613
2672
|
} else if ("dispatch-rpc-request" === t.type) {
|
|
2614
|
-
let s = t.payload
|
|
2615
|
-
|
|
2673
|
+
let s = t.payload;
|
|
2674
|
+
if (s.namespace === o && "file-ready" === s.method) {
|
|
2675
|
+
let e = s.args;
|
|
2676
|
+
"string" == typeof e?.testPath && Array.isArray(e.tests) && $(e.testPath, e);
|
|
2677
|
+
}
|
|
2678
|
+
if (s.namespace === o && "case-start" === s.method) {
|
|
2679
|
+
let e = s.args;
|
|
2680
|
+
"string" == typeof e?.testPath && e.testId && I(e.testPath, e);
|
|
2681
|
+
}
|
|
2682
|
+
let l = ((e)=>{
|
|
2683
|
+
if (!ey(e) || "browser" !== e.namespace || "rpc" !== e.method) return null;
|
|
2616
2684
|
let t = e.args;
|
|
2617
|
-
return
|
|
2685
|
+
return ey(t) && e_(t, "id") && e_(t, "kind") && e_(t, "method") && e_(t, "testPath") && e_(t, "runId") ? t : null;
|
|
2618
2686
|
})(s);
|
|
2619
2687
|
if (l) {
|
|
2620
|
-
let t
|
|
2621
|
-
if (!
|
|
2622
|
-
let t,
|
|
2688
|
+
let t = eP(l.testPath), o = t ? eA(t) : void 0;
|
|
2689
|
+
if (!o || l.runId !== o) {
|
|
2690
|
+
let t, a;
|
|
2623
2691
|
null !== (t = e.source) && "function" == typeof t.postMessage && e.source.postMessage({
|
|
2624
2692
|
type: r,
|
|
2625
|
-
payload: (
|
|
2626
|
-
requestId:
|
|
2693
|
+
payload: (a = s.requestId, {
|
|
2694
|
+
requestId: a,
|
|
2627
2695
|
stale: !0,
|
|
2628
|
-
error: `Ignored stale browser RPC request from previous run: ${l.kind}.${l.method} (testPath: ${l.testPath}, runId: ${l.runId}, currentRunId: ${
|
|
2696
|
+
error: `Ignored stale browser RPC request from previous run: ${l.kind}.${l.method} (testPath: ${l.testPath}, runId: ${l.runId}, currentRunId: ${o ?? "none"})`
|
|
2629
2697
|
})
|
|
2630
2698
|
}, "*");
|
|
2631
2699
|
return;
|
|
2632
2700
|
}
|
|
2633
2701
|
}
|
|
2634
|
-
|
|
2702
|
+
eb(M, s, e.source);
|
|
2635
2703
|
}
|
|
2636
2704
|
}
|
|
2637
2705
|
};
|
|
2638
2706
|
return window.addEventListener("message", e), ()=>window.removeEventListener("message", e);
|
|
2639
2707
|
}, [
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
M
|
|
2708
|
+
h,
|
|
2709
|
+
U,
|
|
2710
|
+
R,
|
|
2711
|
+
M,
|
|
2712
|
+
w,
|
|
2713
|
+
$,
|
|
2714
|
+
I
|
|
2644
2715
|
]);
|
|
2645
|
-
let
|
|
2646
|
-
let e = Object.values(
|
|
2716
|
+
let q = (0, c.useMemo)(()=>{
|
|
2717
|
+
let e = Object.values(g).flatMap((e)=>Object.values(e));
|
|
2647
2718
|
return {
|
|
2648
2719
|
idle: e.filter((e)=>"idle" === e.status).length,
|
|
2649
2720
|
running: e.filter((e)=>"running" === e.status).length,
|
|
@@ -2652,18 +2723,18 @@
|
|
|
2652
2723
|
skip: e.filter((e)=>"skip" === e.status).length
|
|
2653
2724
|
};
|
|
2654
2725
|
}, [
|
|
2655
|
-
|
|
2656
|
-
]),
|
|
2657
|
-
|
|
2658
|
-
]),
|
|
2726
|
+
g
|
|
2727
|
+
]), H = (0, c.useMemo)(()=>Object.values(x).some((e)=>"running" === e), [
|
|
2728
|
+
x
|
|
2729
|
+
]), J = (0, c.useMemo)(()=>{
|
|
2659
2730
|
let e = [], t = [
|
|
2660
|
-
...new Set(
|
|
2731
|
+
...new Set(d.map((e)=>e.projectName))
|
|
2661
2732
|
];
|
|
2662
2733
|
if (t.length > 1) for (let s of t)e.push(`__project__${s}`);
|
|
2663
|
-
for (let t of
|
|
2734
|
+
for (let t of d){
|
|
2664
2735
|
let s = t.testPath;
|
|
2665
2736
|
e.push(s);
|
|
2666
|
-
let l = Object.values(
|
|
2737
|
+
let l = Object.values(g[s] ?? {}), r = new Set;
|
|
2667
2738
|
for (let e of l){
|
|
2668
2739
|
let t = e.parentNames;
|
|
2669
2740
|
for(let e = 1; e <= t.length; e++){
|
|
@@ -2684,37 +2755,37 @@
|
|
|
2684
2755
|
...new Set(e)
|
|
2685
2756
|
];
|
|
2686
2757
|
}, [
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
]),
|
|
2758
|
+
d,
|
|
2759
|
+
g
|
|
2760
|
+
]), V = t.projects?.[0]?.name || t.rootPath.split("/").filter(Boolean).pop() || "default", K = `rstest-split-${V}`, Y = (0, c.useMemo)(()=>{
|
|
2690
2761
|
let e = new Map;
|
|
2691
2762
|
for (let s of t.projects ?? [])e.set(s.name, s.viewport);
|
|
2692
2763
|
return e;
|
|
2693
2764
|
}, [
|
|
2694
2765
|
t.projects
|
|
2695
|
-
]),
|
|
2696
|
-
if (!
|
|
2697
|
-
let e =
|
|
2766
|
+
]), Q = (0, c.useMemo)(()=>{
|
|
2767
|
+
if (!h) return t.projects?.[0]?.name;
|
|
2768
|
+
let e = d.find((e)=>e.testPath === h);
|
|
2698
2769
|
return e?.projectName ?? t.projects?.[0]?.name;
|
|
2699
2770
|
}, [
|
|
2700
|
-
|
|
2701
|
-
|
|
2771
|
+
h,
|
|
2772
|
+
d,
|
|
2702
2773
|
t.projects
|
|
2703
|
-
]),
|
|
2774
|
+
]), ee = (0, c.useMemo)(()=>Q ? N[Q] ?? eg(Y.get(Q)) : {
|
|
2704
2775
|
mode: "full"
|
|
2705
2776
|
}, [
|
|
2706
|
-
|
|
2777
|
+
Q,
|
|
2707
2778
|
N,
|
|
2708
|
-
|
|
2709
|
-
]),
|
|
2710
|
-
|
|
2779
|
+
Y
|
|
2780
|
+
]), et = (0, c.useCallback)((e)=>{
|
|
2781
|
+
Q && (F(Q, e), A((t)=>({
|
|
2711
2782
|
...t,
|
|
2712
|
-
[
|
|
2783
|
+
[Q]: e
|
|
2713
2784
|
})));
|
|
2714
2785
|
}, [
|
|
2715
|
-
|
|
2786
|
+
Q,
|
|
2716
2787
|
F
|
|
2717
|
-
]),
|
|
2788
|
+
]), es = (0, c.useCallback)((e, t)=>{
|
|
2718
2789
|
A((s)=>{
|
|
2719
2790
|
let l = s[e];
|
|
2720
2791
|
if (!l || "responsive" !== l.mode || l.width === t.width && l.height === t.height) return s;
|
|
@@ -2734,121 +2805,121 @@
|
|
|
2734
2805
|
return (0, l.jsx)("div", {
|
|
2735
2806
|
className: "m-0 h-screen w-full overflow-hidden p-0",
|
|
2736
2807
|
style: {
|
|
2737
|
-
background:
|
|
2808
|
+
background: n.colorBgContainer
|
|
2738
2809
|
},
|
|
2739
|
-
children: (0, l.jsxs)(
|
|
2810
|
+
children: (0, l.jsxs)(Z, {
|
|
2740
2811
|
direction: "horizontal",
|
|
2741
2812
|
className: "h-full w-full",
|
|
2742
|
-
autoSaveId:
|
|
2813
|
+
autoSaveId: K,
|
|
2743
2814
|
children: [
|
|
2744
|
-
(0, l.jsx)(
|
|
2815
|
+
(0, l.jsx)(L, {
|
|
2745
2816
|
defaultSize: 32,
|
|
2746
2817
|
minSize: 20,
|
|
2747
2818
|
maxSize: 50,
|
|
2748
2819
|
children: (0, l.jsxs)("div", {
|
|
2749
2820
|
className: "flex h-full flex-col overflow-hidden",
|
|
2750
2821
|
style: {
|
|
2751
|
-
background:
|
|
2822
|
+
background: n.colorBgContainer
|
|
2752
2823
|
},
|
|
2753
2824
|
children: [
|
|
2754
|
-
(0, l.jsx)(
|
|
2825
|
+
(0, l.jsx)(X, {
|
|
2755
2826
|
theme: s,
|
|
2756
|
-
onThemeToggle:
|
|
2757
|
-
isConnected:
|
|
2758
|
-
token:
|
|
2759
|
-
counts:
|
|
2760
|
-
}),
|
|
2761
|
-
(0, l.jsx)(
|
|
2762
|
-
token:
|
|
2763
|
-
filterText:
|
|
2764
|
-
onFilterChange:
|
|
2765
|
-
isAllExpanded:
|
|
2827
|
+
onThemeToggle: i,
|
|
2828
|
+
isConnected: O,
|
|
2829
|
+
token: n,
|
|
2830
|
+
counts: q
|
|
2831
|
+
}),
|
|
2832
|
+
(0, l.jsx)(er, {
|
|
2833
|
+
token: n,
|
|
2834
|
+
filterText: _,
|
|
2835
|
+
onFilterChange: C,
|
|
2836
|
+
isAllExpanded: J.length > 0 && J.every((e)=>v.includes(e)),
|
|
2766
2837
|
onToggleExpandAll: ()=>{
|
|
2767
|
-
|
|
2838
|
+
J.length > 0 && J.every((e)=>v.includes(e)) ? y([]) : y(J);
|
|
2768
2839
|
},
|
|
2769
|
-
onRerun:
|
|
2770
|
-
counts:
|
|
2771
|
-
isRunning:
|
|
2840
|
+
onRerun: O ? G : void 0,
|
|
2841
|
+
counts: q,
|
|
2842
|
+
isRunning: H
|
|
2772
2843
|
}),
|
|
2773
2844
|
(0, l.jsx)("div", {
|
|
2774
2845
|
className: "flex-1 overflow-x-hidden overflow-y-auto",
|
|
2775
2846
|
style: {
|
|
2776
|
-
background:
|
|
2847
|
+
background: n.colorBgContainer
|
|
2777
2848
|
},
|
|
2778
|
-
children: (0, l.jsx)(
|
|
2779
|
-
testFiles:
|
|
2780
|
-
statusMap:
|
|
2781
|
-
caseMap:
|
|
2849
|
+
children: (0, l.jsx)(em, {
|
|
2850
|
+
testFiles: d,
|
|
2851
|
+
statusMap: x,
|
|
2852
|
+
caseMap: g,
|
|
2782
2853
|
rootPath: t.rootPath,
|
|
2783
2854
|
projects: t.projects,
|
|
2784
2855
|
loading: z,
|
|
2785
|
-
connected:
|
|
2786
|
-
openFiles:
|
|
2787
|
-
activeFile:
|
|
2788
|
-
token:
|
|
2789
|
-
filterText:
|
|
2790
|
-
onExpandChange:
|
|
2791
|
-
onSelect:
|
|
2792
|
-
onRerunFile:
|
|
2793
|
-
onRerunTestCase:
|
|
2856
|
+
connected: O,
|
|
2857
|
+
openFiles: v,
|
|
2858
|
+
activeFile: h,
|
|
2859
|
+
token: n,
|
|
2860
|
+
filterText: _,
|
|
2861
|
+
onExpandChange: y,
|
|
2862
|
+
onSelect: E,
|
|
2863
|
+
onRerunFile: B,
|
|
2864
|
+
onRerunTestCase: W
|
|
2794
2865
|
})
|
|
2795
2866
|
})
|
|
2796
2867
|
]
|
|
2797
2868
|
})
|
|
2798
2869
|
}),
|
|
2799
|
-
(0, l.jsx)(
|
|
2870
|
+
(0, l.jsx)(L, {
|
|
2800
2871
|
defaultSize: 68,
|
|
2801
2872
|
minSize: 40,
|
|
2802
2873
|
children: (0, l.jsxs)("div", {
|
|
2803
2874
|
className: "flex h-full flex-col overflow-hidden",
|
|
2804
2875
|
style: {
|
|
2805
|
-
background:
|
|
2876
|
+
background: n.colorBgLayout
|
|
2806
2877
|
},
|
|
2807
2878
|
children: [
|
|
2808
2879
|
(0, l.jsx)(D, {
|
|
2809
|
-
token:
|
|
2810
|
-
activeFile:
|
|
2880
|
+
token: n,
|
|
2881
|
+
activeFile: h ?? void 0,
|
|
2811
2882
|
rootPath: t.rootPath,
|
|
2812
|
-
status:
|
|
2813
|
-
viewport:
|
|
2814
|
-
onViewportChange:
|
|
2883
|
+
status: h ? x[h] ?? "idle" : void 0,
|
|
2884
|
+
viewport: Q ? ee : void 0,
|
|
2885
|
+
onViewportChange: Q ? et : void 0
|
|
2815
2886
|
}),
|
|
2816
2887
|
(0, l.jsxs)("div", {
|
|
2817
2888
|
className: "relative min-h-0 flex-1 overflow-auto",
|
|
2818
2889
|
style: {
|
|
2819
|
-
background:
|
|
2890
|
+
background: n.colorBgLayout
|
|
2820
2891
|
},
|
|
2821
2892
|
children: [
|
|
2822
|
-
!
|
|
2893
|
+
!h && (0, l.jsx)(u, {
|
|
2823
2894
|
message: "Select a test file on the left to view its run output"
|
|
2824
2895
|
}),
|
|
2825
|
-
|
|
2896
|
+
d.map((e)=>{
|
|
2826
2897
|
var s;
|
|
2827
|
-
let r, o, a,
|
|
2828
|
-
return r = e.testPath ===
|
|
2898
|
+
let r, o, a, i;
|
|
2899
|
+
return r = e.testPath === h, o = w[e.testPath], a = N[e.projectName] ?? eg(Y.get(e.projectName)), (0, l.jsx)("div", {
|
|
2829
2900
|
className: "h-full w-full",
|
|
2830
2901
|
style: {
|
|
2831
2902
|
display: r ? "block" : "none"
|
|
2832
2903
|
},
|
|
2833
|
-
children: (0, l.jsx)(
|
|
2834
|
-
token:
|
|
2904
|
+
children: (0, l.jsx)(ev, {
|
|
2905
|
+
token: n,
|
|
2835
2906
|
selection: a,
|
|
2836
2907
|
active: r,
|
|
2837
|
-
onResponsiveResize: "responsive" === a.mode ? (t)=>
|
|
2908
|
+
onResponsiveResize: "responsive" === a.mode ? (t)=>es(e.projectName, t) : void 0,
|
|
2838
2909
|
"data-testid": "responsive" === a.mode ? "viewport-resizer" : void 0,
|
|
2839
2910
|
"data-test-project": e.projectName,
|
|
2840
2911
|
"data-test-file": e.testPath,
|
|
2841
2912
|
children: (0, l.jsx)("iframe", {
|
|
2842
2913
|
"data-test-file": e.testPath,
|
|
2843
|
-
title: `Test runner for ${(
|
|
2844
|
-
src: o ?
|
|
2914
|
+
title: `Test runner for ${(i = (s = e.testPath).split("/"))[i.length - 1] || s}`,
|
|
2915
|
+
src: o ? eS(e.testPath, t.runnerUrl, void 0, !1, o) : "about:blank",
|
|
2845
2916
|
className: "block h-full w-full border-0",
|
|
2846
2917
|
style: {
|
|
2847
|
-
background:
|
|
2918
|
+
background: n.colorBgContainer
|
|
2848
2919
|
},
|
|
2849
2920
|
onLoad: (s)=>{
|
|
2850
2921
|
if (!o) return;
|
|
2851
|
-
let l = s.currentTarget, r =
|
|
2922
|
+
let l = s.currentTarget, r = eA(l) ?? o;
|
|
2852
2923
|
l.contentWindow && l.contentWindow.postMessage({
|
|
2853
2924
|
type: "RSTEST_CONFIG",
|
|
2854
2925
|
payload: {
|
|
@@ -2870,19 +2941,19 @@
|
|
|
2870
2941
|
]
|
|
2871
2942
|
})
|
|
2872
2943
|
});
|
|
2873
|
-
},
|
|
2874
|
-
let e = window.__RSTEST_BROWSER_OPTIONS__, [t, s] = (0,
|
|
2875
|
-
(0,
|
|
2876
|
-
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e)=>
|
|
2877
|
-
return
|
|
2878
|
-
}, []), (0,
|
|
2944
|
+
}, ez = ()=>{
|
|
2945
|
+
let e = window.__RSTEST_BROWSER_OPTIONS__, [t, s] = (0, c.useState)("dark"), [r, o] = (0, c.useState)("dark");
|
|
2946
|
+
(0, c.useEffect)(()=>{
|
|
2947
|
+
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e)=>o(e.matches ? "dark" : "light");
|
|
2948
|
+
return o(e.matches ? "dark" : "light"), e.addEventListener("change", t), ()=>e.removeEventListener("change", t);
|
|
2949
|
+
}, []), (0, c.useEffect)(()=>{
|
|
2879
2950
|
try {
|
|
2880
2951
|
let e = window.localStorage.getItem("rstest-theme");
|
|
2881
2952
|
("light" === e || "dark" === e || "system" === e) && s(e);
|
|
2882
2953
|
} catch {}
|
|
2883
2954
|
}, []);
|
|
2884
2955
|
let d = "system" === t ? r : t;
|
|
2885
|
-
if ((0,
|
|
2956
|
+
if ((0, c.useEffect)(()=>{
|
|
2886
2957
|
document.body.dataset.theme = d;
|
|
2887
2958
|
try {
|
|
2888
2959
|
window.localStorage.setItem("rstest-theme", t);
|
|
@@ -2895,14 +2966,14 @@
|
|
|
2895
2966
|
children: "Missing browser options"
|
|
2896
2967
|
});
|
|
2897
2968
|
let u = "dark" === d, p = e.projects?.[0]?.name || e.rootPath.split("/").filter(Boolean).pop() || "rstest";
|
|
2898
|
-
return (0,
|
|
2969
|
+
return (0, c.useEffect)(()=>{
|
|
2899
2970
|
document.title = `${p} [RSTEST BROWSER]`;
|
|
2900
2971
|
}, [
|
|
2901
2972
|
p
|
|
2902
|
-
]), (0, l.jsx)(
|
|
2973
|
+
]), (0, l.jsx)(i.Ay, {
|
|
2903
2974
|
componentSize: "small",
|
|
2904
2975
|
theme: {
|
|
2905
|
-
algorithm: u ?
|
|
2976
|
+
algorithm: u ? a.A.darkAlgorithm : a.A.defaultAlgorithm,
|
|
2906
2977
|
token: {
|
|
2907
2978
|
fontFamily: '"Inter",system-ui,-apple-system,"Segoe UI",sans-serif',
|
|
2908
2979
|
fontFamilyCode: '"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
@@ -2914,21 +2985,21 @@
|
|
|
2914
2985
|
borderRadius: 6
|
|
2915
2986
|
}
|
|
2916
2987
|
},
|
|
2917
|
-
children: (0, l.jsx)(
|
|
2918
|
-
children: (0, l.jsx)(
|
|
2988
|
+
children: (0, l.jsx)(n.A, {
|
|
2989
|
+
children: (0, l.jsx)(eM, {
|
|
2919
2990
|
options: e,
|
|
2920
2991
|
theme: t,
|
|
2921
2992
|
setTheme: s
|
|
2922
2993
|
})
|
|
2923
2994
|
})
|
|
2924
2995
|
});
|
|
2925
|
-
},
|
|
2996
|
+
}, eO = ()=>{
|
|
2926
2997
|
let e = document.getElementById("root");
|
|
2927
|
-
e &&
|
|
2928
|
-
children: (0, l.jsx)(
|
|
2998
|
+
e && d.createRoot(e).render((0, l.jsx)(c.StrictMode, {
|
|
2999
|
+
children: (0, l.jsx)(ez, {})
|
|
2929
3000
|
}));
|
|
2930
3001
|
};
|
|
2931
|
-
"loading" === document.readyState ? document.addEventListener("DOMContentLoaded",
|
|
3002
|
+
"loading" === document.readyState ? document.addEventListener("DOMContentLoaded", eO) : eO();
|
|
2932
3003
|
}
|
|
2933
3004
|
}, i = {};
|
|
2934
3005
|
function n(e) {
|
|
@@ -2998,7 +3069,7 @@
|
|
|
2998
3069
|
}, (o = self.rspackChunk_rstest_browser_ui = self.rspackChunk_rstest_browser_ui || []).forEach(r.bind(null, 0)), o.push = r.bind(null, o.push.bind(o));
|
|
2999
3070
|
var c = n.O(void 0, [
|
|
3000
3071
|
"783",
|
|
3001
|
-
"
|
|
3002
|
-
], ()=>n(
|
|
3072
|
+
"927"
|
|
3073
|
+
], ()=>n(5645));
|
|
3003
3074
|
c = n.O(c);
|
|
3004
3075
|
})();
|