@rstest/browser 0.8.5 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE-2.0 +202 -0
- package/NOTICE +11 -0
- package/dist/361.js +8 -0
- package/dist/augmentExpect.d.ts +73 -0
- package/dist/browser-container/container-static/css/index.5c72297783.css +1 -0
- package/dist/browser-container/container-static/js/{565.226c9ef5.js → 101.36a8ccdf84.js} +4024 -3856
- package/dist/browser-container/container-static/js/101.36a8ccdf84.js.LICENSE.txt +1 -0
- package/dist/browser-container/container-static/js/{index.c1d17467.js → index.0687a8142a.js} +742 -692
- package/dist/browser-container/container-static/js/{lib-react.97ee79b0.js → lib-react.dcf2a5e57a.js} +10 -10
- package/dist/browser-container/container-static/js/lib-react.dcf2a5e57a.js.LICENSE.txt +1 -0
- package/dist/browser-container/index.html +1 -1
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +583 -0
- package/dist/browserRpcRegistry.d.ts +18 -0
- package/dist/client/api.d.ts +3 -0
- package/dist/client/browserRpc.d.ts +2 -0
- package/dist/client/dispatchTransport.d.ts +11 -0
- package/dist/client/entry.d.ts +1 -5
- package/dist/client/locator.d.ts +125 -0
- package/dist/client/snapshot.d.ts +0 -6
- package/dist/concurrency.d.ts +12 -0
- package/dist/dispatchCapabilities.d.ts +34 -0
- package/dist/dispatchRouter.d.ts +20 -0
- package/dist/headlessLatestRerunScheduler.d.ts +19 -0
- package/dist/headlessTransport.d.ts +12 -0
- package/dist/index.js +1580 -258
- package/dist/protocol.d.ts +44 -33
- package/dist/providers/index.d.ts +79 -0
- package/dist/providers/playwright/compileLocator.d.ts +3 -0
- package/dist/providers/playwright/dispatchBrowserRpc.d.ts +13 -0
- package/dist/providers/playwright/expectUtils.d.ts +24 -0
- package/dist/providers/playwright/implementation.d.ts +2 -0
- package/dist/providers/playwright/index.d.ts +1 -0
- package/dist/providers/playwright/runtime.d.ts +5 -0
- package/dist/providers/playwright/textMatcher.d.ts +8 -0
- package/dist/rpcProtocol.d.ts +145 -0
- package/dist/runSession.d.ts +33 -0
- package/dist/sessionRegistry.d.ts +34 -0
- package/dist/sourceMap/sourceMapLoader.d.ts +14 -0
- package/dist/watchRerunPlanner.d.ts +21 -0
- package/package.json +15 -10
- package/src/AGENTS.md +128 -0
- package/src/augmentExpect.ts +62 -0
- package/src/browser.ts +3 -0
- package/src/browserRpcRegistry.ts +57 -0
- package/src/client/AGENTS.md +82 -0
- package/src/client/api.ts +213 -0
- package/src/client/browserRpc.ts +86 -0
- package/src/client/dispatchTransport.ts +178 -0
- package/src/client/entry.ts +96 -33
- package/src/client/locator.ts +452 -0
- package/src/client/snapshot.ts +32 -97
- package/src/client/sourceMapSupport.ts +26 -37
- package/src/concurrency.ts +62 -0
- package/src/dispatchCapabilities.ts +162 -0
- package/src/dispatchRouter.ts +82 -0
- package/src/env.d.ts +8 -1
- package/src/headlessLatestRerunScheduler.ts +76 -0
- package/src/headlessTransport.ts +28 -0
- package/src/hostController.ts +1292 -367
- package/src/protocol.ts +66 -31
- package/src/providers/index.ts +103 -0
- package/src/providers/playwright/compileLocator.ts +130 -0
- package/src/providers/playwright/dispatchBrowserRpc.ts +372 -0
- package/src/providers/playwright/expectUtils.ts +57 -0
- package/src/providers/playwright/implementation.ts +33 -0
- package/src/providers/playwright/index.ts +1 -0
- package/src/providers/playwright/runtime.ts +32 -0
- package/src/providers/playwright/textMatcher.ts +10 -0
- package/src/rpcProtocol.ts +220 -0
- package/src/runSession.ts +110 -0
- package/src/sessionRegistry.ts +89 -0
- package/src/sourceMap/sourceMapLoader.ts +96 -0
- package/src/watchRerunPlanner.ts +77 -0
- package/dist/browser-container/container-static/css/index.5a71c757.css +0 -1
- package/dist/browser-container/container-static/js/565.226c9ef5.js.LICENSE.txt +0 -1
- package/dist/browser-container/container-static/js/lib-react.97ee79b0.js.LICENSE.txt +0 -1
- package/dist/browser-container/container-static/js/scheduler.5accca0c.js +0 -407
- package/dist/browser-container/scheduler.html +0 -19
package/dist/browser-container/container-static/js/{index.c1d17467.js → index.0687a8142a.js}
RENAMED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
(()=>{
|
|
2
2
|
"use strict";
|
|
3
|
-
var e, t, s, l, o, a
|
|
4
|
-
|
|
5
|
-
var l = s(6730)
|
|
6
|
-
let
|
|
3
|
+
var e, t, s, l, r, o, a = {
|
|
4
|
+
7723 (e, t, s) {
|
|
5
|
+
var l = s(6730);
|
|
6
|
+
let r = "__rstest_dispatch_response__";
|
|
7
|
+
var o = s(8593), a = s(5466), i = s(7603), n = s(162), c = s(2739);
|
|
8
|
+
let d = (e)=>{
|
|
7
9
|
let { message: t } = e;
|
|
8
10
|
return (0, l.jsx)("div", {
|
|
9
11
|
className: "absolute inset-0 z-10 flex items-center justify-center bg-black/[0.02]",
|
|
@@ -13,8 +15,8 @@
|
|
|
13
15
|
})
|
|
14
16
|
});
|
|
15
17
|
};
|
|
16
|
-
var
|
|
17
|
-
let
|
|
18
|
+
var u = s(2591), p = s(2238), h = s(7385), f = s(6624), x = s(2310);
|
|
19
|
+
let m = (e, t)=>{
|
|
18
20
|
if (!t) return e;
|
|
19
21
|
let s = t.endsWith("/") ? t.slice(0, -1) : t;
|
|
20
22
|
if (e.startsWith(s)) {
|
|
@@ -22,21 +24,20 @@
|
|
|
22
24
|
return t.startsWith("/") ? t.slice(1) : t;
|
|
23
25
|
}
|
|
24
26
|
return e;
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
null == (t = window.parent) || t.postMessage({
|
|
27
|
+
}, g = (e)=>{
|
|
28
|
+
window.parent?.postMessage({
|
|
28
29
|
type: "open-in-editor",
|
|
29
30
|
payload: {
|
|
30
31
|
file: e
|
|
31
32
|
}
|
|
32
33
|
}, "*"), fetch(`/__open-in-editor?file=${encodeURIComponent(e)}`).catch(()=>{});
|
|
33
34
|
};
|
|
34
|
-
var
|
|
35
|
-
let
|
|
35
|
+
var j = s(5162), v = s(7410), y = s(1544), _ = s(7400), w = s(567);
|
|
36
|
+
let C = {
|
|
36
37
|
idle: {
|
|
37
38
|
label: "Idle",
|
|
38
39
|
color: "var(--accents-5)",
|
|
39
|
-
icon: (0, l.jsx)(
|
|
40
|
+
icon: (0, l.jsx)(j.A, {
|
|
40
41
|
size: 14,
|
|
41
42
|
strokeWidth: 2.5
|
|
42
43
|
})
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
running: {
|
|
45
46
|
label: "Running",
|
|
46
47
|
color: "var(--ds-amber-700)",
|
|
47
|
-
icon: (0, l.jsx)(
|
|
48
|
+
icon: (0, l.jsx)(v.A, {
|
|
48
49
|
size: 14,
|
|
49
50
|
className: "animate-spin",
|
|
50
51
|
strokeWidth: 2.5
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
pass: {
|
|
54
55
|
label: "Pass",
|
|
55
56
|
color: "var(--ds-green-700)",
|
|
56
|
-
icon: (0, l.jsx)(
|
|
57
|
+
icon: (0, l.jsx)(y.A, {
|
|
57
58
|
size: 14,
|
|
58
59
|
strokeWidth: 2.5
|
|
59
60
|
})
|
|
@@ -61,140 +62,150 @@
|
|
|
61
62
|
fail: {
|
|
62
63
|
label: "Fail",
|
|
63
64
|
color: "var(--ds-red-800)",
|
|
64
|
-
icon: (0, l.jsx)(
|
|
65
|
+
icon: (0, l.jsx)(_.A, {
|
|
65
66
|
size: 14,
|
|
66
67
|
strokeWidth: 2.5
|
|
67
68
|
})
|
|
68
69
|
}
|
|
69
|
-
},
|
|
70
|
-
...
|
|
70
|
+
}, b = {
|
|
71
|
+
...C,
|
|
71
72
|
skip: {
|
|
72
73
|
label: "Skip",
|
|
73
74
|
color: "var(--accents-4)",
|
|
74
|
-
icon: (0, l.jsx)(
|
|
75
|
+
icon: (0, l.jsx)(w.A, {
|
|
75
76
|
size: 14,
|
|
76
77
|
strokeWidth: 2.5
|
|
77
78
|
})
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
|
-
var
|
|
81
|
-
let
|
|
82
|
-
{
|
|
83
|
-
id: "iPhoneSE",
|
|
84
|
-
label: "iPhone SE",
|
|
81
|
+
var k = s(1668), S = s(5735), F = s(1396), N = s(91), A = s(2604), P = s(8149), M = s(1162), z = s(462);
|
|
82
|
+
let O = {
|
|
83
|
+
iPhoneSE: {
|
|
85
84
|
width: 375,
|
|
86
85
|
height: 667
|
|
87
86
|
},
|
|
88
|
-
{
|
|
89
|
-
id: "iPhoneXR",
|
|
90
|
-
label: "iPhone XR",
|
|
87
|
+
iPhoneXR: {
|
|
91
88
|
width: 414,
|
|
92
89
|
height: 896
|
|
93
90
|
},
|
|
94
|
-
{
|
|
95
|
-
id: "iPhone12Pro",
|
|
96
|
-
label: "iPhone 12 Pro",
|
|
91
|
+
iPhone12Pro: {
|
|
97
92
|
width: 390,
|
|
98
93
|
height: 844
|
|
99
94
|
},
|
|
100
|
-
{
|
|
101
|
-
id: "iPhone14ProMax",
|
|
102
|
-
label: "iPhone 14 Pro Max",
|
|
95
|
+
iPhone14ProMax: {
|
|
103
96
|
width: 430,
|
|
104
97
|
height: 932
|
|
105
98
|
},
|
|
106
|
-
{
|
|
107
|
-
id: "Pixel7",
|
|
108
|
-
label: "Pixel 7",
|
|
99
|
+
Pixel7: {
|
|
109
100
|
width: 412,
|
|
110
101
|
height: 915
|
|
111
102
|
},
|
|
112
|
-
{
|
|
113
|
-
id: "SamsungGalaxyS8Plus",
|
|
114
|
-
label: "Samsung Galaxy S8+",
|
|
103
|
+
SamsungGalaxyS8Plus: {
|
|
115
104
|
width: 360,
|
|
116
105
|
height: 740
|
|
117
106
|
},
|
|
118
|
-
{
|
|
119
|
-
id: "SamsungGalaxyS20Ultra",
|
|
120
|
-
label: "Samsung Galaxy S20 Ultra",
|
|
107
|
+
SamsungGalaxyS20Ultra: {
|
|
121
108
|
width: 412,
|
|
122
109
|
height: 915
|
|
123
110
|
},
|
|
124
|
-
{
|
|
125
|
-
id: "iPadMini",
|
|
126
|
-
label: "iPad Mini",
|
|
111
|
+
iPadMini: {
|
|
127
112
|
width: 768,
|
|
128
113
|
height: 1024
|
|
129
114
|
},
|
|
130
|
-
{
|
|
131
|
-
id: "iPadAir",
|
|
132
|
-
label: "iPad Air",
|
|
115
|
+
iPadAir: {
|
|
133
116
|
width: 820,
|
|
134
117
|
height: 1180
|
|
135
118
|
},
|
|
136
|
-
{
|
|
137
|
-
id: "iPadPro",
|
|
138
|
-
label: "iPad Pro",
|
|
119
|
+
iPadPro: {
|
|
139
120
|
width: 1024,
|
|
140
121
|
height: 1366
|
|
141
122
|
},
|
|
142
|
-
{
|
|
143
|
-
id: "SurfacePro7",
|
|
144
|
-
label: "Surface Pro 7",
|
|
123
|
+
SurfacePro7: {
|
|
145
124
|
width: 912,
|
|
146
125
|
height: 1368
|
|
147
126
|
},
|
|
148
|
-
{
|
|
149
|
-
id: "SurfaceDuo",
|
|
150
|
-
label: "Surface Duo",
|
|
127
|
+
SurfaceDuo: {
|
|
151
128
|
width: 540,
|
|
152
129
|
height: 720
|
|
153
130
|
},
|
|
154
|
-
{
|
|
155
|
-
id: "GalaxyZFold5",
|
|
156
|
-
label: "Galaxy Z Fold 5",
|
|
131
|
+
GalaxyZFold5: {
|
|
157
132
|
width: 344,
|
|
158
133
|
height: 882
|
|
159
134
|
},
|
|
160
|
-
{
|
|
161
|
-
id: "AsusZenbookFold",
|
|
162
|
-
label: "Asus Zenbook Fold",
|
|
135
|
+
AsusZenbookFold: {
|
|
163
136
|
width: 853,
|
|
164
137
|
height: 1280
|
|
165
138
|
},
|
|
166
|
-
{
|
|
167
|
-
id: "SamsungGalaxyA51A71",
|
|
168
|
-
label: "Samsung Galaxy A51/71",
|
|
139
|
+
SamsungGalaxyA51A71: {
|
|
169
140
|
width: 412,
|
|
170
141
|
height: 914
|
|
171
142
|
},
|
|
172
|
-
{
|
|
173
|
-
id: "NestHub",
|
|
174
|
-
label: "Nest Hub",
|
|
143
|
+
NestHub: {
|
|
175
144
|
width: 1024,
|
|
176
145
|
height: 600
|
|
177
146
|
},
|
|
178
|
-
{
|
|
179
|
-
id: "NestHubMax",
|
|
180
|
-
label: "Nest Hub Max",
|
|
147
|
+
NestHubMax: {
|
|
181
148
|
width: 1280,
|
|
182
149
|
height: 800
|
|
183
150
|
}
|
|
184
|
-
|
|
185
|
-
|
|
151
|
+
}, R = {
|
|
152
|
+
iPhoneSE: "iPhone SE",
|
|
153
|
+
iPhoneXR: "iPhone XR",
|
|
154
|
+
iPhone12Pro: "iPhone 12 Pro",
|
|
155
|
+
iPhone14ProMax: "iPhone 14 Pro Max",
|
|
156
|
+
Pixel7: "Pixel 7",
|
|
157
|
+
SamsungGalaxyS8Plus: "Samsung Galaxy S8+",
|
|
158
|
+
SamsungGalaxyS20Ultra: "Samsung Galaxy S20 Ultra",
|
|
159
|
+
iPadMini: "iPad Mini",
|
|
160
|
+
iPadAir: "iPad Air",
|
|
161
|
+
iPadPro: "iPad Pro",
|
|
162
|
+
SurfacePro7: "Surface Pro 7",
|
|
163
|
+
SurfaceDuo: "Surface Duo",
|
|
164
|
+
GalaxyZFold5: "Galaxy Z Fold 5",
|
|
165
|
+
AsusZenbookFold: "Asus Zenbook Fold",
|
|
166
|
+
SamsungGalaxyA51A71: "Samsung Galaxy A51/71",
|
|
167
|
+
NestHub: "Nest Hub",
|
|
168
|
+
NestHubMax: "Nest Hub Max"
|
|
169
|
+
}, U = [
|
|
170
|
+
"iPhoneSE",
|
|
171
|
+
"iPhoneXR",
|
|
172
|
+
"iPhone12Pro",
|
|
173
|
+
"iPhone14ProMax",
|
|
174
|
+
"Pixel7",
|
|
175
|
+
"SamsungGalaxyS8Plus",
|
|
176
|
+
"SamsungGalaxyS20Ultra",
|
|
177
|
+
"iPadMini",
|
|
178
|
+
"iPadAir",
|
|
179
|
+
"iPadPro",
|
|
180
|
+
"SurfacePro7",
|
|
181
|
+
"SurfaceDuo",
|
|
182
|
+
"GalaxyZFold5",
|
|
183
|
+
"AsusZenbookFold",
|
|
184
|
+
"SamsungGalaxyA51A71",
|
|
185
|
+
"NestHub",
|
|
186
|
+
"NestHubMax"
|
|
187
|
+
].map((e)=>{
|
|
188
|
+
let t = O[e];
|
|
189
|
+
return {
|
|
190
|
+
id: e,
|
|
191
|
+
label: R[e],
|
|
192
|
+
width: t.width,
|
|
193
|
+
height: t.height
|
|
194
|
+
};
|
|
195
|
+
}), E = new Set(U.map((e)=>e.id)), $ = (e)=>"string" == typeof e && E.has(e), T = (e)=>{
|
|
196
|
+
let t = U.find((t)=>t.id === e);
|
|
186
197
|
if (!t) throw Error(`Unknown device preset: ${e}`);
|
|
187
198
|
return t;
|
|
188
|
-
},
|
|
189
|
-
let { token: t, value: s, onChange:
|
|
199
|
+
}, B = (e, t, s)=>Math.min(s, Math.max(t, e)), I = (e)=>{
|
|
200
|
+
let { token: t, value: s, onChange: r } = e, [o, a] = (0, n.useState)(!1), i = (0, n.useRef)({
|
|
190
201
|
width: 800,
|
|
191
202
|
height: 600
|
|
192
203
|
});
|
|
193
|
-
"responsive" === s.mode && (
|
|
204
|
+
"responsive" === s.mode && (i.current = {
|
|
194
205
|
width: s.width,
|
|
195
206
|
height: s.height
|
|
196
207
|
});
|
|
197
|
-
let c = "full" === s.mode ? "full" : "responsive" === s.mode ? "responsive" : s.preset,
|
|
208
|
+
let c = "full" === s.mode ? "full" : "responsive" === s.mode ? "responsive" : s.preset, d = (0, n.useMemo)(()=>[
|
|
198
209
|
{
|
|
199
210
|
value: "full",
|
|
200
211
|
label: "Full"
|
|
@@ -203,23 +214,23 @@
|
|
|
203
214
|
value: "responsive",
|
|
204
215
|
label: "Responsive"
|
|
205
216
|
},
|
|
206
|
-
...
|
|
217
|
+
...U.map((e)=>{
|
|
207
218
|
let t;
|
|
208
219
|
return {
|
|
209
220
|
value: e.id,
|
|
210
|
-
label: (t =
|
|
221
|
+
label: (t = T(e.id), `${t.label} (${t.width} x ${t.height})`)
|
|
211
222
|
};
|
|
212
223
|
})
|
|
213
|
-
], []),
|
|
224
|
+
], []), h = (0, l.jsxs)("div", {
|
|
214
225
|
className: "w-[280px]",
|
|
215
226
|
"data-testid": "viewport-popover",
|
|
216
227
|
children: [
|
|
217
228
|
(0, l.jsxs)("div", {
|
|
218
229
|
className: "flex items-center gap-2",
|
|
219
230
|
children: [
|
|
220
|
-
(0, l.jsx)(
|
|
231
|
+
(0, l.jsx)(k.A, {
|
|
221
232
|
value: c,
|
|
222
|
-
options:
|
|
233
|
+
options: d,
|
|
223
234
|
listHeight: 280,
|
|
224
235
|
dropdownStyle: {
|
|
225
236
|
maxHeight: 280,
|
|
@@ -227,29 +238,29 @@
|
|
|
227
238
|
},
|
|
228
239
|
onChange: (e)=>{
|
|
229
240
|
if ("full" === e) {
|
|
230
|
-
|
|
241
|
+
r({
|
|
231
242
|
mode: "full"
|
|
232
|
-
}),
|
|
243
|
+
}), a(!1);
|
|
233
244
|
return;
|
|
234
245
|
}
|
|
235
|
-
"responsive" === e ?
|
|
246
|
+
"responsive" === e ? r({
|
|
236
247
|
mode: "responsive",
|
|
237
248
|
..."responsive" === s.mode ? {
|
|
238
249
|
width: s.width,
|
|
239
250
|
height: s.height
|
|
240
|
-
} :
|
|
241
|
-
}) : (
|
|
251
|
+
} : i.current
|
|
252
|
+
}) : (r({
|
|
242
253
|
mode: "preset",
|
|
243
254
|
preset: e,
|
|
244
255
|
orientation: "preset" === s.mode && s.preset === e ? s.orientation : "portrait"
|
|
245
|
-
}),
|
|
256
|
+
}), a(!1));
|
|
246
257
|
},
|
|
247
258
|
size: "small",
|
|
248
259
|
className: "flex-1",
|
|
249
260
|
popupMatchSelectWidth: !1,
|
|
250
261
|
"data-testid": "viewport-preset-select"
|
|
251
262
|
}),
|
|
252
|
-
(0, l.jsx)(
|
|
263
|
+
(0, l.jsx)(u.A, {
|
|
253
264
|
title: "Rotate",
|
|
254
265
|
mouseLeaveDelay: 0,
|
|
255
266
|
children: (0, l.jsx)(p.Ay, {
|
|
@@ -271,13 +282,13 @@
|
|
|
271
282
|
width: s.height,
|
|
272
283
|
height: s.width
|
|
273
284
|
};
|
|
274
|
-
|
|
285
|
+
i.current = {
|
|
275
286
|
width: e.width,
|
|
276
287
|
height: e.height
|
|
277
|
-
},
|
|
288
|
+
}, r(e);
|
|
278
289
|
return;
|
|
279
290
|
}
|
|
280
|
-
|
|
291
|
+
r({
|
|
281
292
|
mode: "preset",
|
|
282
293
|
preset: s.preset,
|
|
283
294
|
orientation: "portrait" === s.orientation ? "landscape" : "portrait"
|
|
@@ -292,18 +303,18 @@
|
|
|
292
303
|
className: "mt-3 flex items-center gap-2",
|
|
293
304
|
"data-testid": "viewport-inputs",
|
|
294
305
|
children: [
|
|
295
|
-
(0, l.jsx)(
|
|
306
|
+
(0, l.jsx)(S.A, {
|
|
296
307
|
min: 1,
|
|
297
308
|
max: 1e4,
|
|
298
309
|
step: 1,
|
|
299
310
|
controls: !1,
|
|
300
311
|
value: s.width,
|
|
301
312
|
onChange: (e)=>{
|
|
302
|
-
let t =
|
|
303
|
-
|
|
313
|
+
let t = B(Number(e ?? s.width), 1, 1e4);
|
|
314
|
+
i.current = {
|
|
304
315
|
width: t,
|
|
305
316
|
height: s.height
|
|
306
|
-
},
|
|
317
|
+
}, r({
|
|
307
318
|
mode: "responsive",
|
|
308
319
|
width: t,
|
|
309
320
|
height: s.height
|
|
@@ -318,18 +329,18 @@
|
|
|
318
329
|
className: "text-(--accents-4) select-none",
|
|
319
330
|
children: "x"
|
|
320
331
|
}),
|
|
321
|
-
(0, l.jsx)(
|
|
332
|
+
(0, l.jsx)(S.A, {
|
|
322
333
|
min: 1,
|
|
323
334
|
max: 1e4,
|
|
324
335
|
step: 1,
|
|
325
336
|
controls: !1,
|
|
326
337
|
value: s.height,
|
|
327
338
|
onChange: (e)=>{
|
|
328
|
-
let t =
|
|
329
|
-
|
|
339
|
+
let t = B(Number(e ?? s.height), 1, 1e4);
|
|
340
|
+
i.current = {
|
|
330
341
|
width: s.width,
|
|
331
342
|
height: t
|
|
332
|
-
},
|
|
343
|
+
}, r({
|
|
333
344
|
mode: "responsive",
|
|
334
345
|
width: s.width,
|
|
335
346
|
height: t
|
|
@@ -345,10 +356,10 @@
|
|
|
345
356
|
]
|
|
346
357
|
});
|
|
347
358
|
return (0, l.jsx)(F.A, {
|
|
348
|
-
content:
|
|
359
|
+
content: h,
|
|
349
360
|
trigger: "click",
|
|
350
|
-
open:
|
|
351
|
-
onOpenChange:
|
|
361
|
+
open: o,
|
|
362
|
+
onOpenChange: a,
|
|
352
363
|
placement: "bottomRight",
|
|
353
364
|
children: (0, l.jsxs)(p.Ay, {
|
|
354
365
|
type: "text",
|
|
@@ -360,16 +371,16 @@
|
|
|
360
371
|
(0, l.jsx)("span", {
|
|
361
372
|
className: "flex h-4 w-4 items-center justify-center text-(--accents-5)",
|
|
362
373
|
children: ((e)=>{
|
|
363
|
-
if ("full" === e.mode) return (0, l.jsx)(
|
|
374
|
+
if ("full" === e.mode) return (0, l.jsx)(N.A, {
|
|
364
375
|
size: 14,
|
|
365
376
|
strokeWidth: 2.2
|
|
366
377
|
});
|
|
367
|
-
if ("responsive" === e.mode) return (0, l.jsx)(
|
|
378
|
+
if ("responsive" === e.mode) return (0, l.jsx)(A.A, {
|
|
368
379
|
size: 14,
|
|
369
380
|
strokeWidth: 2.2
|
|
370
381
|
});
|
|
371
|
-
let t =
|
|
372
|
-
return t.startsWith("iPad") || t.startsWith("Surface") || t.startsWith("Nest Hub") || t.includes("Fold") ? (0, l.jsx)(
|
|
382
|
+
let t = T(e.preset).label;
|
|
383
|
+
return t.startsWith("iPad") || t.startsWith("Surface") || t.startsWith("Nest Hub") || t.includes("Fold") ? (0, l.jsx)(P.A, {
|
|
373
384
|
size: 14,
|
|
374
385
|
strokeWidth: 2.2
|
|
375
386
|
}) : (0, l.jsx)(M.A, {
|
|
@@ -383,15 +394,15 @@
|
|
|
383
394
|
style: {
|
|
384
395
|
color: t.colorTextSecondary
|
|
385
396
|
},
|
|
386
|
-
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}` : T(s.preset).label
|
|
387
398
|
})
|
|
388
399
|
]
|
|
389
400
|
})
|
|
390
401
|
});
|
|
391
|
-
},
|
|
392
|
-
let { token: t, activeFile: s, rootPath:
|
|
402
|
+
}, D = (e)=>{
|
|
403
|
+
let { token: t, activeFile: s, rootPath: r, status: o, viewport: a, onViewportChange: n } = e, { message: c } = i.A.useApp(), d = o ? C[o] : void 0, j = s ? m(s, r) : "", v = j.split("/"), y = v.pop(), _ = v.join("/"), w = async ()=>{
|
|
393
404
|
j && (await navigator.clipboard.writeText(j), c.success("relative path copied"));
|
|
394
|
-
}, b = "pass" ===
|
|
405
|
+
}, b = "pass" === o ? "green" : "fail" === o ? "red" : "running" === o ? "amber" : null;
|
|
395
406
|
return (0, l.jsxs)("div", {
|
|
396
407
|
className: "flex h-[48px] items-center justify-between px-4",
|
|
397
408
|
"data-testid": "preview-header",
|
|
@@ -434,7 +445,7 @@
|
|
|
434
445
|
s && (0, l.jsxs)("div", {
|
|
435
446
|
className: "flex items-center",
|
|
436
447
|
children: [
|
|
437
|
-
(0, l.jsx)(
|
|
448
|
+
(0, l.jsx)(u.A, {
|
|
438
449
|
title: "Copy relative path",
|
|
439
450
|
mouseLeaveDelay: 0,
|
|
440
451
|
children: (0, l.jsx)(p.Ay, {
|
|
@@ -445,14 +456,14 @@
|
|
|
445
456
|
color: t.colorTextDescription
|
|
446
457
|
},
|
|
447
458
|
"data-testid": "preview-copy-path",
|
|
448
|
-
icon: (0, l.jsx)(
|
|
459
|
+
icon: (0, l.jsx)(f.A, {
|
|
449
460
|
size: 12,
|
|
450
461
|
strokeWidth: 2.5
|
|
451
462
|
}),
|
|
452
|
-
onClick:
|
|
463
|
+
onClick: w
|
|
453
464
|
})
|
|
454
465
|
}),
|
|
455
|
-
(0, l.jsx)(
|
|
466
|
+
(0, l.jsx)(u.A, {
|
|
456
467
|
title: "Open in Editor",
|
|
457
468
|
mouseLeaveDelay: 0,
|
|
458
469
|
children: (0, l.jsx)(p.Ay, {
|
|
@@ -460,11 +471,11 @@
|
|
|
460
471
|
size: "small",
|
|
461
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",
|
|
462
473
|
"data-testid": "preview-open-editor",
|
|
463
|
-
icon: (0, l.jsx)(
|
|
474
|
+
icon: (0, l.jsx)(x.A, {
|
|
464
475
|
size: 12,
|
|
465
476
|
strokeWidth: 2.5
|
|
466
477
|
}),
|
|
467
|
-
onClick: ()=>
|
|
478
|
+
onClick: ()=>g(s),
|
|
468
479
|
style: {
|
|
469
480
|
color: t.colorTextDescription
|
|
470
481
|
}
|
|
@@ -484,31 +495,31 @@
|
|
|
484
495
|
(0, l.jsxs)("div", {
|
|
485
496
|
className: "flex items-center gap-3 shrink-0",
|
|
486
497
|
children: [
|
|
487
|
-
|
|
498
|
+
a && n && (0, l.jsx)(I, {
|
|
488
499
|
token: t,
|
|
489
|
-
value:
|
|
500
|
+
value: a,
|
|
490
501
|
onChange: n
|
|
491
502
|
}),
|
|
492
|
-
|
|
503
|
+
d && b && (0, l.jsx)("div", {
|
|
493
504
|
className: "flex items-center rounded-md px-2 py-0.5 text-[10px] font-semibold tracking-wider transition-colors shrink-0",
|
|
494
505
|
style: {
|
|
495
506
|
backgroundColor: `var(--ds-${b}-100)`,
|
|
496
507
|
color: `var(--ds-${b}-900)`,
|
|
497
508
|
border: `1px solid var(--ds-${b}-300)`
|
|
498
509
|
},
|
|
499
|
-
children:
|
|
510
|
+
children: d.label.toUpperCase()
|
|
500
511
|
})
|
|
501
512
|
]
|
|
502
513
|
})
|
|
503
514
|
]
|
|
504
515
|
});
|
|
505
516
|
};
|
|
506
|
-
var
|
|
507
|
-
let
|
|
508
|
-
let { className: t, style: s, direction:
|
|
509
|
-
if (!
|
|
517
|
+
var W = s(4772);
|
|
518
|
+
let G = (e)=>{
|
|
519
|
+
let { className: t, style: s, direction: r = "horizontal", children: o, autoSaveId: a, ...i } = e, c = n.Children.toArray(o).filter((e)=>n.isValidElement(e) && e.type === Z), d = n.useCallback(()=>{
|
|
520
|
+
if (!a) return null;
|
|
510
521
|
try {
|
|
511
|
-
let e = localStorage.getItem(
|
|
522
|
+
let e = localStorage.getItem(a);
|
|
512
523
|
if (e) {
|
|
513
524
|
let t = JSON.parse(e);
|
|
514
525
|
if (Array.isArray(t) && t.length === c.length) return t;
|
|
@@ -516,25 +527,25 @@
|
|
|
516
527
|
} catch {}
|
|
517
528
|
return null;
|
|
518
529
|
}, [
|
|
519
|
-
|
|
530
|
+
a,
|
|
520
531
|
c.length
|
|
521
|
-
])(),
|
|
522
|
-
let { defaultSize: s, minSize: l, maxSize:
|
|
532
|
+
])(), u = c.map((e, t)=>{
|
|
533
|
+
let { defaultSize: s, minSize: l, maxSize: r, children: o } = e.props, a = d?.[t] ?? s;
|
|
523
534
|
return {
|
|
524
|
-
defaultSize:
|
|
535
|
+
defaultSize: a ? `${a}%` : void 0,
|
|
525
536
|
min: l ? `${l}%` : void 0,
|
|
526
|
-
max:
|
|
527
|
-
children:
|
|
537
|
+
max: r ? `${r}%` : void 0,
|
|
538
|
+
children: o
|
|
528
539
|
};
|
|
529
|
-
}),
|
|
530
|
-
if (
|
|
531
|
-
localStorage.setItem(
|
|
540
|
+
}), p = n.useCallback((e)=>{
|
|
541
|
+
if (a) try {
|
|
542
|
+
localStorage.setItem(a, JSON.stringify(e));
|
|
532
543
|
} catch {}
|
|
533
544
|
}, [
|
|
534
|
-
|
|
545
|
+
a
|
|
535
546
|
]);
|
|
536
|
-
return (0, l.jsx)(
|
|
537
|
-
layout: "horizontal" ===
|
|
547
|
+
return (0, l.jsx)(W.A, {
|
|
548
|
+
layout: "horizontal" === r ? "horizontal" : "vertical",
|
|
538
549
|
className: t,
|
|
539
550
|
style: {
|
|
540
551
|
height: "100%",
|
|
@@ -543,21 +554,21 @@
|
|
|
543
554
|
margin: 0,
|
|
544
555
|
...s
|
|
545
556
|
},
|
|
546
|
-
onResizeEnd:
|
|
547
|
-
...
|
|
548
|
-
children:
|
|
557
|
+
onResizeEnd: p,
|
|
558
|
+
...i,
|
|
559
|
+
children: u.map((e)=>(0, l.jsx)(W.A.Panel, {
|
|
549
560
|
...e,
|
|
550
561
|
children: e.children
|
|
551
562
|
}, `panel-${e.defaultSize}-${e.min}-${e.max}`))
|
|
552
563
|
});
|
|
553
|
-
},
|
|
564
|
+
}, Z = (e)=>{
|
|
554
565
|
let { children: t } = e;
|
|
555
566
|
return (0, l.jsx)(l.Fragment, {
|
|
556
567
|
children: t
|
|
557
568
|
});
|
|
558
569
|
};
|
|
559
|
-
var
|
|
560
|
-
let
|
|
570
|
+
var L = s(8073), q = s(2927), H = s(4944);
|
|
571
|
+
let J = (e)=>(0, l.jsxs)("svg", {
|
|
561
572
|
xmlns: "http://www.w3.org/2000/svg",
|
|
562
573
|
fill: "none",
|
|
563
574
|
viewBox: "0 0 217 200",
|
|
@@ -1450,36 +1461,36 @@
|
|
|
1450
1461
|
]
|
|
1451
1462
|
})
|
|
1452
1463
|
]
|
|
1453
|
-
}),
|
|
1454
|
-
let { theme: t, onThemeToggle: s, isConnected:
|
|
1455
|
-
(0,
|
|
1456
|
-
let e =
|
|
1457
|
-
if (e.pass !==
|
|
1464
|
+
}), V = (e)=>{
|
|
1465
|
+
let { theme: t, onThemeToggle: s, isConnected: r, token: o, counts: a } = e, [i, c] = (0, n.useState)(0), d = (0, n.useRef)(a);
|
|
1466
|
+
(0, n.useEffect)(()=>{
|
|
1467
|
+
let e = d.current;
|
|
1468
|
+
if (e.pass !== a.pass || e.fail !== a.fail || e.running !== a.running) {
|
|
1458
1469
|
let e = setTimeout(()=>{
|
|
1459
1470
|
c((e)=>e + 1);
|
|
1460
1471
|
}, 100);
|
|
1461
1472
|
return ()=>clearTimeout(e);
|
|
1462
1473
|
}
|
|
1463
|
-
|
|
1474
|
+
d.current = a;
|
|
1464
1475
|
}, [
|
|
1465
|
-
|
|
1476
|
+
a
|
|
1466
1477
|
]);
|
|
1467
|
-
let
|
|
1468
|
-
system:
|
|
1469
|
-
light:
|
|
1470
|
-
dark:
|
|
1478
|
+
let h = a.idle + a.running + a.pass + a.fail + a.skip, f = (e)=>0 === h ? 0 : e / h * 100, x = f(a.pass), m = f(a.fail), g = f(a.running), j = {
|
|
1479
|
+
system: L.A,
|
|
1480
|
+
light: q.A,
|
|
1481
|
+
dark: H.A
|
|
1471
1482
|
}[t];
|
|
1472
1483
|
return (0, l.jsxs)("div", {
|
|
1473
1484
|
className: "relative flex h-[48px] items-center justify-between px-4",
|
|
1474
1485
|
"data-testid": "sidebar-header",
|
|
1475
1486
|
style: {
|
|
1476
|
-
background:
|
|
1487
|
+
background: o.colorBgContainer
|
|
1477
1488
|
},
|
|
1478
1489
|
children: [
|
|
1479
1490
|
(0, l.jsxs)("div", {
|
|
1480
1491
|
className: "flex items-center gap-2",
|
|
1481
1492
|
children: [
|
|
1482
|
-
(0, l.jsx)(
|
|
1493
|
+
(0, l.jsx)(J, {
|
|
1483
1494
|
className: "h-6 transition-all"
|
|
1484
1495
|
}),
|
|
1485
1496
|
(0, l.jsxs)("div", {
|
|
@@ -1500,17 +1511,17 @@
|
|
|
1500
1511
|
(0, l.jsxs)("div", {
|
|
1501
1512
|
className: "flex items-center gap-3",
|
|
1502
1513
|
children: [
|
|
1503
|
-
(0, l.jsx)(
|
|
1504
|
-
title:
|
|
1514
|
+
(0, l.jsx)(u.A, {
|
|
1515
|
+
title: r ? "Connected" : "Connecting...",
|
|
1505
1516
|
mouseLeaveDelay: 0,
|
|
1506
1517
|
children: (0, l.jsx)("span", {
|
|
1507
1518
|
className: "inline-flex h-2 w-2 cursor-default rounded-full",
|
|
1508
1519
|
style: {
|
|
1509
|
-
backgroundColor:
|
|
1520
|
+
backgroundColor: r ? "var(--ds-green-700)" : "var(--accents-4)"
|
|
1510
1521
|
}
|
|
1511
1522
|
})
|
|
1512
1523
|
}),
|
|
1513
|
-
(0, l.jsx)(
|
|
1524
|
+
(0, l.jsx)(u.A, {
|
|
1514
1525
|
title: {
|
|
1515
1526
|
system: "Theme: System",
|
|
1516
1527
|
light: "Theme: Light",
|
|
@@ -1530,7 +1541,7 @@
|
|
|
1530
1541
|
"system" === t ? s("light") : "light" === t ? s("dark") : s("system");
|
|
1531
1542
|
},
|
|
1532
1543
|
style: {
|
|
1533
|
-
color:
|
|
1544
|
+
color: o.colorTextDescription
|
|
1534
1545
|
}
|
|
1535
1546
|
})
|
|
1536
1547
|
})
|
|
@@ -1543,40 +1554,40 @@
|
|
|
1543
1554
|
},
|
|
1544
1555
|
children: [
|
|
1545
1556
|
(0, l.jsx)("div", {
|
|
1546
|
-
className: `absolute inset-y-0 left-0 h-full transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] ${
|
|
1557
|
+
className: `absolute inset-y-0 left-0 h-full transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] ${i > 0 ? "progress-flash-active" : ""}`,
|
|
1547
1558
|
style: {
|
|
1548
1559
|
width: `${x}%`,
|
|
1549
1560
|
background: "var(--ds-green-700)",
|
|
1550
1561
|
zIndex: 3,
|
|
1551
1562
|
color: "var(--ds-green-700)"
|
|
1552
1563
|
}
|
|
1553
|
-
}, `pass-${
|
|
1564
|
+
}, `pass-${i}`),
|
|
1554
1565
|
(0, l.jsx)("div", {
|
|
1555
|
-
className: `absolute inset-y-0 left-0 h-full transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] ${
|
|
1566
|
+
className: `absolute inset-y-0 left-0 h-full transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] ${i > 0 ? "progress-flash-active" : ""}`,
|
|
1556
1567
|
style: {
|
|
1557
1568
|
width: `${x + m}%`,
|
|
1558
1569
|
background: "var(--ds-red-800)",
|
|
1559
1570
|
zIndex: 2,
|
|
1560
1571
|
color: "var(--ds-red-800)"
|
|
1561
1572
|
}
|
|
1562
|
-
}, `fail-${
|
|
1573
|
+
}, `fail-${i}`),
|
|
1563
1574
|
(0, l.jsx)("div", {
|
|
1564
|
-
className: `absolute inset-y-0 left-0 h-full transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] ${
|
|
1575
|
+
className: `absolute inset-y-0 left-0 h-full transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] ${i > 0 ? "progress-flash-active" : ""}`,
|
|
1565
1576
|
style: {
|
|
1566
1577
|
width: `${x + m + g}%`,
|
|
1567
1578
|
background: "var(--ds-amber-700)",
|
|
1568
1579
|
zIndex: 1,
|
|
1569
1580
|
color: "var(--ds-amber-700)"
|
|
1570
1581
|
}
|
|
1571
|
-
}, `run-${
|
|
1582
|
+
}, `run-${i}`)
|
|
1572
1583
|
]
|
|
1573
1584
|
})
|
|
1574
1585
|
]
|
|
1575
1586
|
});
|
|
1576
1587
|
};
|
|
1577
|
-
var
|
|
1578
|
-
let
|
|
1579
|
-
let { counts: t, isRunning: s } = e,
|
|
1588
|
+
var X = s(3478), K = s(6109), Y = s(2200), Q = s(5541), ee = s(8721), et = s(1183);
|
|
1589
|
+
let es = (0, n.memo)((e)=>{
|
|
1590
|
+
let { counts: t, isRunning: s } = e, r = s && 0 === t.running;
|
|
1580
1591
|
return (0, l.jsx)("div", {
|
|
1581
1592
|
className: "flex h-6 cursor-default select-none items-center",
|
|
1582
1593
|
children: (0, l.jsx)("div", {
|
|
@@ -1598,9 +1609,9 @@
|
|
|
1598
1609
|
color: "amber"
|
|
1599
1610
|
}
|
|
1600
1611
|
].map((e)=>{
|
|
1601
|
-
let s = t[e.key] || 0,
|
|
1602
|
-
return (0, l.jsxs)(
|
|
1603
|
-
className: `m-0 flex items-center gap-1 px-2 py-0 border-0 ${
|
|
1612
|
+
let s = t[e.key] || 0, o = "running" === e.key;
|
|
1613
|
+
return (0, l.jsxs)(et.A, {
|
|
1614
|
+
className: `m-0 flex items-center gap-1 px-2 py-0 border-0 ${o && r ? "animate-pulse" : ""}`,
|
|
1604
1615
|
style: {
|
|
1605
1616
|
display: "flex",
|
|
1606
1617
|
alignItems: "center",
|
|
@@ -1633,8 +1644,8 @@
|
|
|
1633
1644
|
})
|
|
1634
1645
|
})
|
|
1635
1646
|
});
|
|
1636
|
-
}),
|
|
1637
|
-
let { token: t, filterText: s, onFilterChange:
|
|
1647
|
+
}), el = (e)=>{
|
|
1648
|
+
let { token: t, filterText: s, onFilterChange: r, isAllExpanded: o, onToggleExpandAll: a, onRerun: i, counts: n, isRunning: c } = e;
|
|
1638
1649
|
return (0, l.jsxs)("div", {
|
|
1639
1650
|
className: "flex flex-col gap-3 px-4 py-3",
|
|
1640
1651
|
"data-testid": "test-files-header",
|
|
@@ -1646,7 +1657,7 @@
|
|
|
1646
1657
|
className: "flex items-center justify-between",
|
|
1647
1658
|
children: [
|
|
1648
1659
|
(0, l.jsx)("div", {
|
|
1649
|
-
children: (0, l.jsx)(
|
|
1660
|
+
children: (0, l.jsx)(es, {
|
|
1650
1661
|
counts: n,
|
|
1651
1662
|
isRunning: c
|
|
1652
1663
|
})
|
|
@@ -1654,20 +1665,20 @@
|
|
|
1654
1665
|
(0, l.jsxs)("div", {
|
|
1655
1666
|
className: "flex items-center gap-1",
|
|
1656
1667
|
children: [
|
|
1657
|
-
(0, l.jsx)(
|
|
1658
|
-
title:
|
|
1668
|
+
(0, l.jsx)(u.A, {
|
|
1669
|
+
title: o ? "Collapse all" : "Expand all",
|
|
1659
1670
|
mouseLeaveDelay: 0,
|
|
1660
1671
|
children: (0, l.jsx)(p.Ay, {
|
|
1661
1672
|
type: "text",
|
|
1662
1673
|
size: "small",
|
|
1663
|
-
icon:
|
|
1674
|
+
icon: o ? (0, l.jsx)(K.A, {
|
|
1664
1675
|
size: 13,
|
|
1665
1676
|
strokeWidth: 2.5
|
|
1666
|
-
}) : (0, l.jsx)(
|
|
1677
|
+
}) : (0, l.jsx)(Y.A, {
|
|
1667
1678
|
size: 13,
|
|
1668
1679
|
strokeWidth: 2.5
|
|
1669
1680
|
}),
|
|
1670
|
-
onClick:
|
|
1681
|
+
onClick: a,
|
|
1671
1682
|
className: "flex h-8 w-8 items-center justify-center rounded-md p-0",
|
|
1672
1683
|
"data-testid": "test-files-toggle-expand",
|
|
1673
1684
|
style: {
|
|
@@ -1675,13 +1686,13 @@
|
|
|
1675
1686
|
}
|
|
1676
1687
|
})
|
|
1677
1688
|
}),
|
|
1678
|
-
(0, l.jsx)(
|
|
1689
|
+
(0, l.jsx)(u.A, {
|
|
1679
1690
|
title: "Re-run all tests",
|
|
1680
1691
|
mouseLeaveDelay: 0,
|
|
1681
1692
|
children: (0, l.jsx)(p.Ay, {
|
|
1682
1693
|
type: "text",
|
|
1683
1694
|
size: "small",
|
|
1684
|
-
icon: (0, l.jsx)(
|
|
1695
|
+
icon: (0, l.jsx)(Q.A, {
|
|
1685
1696
|
size: 15,
|
|
1686
1697
|
strokeWidth: 2.5
|
|
1687
1698
|
}),
|
|
@@ -1698,15 +1709,15 @@
|
|
|
1698
1709
|
})
|
|
1699
1710
|
]
|
|
1700
1711
|
}),
|
|
1701
|
-
(0, l.jsx)(
|
|
1712
|
+
(0, l.jsx)(X.A, {
|
|
1702
1713
|
placeholder: "Search tests...",
|
|
1703
|
-
prefix: (0, l.jsx)(
|
|
1714
|
+
prefix: (0, l.jsx)(ee.A, {
|
|
1704
1715
|
size: 14,
|
|
1705
1716
|
strokeWidth: 2.5,
|
|
1706
1717
|
className: "opacity-40"
|
|
1707
1718
|
}),
|
|
1708
1719
|
value: s,
|
|
1709
|
-
onChange: (e)=>
|
|
1720
|
+
onChange: (e)=>r(e.target.value),
|
|
1710
1721
|
allowClear: !0,
|
|
1711
1722
|
className: "rounded-md py-1.5",
|
|
1712
1723
|
"data-testid": "test-files-search"
|
|
@@ -1714,53 +1725,53 @@
|
|
|
1714
1725
|
]
|
|
1715
1726
|
});
|
|
1716
1727
|
};
|
|
1717
|
-
var
|
|
1718
|
-
let
|
|
1728
|
+
var er = s(1803), eo = s(5152), ea = s(8049), ei = s(4023), en = s(4953);
|
|
1729
|
+
let ec = [
|
|
1719
1730
|
"pass",
|
|
1720
1731
|
"fail",
|
|
1721
1732
|
"skip"
|
|
1722
|
-
],
|
|
1723
|
-
let { icon: t, iconColor: s, status:
|
|
1724
|
-
return (0,
|
|
1725
|
-
x && null !==
|
|
1733
|
+
], ed = (e)=>{
|
|
1734
|
+
let { icon: t, iconColor: s, status: r, label: o, caseId: a, onRerun: i, buttonTextColor: c } = e, d = (0, n.useRef)(null), [h, f] = (0, n.useState)(0), x = ec.includes(r);
|
|
1735
|
+
return (0, n.useEffect)(()=>{
|
|
1736
|
+
x && null !== d.current && d.current !== r && f((e)=>e + 1), d.current = r;
|
|
1726
1737
|
}, [
|
|
1727
|
-
|
|
1738
|
+
r,
|
|
1728
1739
|
x
|
|
1729
1740
|
]), (0, l.jsxs)("div", {
|
|
1730
1741
|
className: "group grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2",
|
|
1731
1742
|
"data-testid": "test-case-title",
|
|
1732
|
-
"data-test-case":
|
|
1743
|
+
"data-test-case": a,
|
|
1733
1744
|
children: [
|
|
1734
1745
|
t && (0, l.jsx)("span", {
|
|
1735
|
-
className: `flex w-[16px] shrink-0 items-center justify-center ${
|
|
1746
|
+
className: `flex w-[16px] shrink-0 items-center justify-center ${h > 0 ? "status-icon-flash" : ""}`,
|
|
1736
1747
|
style: {
|
|
1737
1748
|
color: s
|
|
1738
1749
|
},
|
|
1739
1750
|
children: t
|
|
1740
|
-
},
|
|
1741
|
-
(0, l.jsx)(
|
|
1742
|
-
title:
|
|
1751
|
+
}, h),
|
|
1752
|
+
(0, l.jsx)(u.A, {
|
|
1753
|
+
title: o,
|
|
1743
1754
|
mouseLeaveDelay: 0,
|
|
1744
1755
|
children: (0, l.jsx)("span", {
|
|
1745
1756
|
className: "truncate text-[13px] tracking-tight opacity-70",
|
|
1746
|
-
children:
|
|
1757
|
+
children: o
|
|
1747
1758
|
})
|
|
1748
1759
|
}),
|
|
1749
1760
|
(0, l.jsx)("div", {
|
|
1750
1761
|
className: "opacity-0 transition-opacity duration-200 group-hover:opacity-100",
|
|
1751
|
-
children: (0, l.jsx)(
|
|
1762
|
+
children: (0, l.jsx)(u.A, {
|
|
1752
1763
|
title: "Re-run this test",
|
|
1753
1764
|
mouseLeaveDelay: 0,
|
|
1754
1765
|
children: (0, l.jsx)(p.Ay, {
|
|
1755
1766
|
type: "text",
|
|
1756
1767
|
size: "small",
|
|
1757
|
-
icon: (0, l.jsx)(
|
|
1768
|
+
icon: (0, l.jsx)(Q.A, {
|
|
1758
1769
|
size: 14,
|
|
1759
1770
|
strokeWidth: 2.5
|
|
1760
1771
|
}),
|
|
1761
|
-
disabled: !
|
|
1772
|
+
disabled: !i,
|
|
1762
1773
|
onClick: (e)=>{
|
|
1763
|
-
e.stopPropagation(),
|
|
1774
|
+
e.stopPropagation(), i?.();
|
|
1764
1775
|
},
|
|
1765
1776
|
className: "inline-flex h-5 w-5 items-center justify-center p-0",
|
|
1766
1777
|
"data-testid": "test-case-rerun",
|
|
@@ -1772,30 +1783,30 @@
|
|
|
1772
1783
|
})
|
|
1773
1784
|
]
|
|
1774
1785
|
});
|
|
1775
|
-
},
|
|
1786
|
+
}, eu = [
|
|
1776
1787
|
"pass",
|
|
1777
1788
|
"fail"
|
|
1778
|
-
],
|
|
1779
|
-
let { icon: t, iconColor: s, status:
|
|
1780
|
-
return (0,
|
|
1781
|
-
g && null !==
|
|
1789
|
+
], ep = (e)=>{
|
|
1790
|
+
let { icon: t, iconColor: s, status: r, relativePath: o, filePath: a, onOpen: i, onRerun: c, textColor: d } = e, h = (0, n.useRef)(null), [f, m] = (0, n.useState)(0), g = eu.includes(r);
|
|
1791
|
+
return (0, n.useEffect)(()=>{
|
|
1792
|
+
g && null !== h.current && h.current !== r && m((e)=>e + 1), h.current = r;
|
|
1782
1793
|
}, [
|
|
1783
|
-
|
|
1794
|
+
r,
|
|
1784
1795
|
g
|
|
1785
1796
|
]), (0, l.jsxs)("div", {
|
|
1786
1797
|
className: "group grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2",
|
|
1787
1798
|
"data-testid": "test-file-title",
|
|
1788
|
-
"data-test-file":
|
|
1799
|
+
"data-test-file": a,
|
|
1789
1800
|
children: [
|
|
1790
1801
|
(0, l.jsx)("span", {
|
|
1791
|
-
className: `flex w-[16px] shrink-0 items-center justify-center ${
|
|
1802
|
+
className: `flex w-[16px] shrink-0 items-center justify-center ${f > 0 ? "status-icon-flash" : ""}`,
|
|
1792
1803
|
style: {
|
|
1793
1804
|
color: s
|
|
1794
1805
|
},
|
|
1795
1806
|
children: t
|
|
1796
|
-
},
|
|
1797
|
-
(0, l.jsx)(
|
|
1798
|
-
title:
|
|
1807
|
+
}, f),
|
|
1808
|
+
(0, l.jsx)(u.A, {
|
|
1809
|
+
title: o,
|
|
1799
1810
|
styles: {
|
|
1800
1811
|
container: {
|
|
1801
1812
|
whiteSpace: "nowrap",
|
|
@@ -1805,50 +1816,50 @@
|
|
|
1805
1816
|
mouseLeaveDelay: 0,
|
|
1806
1817
|
children: (0, l.jsx)("span", {
|
|
1807
1818
|
className: "truncate font-mono text-[12px] font-medium tracking-tight opacity-90",
|
|
1808
|
-
children:
|
|
1819
|
+
children: o
|
|
1809
1820
|
})
|
|
1810
1821
|
}),
|
|
1811
1822
|
(0, l.jsxs)("div", {
|
|
1812
1823
|
className: "flex items-center gap-1 opacity-0 transition-opacity duration-200 group-hover:opacity-100",
|
|
1813
1824
|
children: [
|
|
1814
|
-
(0, l.jsx)(
|
|
1825
|
+
(0, l.jsx)(u.A, {
|
|
1815
1826
|
title: "Open in editor",
|
|
1816
1827
|
mouseLeaveDelay: 0,
|
|
1817
1828
|
children: (0, l.jsx)(p.Ay, {
|
|
1818
1829
|
type: "text",
|
|
1819
1830
|
size: "small",
|
|
1820
|
-
icon: (0, l.jsx)(
|
|
1831
|
+
icon: (0, l.jsx)(x.A, {
|
|
1821
1832
|
size: 14,
|
|
1822
1833
|
strokeWidth: 2.5
|
|
1823
1834
|
}),
|
|
1824
1835
|
onClick: (e)=>{
|
|
1825
|
-
e.stopPropagation(),
|
|
1836
|
+
e.stopPropagation(), i();
|
|
1826
1837
|
},
|
|
1827
1838
|
className: "inline-flex h-5 w-5 items-center justify-center p-0",
|
|
1828
1839
|
"data-testid": "test-file-open-editor",
|
|
1829
1840
|
style: {
|
|
1830
|
-
color:
|
|
1841
|
+
color: d
|
|
1831
1842
|
}
|
|
1832
1843
|
})
|
|
1833
1844
|
}),
|
|
1834
|
-
(0, l.jsx)(
|
|
1845
|
+
(0, l.jsx)(u.A, {
|
|
1835
1846
|
title: "Re-run this file",
|
|
1836
1847
|
mouseLeaveDelay: 0,
|
|
1837
1848
|
children: (0, l.jsx)(p.Ay, {
|
|
1838
1849
|
type: "text",
|
|
1839
1850
|
size: "small",
|
|
1840
|
-
icon: (0, l.jsx)(
|
|
1851
|
+
icon: (0, l.jsx)(Q.A, {
|
|
1841
1852
|
size: 14,
|
|
1842
1853
|
strokeWidth: 2.5
|
|
1843
1854
|
}),
|
|
1844
1855
|
disabled: !c,
|
|
1845
1856
|
onClick: (e)=>{
|
|
1846
|
-
e.stopPropagation(),
|
|
1857
|
+
e.stopPropagation(), c?.();
|
|
1847
1858
|
},
|
|
1848
1859
|
className: "inline-flex h-5 w-5 items-center justify-center p-0",
|
|
1849
1860
|
"data-testid": "test-file-rerun",
|
|
1850
1861
|
style: {
|
|
1851
|
-
color:
|
|
1862
|
+
color: d
|
|
1852
1863
|
}
|
|
1853
1864
|
})
|
|
1854
1865
|
})
|
|
@@ -1856,52 +1867,52 @@
|
|
|
1856
1867
|
})
|
|
1857
1868
|
]
|
|
1858
1869
|
});
|
|
1859
|
-
},
|
|
1870
|
+
}, eh = [
|
|
1860
1871
|
"pass",
|
|
1861
1872
|
"fail",
|
|
1862
1873
|
"skip"
|
|
1863
|
-
],
|
|
1864
|
-
let { icon: t, iconColor: s, status:
|
|
1865
|
-
return (0,
|
|
1866
|
-
x && null !==
|
|
1874
|
+
], ef = (e)=>{
|
|
1875
|
+
let { icon: t, iconColor: s, status: r, name: o, fullName: a, onRerun: i, buttonTextColor: c } = e, d = (0, n.useRef)(null), [h, f] = (0, n.useState)(0), x = eh.includes(r);
|
|
1876
|
+
return (0, n.useEffect)(()=>{
|
|
1877
|
+
x && null !== d.current && d.current !== r && f((e)=>e + 1), d.current = r;
|
|
1867
1878
|
}, [
|
|
1868
|
-
|
|
1879
|
+
r,
|
|
1869
1880
|
x
|
|
1870
1881
|
]), (0, l.jsxs)("div", {
|
|
1871
1882
|
className: "group grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2",
|
|
1872
1883
|
"data-testid": "test-suite-title",
|
|
1873
|
-
"data-test-suite":
|
|
1884
|
+
"data-test-suite": a,
|
|
1874
1885
|
children: [
|
|
1875
1886
|
t && (0, l.jsx)("span", {
|
|
1876
|
-
className: `flex w-[16px] shrink-0 items-center justify-center ${
|
|
1887
|
+
className: `flex w-[16px] shrink-0 items-center justify-center ${h > 0 ? "status-icon-flash" : ""}`,
|
|
1877
1888
|
style: {
|
|
1878
1889
|
color: s
|
|
1879
1890
|
},
|
|
1880
1891
|
children: t
|
|
1881
|
-
},
|
|
1882
|
-
(0, l.jsx)(
|
|
1883
|
-
title:
|
|
1892
|
+
}, h),
|
|
1893
|
+
(0, l.jsx)(u.A, {
|
|
1894
|
+
title: o,
|
|
1884
1895
|
mouseLeaveDelay: 0,
|
|
1885
1896
|
children: (0, l.jsx)("span", {
|
|
1886
1897
|
className: "truncate text-[13px] font-medium tracking-tight opacity-80",
|
|
1887
|
-
children:
|
|
1898
|
+
children: o
|
|
1888
1899
|
})
|
|
1889
1900
|
}),
|
|
1890
1901
|
(0, l.jsx)("div", {
|
|
1891
1902
|
className: "opacity-0 transition-opacity duration-200 group-hover:opacity-100",
|
|
1892
|
-
children: (0, l.jsx)(
|
|
1903
|
+
children: (0, l.jsx)(u.A, {
|
|
1893
1904
|
title: "Re-run this suite",
|
|
1894
1905
|
mouseLeaveDelay: 0,
|
|
1895
1906
|
children: (0, l.jsx)(p.Ay, {
|
|
1896
1907
|
type: "text",
|
|
1897
1908
|
size: "small",
|
|
1898
|
-
icon: (0, l.jsx)(
|
|
1909
|
+
icon: (0, l.jsx)(Q.A, {
|
|
1899
1910
|
size: 14,
|
|
1900
1911
|
strokeWidth: 2.5
|
|
1901
1912
|
}),
|
|
1902
|
-
disabled: !
|
|
1913
|
+
disabled: !i,
|
|
1903
1914
|
onClick: (e)=>{
|
|
1904
|
-
e.stopPropagation(),
|
|
1915
|
+
e.stopPropagation(), i?.();
|
|
1905
1916
|
},
|
|
1906
1917
|
className: "inline-flex h-5 w-5 items-center justify-center p-0",
|
|
1907
1918
|
"data-testid": "test-suite-rerun",
|
|
@@ -1913,17 +1924,17 @@
|
|
|
1913
1924
|
})
|
|
1914
1925
|
]
|
|
1915
1926
|
});
|
|
1916
|
-
},
|
|
1917
|
-
let { testFiles: t, statusMap: s, caseMap:
|
|
1918
|
-
if (!
|
|
1927
|
+
}, ex = (e)=>{
|
|
1928
|
+
let { testFiles: t, statusMap: s, caseMap: r, rootPath: o, projects: a, loading: i, connected: c, openFiles: d, activeFile: u, token: p, filterText: h, onExpandChange: f, onSelect: x, onRerunFile: j, onRerunTestCase: v } = e, { filteredTestFiles: y, filteredCaseMap: _ } = (0, n.useMemo)(()=>{
|
|
1929
|
+
if (!h.trim()) return {
|
|
1919
1930
|
filteredTestFiles: t,
|
|
1920
|
-
filteredCaseMap:
|
|
1931
|
+
filteredCaseMap: r
|
|
1921
1932
|
};
|
|
1922
|
-
let e =
|
|
1923
|
-
for (let
|
|
1924
|
-
let t =
|
|
1933
|
+
let e = h.toLowerCase(), s = [], l = {};
|
|
1934
|
+
for (let o of t){
|
|
1935
|
+
let t = o.testPath, a = t.toLowerCase().includes(e), i = r[t] ?? {}, n = {};
|
|
1925
1936
|
for (let [t, s] of Object.entries(i))(s.name.toLowerCase().includes(e) || s.fullName.toLowerCase().includes(e)) && (n[t] = s);
|
|
1926
|
-
(
|
|
1937
|
+
(a || Object.keys(n).length > 0) && (s.push(o), l[t] = a ? i : n);
|
|
1927
1938
|
}
|
|
1928
1939
|
return {
|
|
1929
1940
|
filteredTestFiles: s,
|
|
@@ -1931,9 +1942,9 @@
|
|
|
1931
1942
|
};
|
|
1932
1943
|
}, [
|
|
1933
1944
|
t,
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
]),
|
|
1945
|
+
r,
|
|
1946
|
+
h
|
|
1947
|
+
]), w = (0, n.useCallback)((e, t)=>{
|
|
1937
1948
|
if (0 === t.length) return [
|
|
1938
1949
|
{
|
|
1939
1950
|
key: `${e}::__empty`,
|
|
@@ -1955,10 +1966,10 @@
|
|
|
1955
1966
|
for (let e of t){
|
|
1956
1967
|
let t = s, l = e.parentNames;
|
|
1957
1968
|
for(let e = 0; e < l.length; e++){
|
|
1958
|
-
let s = l[e],
|
|
1969
|
+
let s = l[e], r = l.slice(0, e + 1);
|
|
1959
1970
|
t.children.has(s) || t.children.set(s, {
|
|
1960
1971
|
name: s,
|
|
1961
|
-
fullPath:
|
|
1972
|
+
fullPath: r,
|
|
1962
1973
|
children: new Map,
|
|
1963
1974
|
cases: [],
|
|
1964
1975
|
status: "idle"
|
|
@@ -1966,94 +1977,94 @@
|
|
|
1966
1977
|
}
|
|
1967
1978
|
t.cases.push(e);
|
|
1968
1979
|
}
|
|
1969
|
-
let
|
|
1980
|
+
let r = (e)=>{
|
|
1970
1981
|
let t = [];
|
|
1971
|
-
for (let s of e.children.values())t.push(
|
|
1982
|
+
for (let s of e.children.values())t.push(r(s));
|
|
1972
1983
|
for (let s of e.cases)t.push(s.status);
|
|
1973
1984
|
return t.some((e)=>"fail" === e) ? "fail" : t.some((e)=>"running" === e) ? "running" : t.every((e)=>"pass" === e) ? "pass" : t.every((e)=>"skip" === e) ? "skip" : t.some((e)=>"pass" === e) ? "pass" : "idle";
|
|
1974
|
-
},
|
|
1975
|
-
let
|
|
1985
|
+
}, o = (t, s)=>{
|
|
1986
|
+
let a = [];
|
|
1976
1987
|
for (let i of t.children.values()){
|
|
1977
|
-
let t =
|
|
1978
|
-
|
|
1988
|
+
let t = r(i), n = b[t], d = `${s}::suite::${i.fullPath.join("::")}`, u = i.fullPath.join(" ");
|
|
1989
|
+
a.push({
|
|
1979
1990
|
key: d,
|
|
1980
|
-
title: (0, l.jsx)(
|
|
1991
|
+
title: (0, l.jsx)(ef, {
|
|
1981
1992
|
icon: n.icon,
|
|
1982
1993
|
iconColor: n.color,
|
|
1983
1994
|
status: t,
|
|
1984
1995
|
name: i.name,
|
|
1985
|
-
fullName:
|
|
1996
|
+
fullName: u,
|
|
1986
1997
|
onRerun: c ? ()=>{
|
|
1987
|
-
v(e,
|
|
1998
|
+
v(e, u);
|
|
1988
1999
|
} : void 0,
|
|
1989
|
-
buttonTextColor:
|
|
2000
|
+
buttonTextColor: p.colorTextSecondary
|
|
1990
2001
|
}),
|
|
1991
|
-
children:
|
|
2002
|
+
children: o(i, d),
|
|
1992
2003
|
selectable: !1
|
|
1993
2004
|
});
|
|
1994
2005
|
}
|
|
1995
|
-
for (let
|
|
1996
|
-
let t =
|
|
1997
|
-
|
|
1998
|
-
key: `${s}::case::${
|
|
1999
|
-
title: (0, l.jsx)(
|
|
2006
|
+
for (let r of t.cases){
|
|
2007
|
+
let t = b[r.status];
|
|
2008
|
+
a.push({
|
|
2009
|
+
key: `${s}::case::${r.id}`,
|
|
2010
|
+
title: (0, l.jsx)(ed, {
|
|
2000
2011
|
icon: t.icon,
|
|
2001
2012
|
iconColor: t.color,
|
|
2002
|
-
status:
|
|
2003
|
-
label:
|
|
2004
|
-
caseId:
|
|
2013
|
+
status: r.status,
|
|
2014
|
+
label: r.name,
|
|
2015
|
+
caseId: r.id,
|
|
2005
2016
|
onRerun: c ? ()=>{
|
|
2006
|
-
v(e,
|
|
2017
|
+
v(e, r.fullName);
|
|
2007
2018
|
} : void 0,
|
|
2008
|
-
buttonTextColor:
|
|
2019
|
+
buttonTextColor: p.colorTextSecondary
|
|
2009
2020
|
}),
|
|
2010
2021
|
isLeaf: !0,
|
|
2011
2022
|
selectable: !1
|
|
2012
2023
|
});
|
|
2013
2024
|
}
|
|
2014
|
-
return
|
|
2025
|
+
return a;
|
|
2015
2026
|
};
|
|
2016
|
-
return
|
|
2027
|
+
return o(s, e);
|
|
2017
2028
|
}, [
|
|
2018
2029
|
c,
|
|
2019
2030
|
v,
|
|
2020
|
-
|
|
2021
|
-
]), k = (0,
|
|
2031
|
+
p.colorTextSecondary
|
|
2032
|
+
]), k = (0, n.useMemo)(()=>{
|
|
2022
2033
|
let e = [
|
|
2023
2034
|
...new Set(y.map((e)=>e.projectName))
|
|
2024
2035
|
], t = new Map;
|
|
2025
|
-
for (let e of
|
|
2026
|
-
let
|
|
2027
|
-
let
|
|
2036
|
+
for (let e of a)t.set(e.name, e.projectRoot);
|
|
2037
|
+
let r = (e, t)=>{
|
|
2038
|
+
let r = e.testPath, a = s[r] ?? "idle", i = C[a], n = m(r, t ?? o), d = Object.values(_[r] ?? {});
|
|
2028
2039
|
return {
|
|
2029
|
-
key:
|
|
2030
|
-
title: (0, l.jsx)(
|
|
2040
|
+
key: r,
|
|
2041
|
+
title: (0, l.jsx)(ep, {
|
|
2031
2042
|
icon: i.icon,
|
|
2032
2043
|
iconColor: i.color,
|
|
2033
|
-
status:
|
|
2044
|
+
status: a,
|
|
2034
2045
|
relativePath: n,
|
|
2035
|
-
filePath:
|
|
2036
|
-
onOpen: ()=>
|
|
2046
|
+
filePath: r,
|
|
2047
|
+
onOpen: ()=>g(r),
|
|
2037
2048
|
onRerun: c ? ()=>{
|
|
2038
|
-
j(
|
|
2049
|
+
j(r);
|
|
2039
2050
|
} : void 0,
|
|
2040
|
-
textColor:
|
|
2051
|
+
textColor: p.colorTextSecondary
|
|
2041
2052
|
}),
|
|
2042
|
-
children:
|
|
2053
|
+
children: w(r, d)
|
|
2043
2054
|
};
|
|
2044
2055
|
};
|
|
2045
2056
|
return e.length > 1 ? e.map((e)=>{
|
|
2046
|
-
let
|
|
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";
|
|
2047
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");
|
|
2048
|
-
let d =
|
|
2059
|
+
let d = C[c];
|
|
2049
2060
|
return {
|
|
2050
|
-
key:
|
|
2061
|
+
key: a,
|
|
2051
2062
|
title: (0, l.jsxs)("div", {
|
|
2052
2063
|
className: "flex items-center gap-1.5",
|
|
2053
2064
|
"data-testid": "test-project-title",
|
|
2054
2065
|
"data-test-project": e,
|
|
2055
2066
|
children: [
|
|
2056
|
-
(0, l.jsx)(
|
|
2067
|
+
(0, l.jsx)(ea.A, {
|
|
2057
2068
|
size: 14,
|
|
2058
2069
|
style: {
|
|
2059
2070
|
color: d.color
|
|
@@ -2064,28 +2075,28 @@
|
|
|
2064
2075
|
(0, l.jsx)("span", {
|
|
2065
2076
|
className: "truncate text-sm font-medium",
|
|
2066
2077
|
style: {
|
|
2067
|
-
color:
|
|
2078
|
+
color: p.colorText
|
|
2068
2079
|
},
|
|
2069
2080
|
children: e
|
|
2070
2081
|
})
|
|
2071
2082
|
]
|
|
2072
2083
|
}),
|
|
2073
|
-
children:
|
|
2084
|
+
children: o.map((e)=>r(e, i)),
|
|
2074
2085
|
selectable: !1
|
|
2075
2086
|
};
|
|
2076
|
-
}) : y.map((e)=>
|
|
2087
|
+
}) : y.map((e)=>r(e));
|
|
2077
2088
|
}, [
|
|
2078
|
-
|
|
2089
|
+
w,
|
|
2079
2090
|
_,
|
|
2080
2091
|
c,
|
|
2081
2092
|
j,
|
|
2082
|
-
r,
|
|
2083
2093
|
a,
|
|
2094
|
+
o,
|
|
2084
2095
|
s,
|
|
2085
2096
|
y,
|
|
2086
|
-
|
|
2097
|
+
p
|
|
2087
2098
|
]);
|
|
2088
|
-
return
|
|
2099
|
+
return i ? (0, l.jsx)("div", {
|
|
2089
2100
|
className: "space-y-2 p-3",
|
|
2090
2101
|
children: [
|
|
2091
2102
|
1,
|
|
@@ -2094,12 +2105,12 @@
|
|
|
2094
2105
|
].map((e)=>(0, l.jsxs)("div", {
|
|
2095
2106
|
className: "flex items-center gap-2",
|
|
2096
2107
|
children: [
|
|
2097
|
-
(0, l.jsx)(
|
|
2108
|
+
(0, l.jsx)(er.A.Avatar, {
|
|
2098
2109
|
active: !0,
|
|
2099
2110
|
size: "small",
|
|
2100
2111
|
shape: "circle"
|
|
2101
2112
|
}),
|
|
2102
|
-
(0, l.jsx)(
|
|
2113
|
+
(0, l.jsx)(er.A.Input, {
|
|
2103
2114
|
active: !0,
|
|
2104
2115
|
size: "small",
|
|
2105
2116
|
style: {
|
|
@@ -2120,27 +2131,27 @@
|
|
|
2120
2131
|
className: "text-(--muted-foreground)",
|
|
2121
2132
|
children: "No matching tests found"
|
|
2122
2133
|
})
|
|
2123
|
-
}) : (0, l.jsx)(
|
|
2134
|
+
}) : (0, l.jsx)(eo.A, {
|
|
2124
2135
|
blockNode: !0,
|
|
2125
2136
|
"data-testid": "test-files-tree",
|
|
2126
2137
|
showLine: !1,
|
|
2127
|
-
switcherIcon: (e)=>e.expanded ? (0, l.jsx)(
|
|
2138
|
+
switcherIcon: (e)=>e.expanded ? (0, l.jsx)(ei.A, {
|
|
2128
2139
|
size: 12,
|
|
2129
2140
|
strokeWidth: 2.5
|
|
2130
|
-
}) : (0, l.jsx)(
|
|
2141
|
+
}) : (0, l.jsx)(en.A, {
|
|
2131
2142
|
size: 12,
|
|
2132
2143
|
strokeWidth: 2.5
|
|
2133
2144
|
}),
|
|
2134
2145
|
showIcon: !0,
|
|
2135
2146
|
expandAction: "click",
|
|
2136
2147
|
expandedKeys: d,
|
|
2137
|
-
selectedKeys:
|
|
2138
|
-
|
|
2148
|
+
selectedKeys: u ? [
|
|
2149
|
+
u
|
|
2139
2150
|
] : [],
|
|
2140
2151
|
onExpand: (e)=>f(e.filter((e)=>"string" == typeof e)),
|
|
2141
2152
|
onSelect: (e, t)=>{
|
|
2142
2153
|
let s = t.node.key, l = y.map((e)=>e.testPath);
|
|
2143
|
-
"string" == typeof s && l.includes(s) &&
|
|
2154
|
+
"string" == typeof s && l.includes(s) && x(s);
|
|
2144
2155
|
},
|
|
2145
2156
|
treeData: k,
|
|
2146
2157
|
className: "bg-transparent",
|
|
@@ -2154,11 +2165,11 @@
|
|
|
2154
2165
|
children: "Reconnecting..."
|
|
2155
2166
|
})
|
|
2156
2167
|
});
|
|
2157
|
-
},
|
|
2168
|
+
}, em = (e)=>{
|
|
2158
2169
|
if (!e) return {
|
|
2159
2170
|
mode: "full"
|
|
2160
2171
|
};
|
|
2161
|
-
if ("string" == typeof e &&
|
|
2172
|
+
if ("string" == typeof e && $(e)) return {
|
|
2162
2173
|
mode: "preset",
|
|
2163
2174
|
preset: e,
|
|
2164
2175
|
orientation: "portrait"
|
|
@@ -2174,14 +2185,14 @@
|
|
|
2174
2185
|
return {
|
|
2175
2186
|
mode: "full"
|
|
2176
2187
|
};
|
|
2177
|
-
},
|
|
2178
|
-
let { token: t, selection: s, active:
|
|
2188
|
+
}, eg = (e, t, s)=>Math.min(s, Math.max(t, e)), ej = (e)=>{
|
|
2189
|
+
let { token: t, selection: s, active: r, onResponsiveResize: o, children: a, ...i } = e, c = (0, n.useRef)(null), d = ((e)=>{
|
|
2179
2190
|
if ("full" === e.mode) return null;
|
|
2180
2191
|
if ("responsive" === e.mode) return {
|
|
2181
2192
|
width: e.width,
|
|
2182
2193
|
height: e.height
|
|
2183
2194
|
};
|
|
2184
|
-
let t =
|
|
2195
|
+
let t = T(e.preset);
|
|
2185
2196
|
return "landscape" === e.orientation ? {
|
|
2186
2197
|
width: t.height,
|
|
2187
2198
|
height: t.width
|
|
@@ -2190,30 +2201,29 @@
|
|
|
2190
2201
|
height: t.height
|
|
2191
2202
|
};
|
|
2192
2203
|
})(s);
|
|
2193
|
-
return ((0,
|
|
2194
|
-
if (!
|
|
2204
|
+
return ((0, n.useLayoutEffect)(()=>{
|
|
2205
|
+
if (!r || "responsive" !== s.mode || !o) return;
|
|
2195
2206
|
let e = c.current;
|
|
2196
2207
|
if (!e) return;
|
|
2197
2208
|
let t = !0, l = new ResizeObserver((e)=>{
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
if (!o) return;
|
|
2209
|
+
let l = e[0]?.contentRect;
|
|
2210
|
+
if (!l) return;
|
|
2201
2211
|
if (t) {
|
|
2202
2212
|
t = !1;
|
|
2203
2213
|
return;
|
|
2204
2214
|
}
|
|
2205
|
-
if (
|
|
2206
|
-
let r =
|
|
2207
|
-
(r !== s.width ||
|
|
2215
|
+
if (l.width <= 0 || l.height <= 0) return;
|
|
2216
|
+
let r = eg(Math.round(l.width), 1, 1e4), a = eg(Math.round(l.height), 1, 1e4);
|
|
2217
|
+
(r !== s.width || a !== s.height) && o({
|
|
2208
2218
|
width: r,
|
|
2209
|
-
height:
|
|
2219
|
+
height: a
|
|
2210
2220
|
});
|
|
2211
2221
|
});
|
|
2212
2222
|
return l.observe(e), ()=>l.disconnect();
|
|
2213
2223
|
}, [
|
|
2214
|
-
|
|
2224
|
+
r,
|
|
2215
2225
|
s,
|
|
2216
|
-
|
|
2226
|
+
o
|
|
2217
2227
|
]), d) ? (0, l.jsx)("div", {
|
|
2218
2228
|
className: "flex h-full w-full items-start justify-center p-4 overflow-auto",
|
|
2219
2229
|
children: (0, l.jsx)("div", {
|
|
@@ -2233,79 +2243,72 @@
|
|
|
2233
2243
|
maxWidth: "responsive" === s.mode ? 1e4 : void 0,
|
|
2234
2244
|
maxHeight: "responsive" === s.mode ? 1e4 : void 0
|
|
2235
2245
|
},
|
|
2236
|
-
...
|
|
2237
|
-
children:
|
|
2246
|
+
...i,
|
|
2247
|
+
children: a
|
|
2238
2248
|
})
|
|
2239
2249
|
}) : (0, l.jsx)("div", {
|
|
2240
2250
|
className: "h-full w-full",
|
|
2241
2251
|
style: {
|
|
2242
2252
|
background: t.colorBgContainer
|
|
2243
2253
|
},
|
|
2244
|
-
...
|
|
2245
|
-
children:
|
|
2254
|
+
...i,
|
|
2255
|
+
children: a
|
|
2246
2256
|
});
|
|
2247
|
-
},
|
|
2248
|
-
if (
|
|
2257
|
+
}, ev = (e)=>"object" == typeof e && null !== e, ey = (e, t)=>"string" == typeof e[t], e_ = (e)=>"object" == typeof e && null !== e && "requestId" in e && "string" == typeof e.requestId ? e.requestId : "unknown-request", ew = async (e, t, s)=>{
|
|
2258
|
+
if (null === s || "function" != typeof s.postMessage) return;
|
|
2249
2259
|
let l = (e)=>{
|
|
2250
2260
|
s.postMessage({
|
|
2251
|
-
type:
|
|
2261
|
+
type: r,
|
|
2252
2262
|
payload: e
|
|
2253
2263
|
}, "*");
|
|
2254
2264
|
};
|
|
2265
|
+
if ("unknown-request" === e_(t)) return void l({
|
|
2266
|
+
requestId: e_(t),
|
|
2267
|
+
error: "Invalid dispatch request payload: expected an object with string requestId."
|
|
2268
|
+
});
|
|
2269
|
+
if (!e) return void l({
|
|
2270
|
+
requestId: t.requestId,
|
|
2271
|
+
error: "Container RPC is not ready for dispatch."
|
|
2272
|
+
});
|
|
2255
2273
|
try {
|
|
2256
|
-
|
|
2257
|
-
switch(t.method){
|
|
2258
|
-
case "resolveSnapshotPath":
|
|
2259
|
-
s = await e.resolveSnapshotPath(t.args.testPath);
|
|
2260
|
-
break;
|
|
2261
|
-
case "readSnapshotFile":
|
|
2262
|
-
s = await e.readSnapshotFile(t.args.filepath);
|
|
2263
|
-
break;
|
|
2264
|
-
case "saveSnapshotFile":
|
|
2265
|
-
s = await e.saveSnapshotFile(t.args.filepath, t.args.content);
|
|
2266
|
-
break;
|
|
2267
|
-
case "removeSnapshotFile":
|
|
2268
|
-
s = await e.removeSnapshotFile(t.args.filepath);
|
|
2269
|
-
break;
|
|
2270
|
-
default:
|
|
2271
|
-
s = void 0;
|
|
2272
|
-
}
|
|
2273
|
-
l({
|
|
2274
|
-
id: t.id,
|
|
2275
|
-
result: s
|
|
2276
|
-
});
|
|
2274
|
+
l(await e.dispatch(t));
|
|
2277
2275
|
} catch (e) {
|
|
2278
2276
|
l({
|
|
2279
|
-
|
|
2277
|
+
requestId: t.requestId,
|
|
2280
2278
|
error: e instanceof Error ? e.message : String(e)
|
|
2281
2279
|
});
|
|
2282
2280
|
}
|
|
2283
|
-
},
|
|
2281
|
+
}, eC = [
|
|
2284
2282
|
1e3,
|
|
2285
2283
|
2e3,
|
|
2286
2284
|
4e3,
|
|
2287
2285
|
8e3,
|
|
2288
2286
|
16e3,
|
|
2289
2287
|
3e4
|
|
2290
|
-
],
|
|
2291
|
-
let l = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], o = new URL("/runner.html", t || window.location.origin);
|
|
2292
|
-
return o.searchParams.set("testFile", e), s && o.searchParams.set("testNamePattern", s), l && o.searchParams.set("t", Date.now().toString()), o.toString();
|
|
2288
|
+
], eb = ()=>"function" == typeof globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : `run-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`, ek = function(e, t, s) {
|
|
2289
|
+
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
|
+
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();
|
|
2293
2291
|
};
|
|
2294
|
-
var
|
|
2295
|
-
let
|
|
2296
|
-
for(var e
|
|
2297
|
-
|
|
2298
|
-
},
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2292
|
+
var eS = s(5999);
|
|
2293
|
+
let eF = function() {
|
|
2294
|
+
for(var e = arguments.length, t = Array(e), s = 0; s < e; s++)t[s] = arguments[s];
|
|
2295
|
+
window.__RSTEST_BROWSER_OPTIONS__?.debug === !0 && console.log(...t);
|
|
2296
|
+
}, eN = (e)=>{
|
|
2297
|
+
try {
|
|
2298
|
+
return new URL(e.src, window.location.href).searchParams.get("runId") ?? void 0;
|
|
2299
|
+
} catch {
|
|
2300
|
+
return;
|
|
2301
|
+
}
|
|
2302
|
+
}, eA = (e)=>{
|
|
2303
|
+
let { options: t, theme: s, setTheme: a } = e, { token: i } = o.A.useToken(), [c, u] = (0, n.useState)([]), [p, h] = (0, n.useState)(null), [f, x] = (0, n.useState)({}), [m, g] = (0, n.useState)({}), [j, v] = (0, n.useState)([]), [y, _] = (0, n.useState)(""), w = (0, n.useRef)(new Map), [C, b] = (0, n.useState)({}), k = (0, n.useCallback)((e)=>{
|
|
2304
|
+
let s = 5381;
|
|
2305
|
+
for(let e = 0; e < t.rootPath.length; e++)s = 33 * s ^ t.rootPath.charCodeAt(e);
|
|
2306
|
+
return `rstest-viewport:${(s >>> 0).toString(16)}:${e}`;
|
|
2304
2307
|
}, [
|
|
2305
|
-
|
|
2306
|
-
]),
|
|
2308
|
+
t.rootPath
|
|
2309
|
+
]), S = (0, n.useCallback)((e)=>{
|
|
2307
2310
|
try {
|
|
2308
|
-
let t = localStorage.getItem(
|
|
2311
|
+
let t = localStorage.getItem(k(e));
|
|
2309
2312
|
if (!t) return null;
|
|
2310
2313
|
let s = JSON.parse(t);
|
|
2311
2314
|
if (!s || "object" != typeof s) return null;
|
|
@@ -2324,7 +2327,7 @@
|
|
|
2324
2327
|
}
|
|
2325
2328
|
if ("preset" === l) {
|
|
2326
2329
|
let e = s.preset, t = s.orientation;
|
|
2327
|
-
if (
|
|
2330
|
+
if ($(e) && ("portrait" === t || "landscape" === t)) return {
|
|
2328
2331
|
mode: "preset",
|
|
2329
2332
|
preset: e,
|
|
2330
2333
|
orientation: t
|
|
@@ -2335,38 +2338,49 @@
|
|
|
2335
2338
|
return null;
|
|
2336
2339
|
}
|
|
2337
2340
|
}, [
|
|
2338
|
-
|
|
2339
|
-
]),
|
|
2341
|
+
k
|
|
2342
|
+
]), F = (0, n.useCallback)((e, t)=>{
|
|
2340
2343
|
try {
|
|
2341
|
-
localStorage.setItem(
|
|
2344
|
+
localStorage.setItem(k(e), JSON.stringify(t));
|
|
2342
2345
|
} catch {}
|
|
2343
2346
|
}, [
|
|
2344
|
-
|
|
2345
|
-
]), [
|
|
2347
|
+
k
|
|
2348
|
+
]), [N, A] = (0, n.useState)(()=>{
|
|
2346
2349
|
let e = {};
|
|
2347
|
-
for (let
|
|
2350
|
+
for (let s of t.projects ?? [])e[s.name] = S(s.name) ?? em(s.viewport);
|
|
2348
2351
|
return e;
|
|
2349
2352
|
});
|
|
2350
|
-
(0,
|
|
2351
|
-
|
|
2352
|
-
let
|
|
2353
|
+
(0, n.useEffect)(()=>{
|
|
2354
|
+
A((e)=>{
|
|
2355
|
+
let s = {
|
|
2353
2356
|
...e
|
|
2354
2357
|
};
|
|
2355
|
-
for (let e of
|
|
2356
|
-
return
|
|
2358
|
+
for (let e of t.projects ?? [])s[e.name] || (s[e.name] = S(e.name) ?? em(e.viewport));
|
|
2359
|
+
return s;
|
|
2357
2360
|
});
|
|
2358
2361
|
}, [
|
|
2359
|
-
|
|
2360
|
-
|
|
2362
|
+
t.projects,
|
|
2363
|
+
S
|
|
2361
2364
|
]);
|
|
2362
|
-
let
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2365
|
+
let P = (0, n.useCallback)(async (e, s)=>(eF("[Container] handleReloadTestFile called:", e, s), new Promise((l, r)=>{
|
|
2366
|
+
let o = w.current.get(e);
|
|
2367
|
+
o && o.reject(Error(`Reload for "${e}" was superseded by a newer request.`)), w.current.set(e, {
|
|
2368
|
+
resolve: l,
|
|
2369
|
+
reject: r
|
|
2370
|
+
});
|
|
2371
|
+
let a = document.querySelector(`iframe[data-test-file="${e}"]`);
|
|
2372
|
+
if (eF("[Container] Found iframe:", a), !a) {
|
|
2373
|
+
w.current.delete(e), r(Error(`Cannot reload test file "${e}": iframe not found`));
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2376
|
+
let i = eb();
|
|
2377
|
+
b((t)=>({
|
|
2378
|
+
...t,
|
|
2379
|
+
[e]: i
|
|
2380
|
+
})), x((t)=>({
|
|
2367
2381
|
...t,
|
|
2368
2382
|
[e]: "running"
|
|
2369
|
-
})),
|
|
2383
|
+
})), g((t)=>{
|
|
2370
2384
|
let s = t[e] ?? {}, l = {};
|
|
2371
2385
|
for (let [e, t] of Object.entries(s))l[e] = {
|
|
2372
2386
|
...t,
|
|
@@ -2377,42 +2391,40 @@
|
|
|
2377
2391
|
[e]: l
|
|
2378
2392
|
};
|
|
2379
2393
|
});
|
|
2380
|
-
let
|
|
2381
|
-
|
|
2382
|
-
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
return (0, i.useEffect)(()=>{
|
|
2394
|
+
let n = ek(e, t.runnerUrl, s, !1, i);
|
|
2395
|
+
eF("[Container] Setting iframe.src to:", n), a.src = n;
|
|
2396
|
+
})), [
|
|
2397
|
+
t.runnerUrl
|
|
2398
|
+
]), { rpc: M, loading: z, connected: O } = ((e, t, s)=>{
|
|
2399
|
+
let [l, r] = (0, n.useState)(null), [o, a] = (0, n.useState)(!0), [i, c] = (0, n.useState)(!1), d = (0, n.useRef)(e), u = (0, n.useRef)(s), p = (0, n.useRef)(null);
|
|
2400
|
+
return (0, n.useEffect)(()=>{
|
|
2388
2401
|
d.current = e;
|
|
2389
2402
|
}, [
|
|
2390
2403
|
e
|
|
2391
|
-
]), (0,
|
|
2392
|
-
|
|
2404
|
+
]), (0, n.useEffect)(()=>{
|
|
2405
|
+
u.current = s;
|
|
2393
2406
|
}, [
|
|
2394
2407
|
s
|
|
2395
|
-
]), (0,
|
|
2396
|
-
if (!t) return void
|
|
2397
|
-
let e = null, s = 0, l = null,
|
|
2408
|
+
]), (0, n.useEffect)(()=>{
|
|
2409
|
+
if (!t) return void a(!1);
|
|
2410
|
+
let e = null, s = 0, l = null, o = !0, i = ()=>{
|
|
2398
2411
|
let n;
|
|
2399
|
-
if (!
|
|
2400
|
-
|
|
2401
|
-
let
|
|
2412
|
+
if (!o) return;
|
|
2413
|
+
p.current = e = new WebSocket((n = "https:" === window.location.protocol ? "wss:" : "ws:", `${n}//${window.location.hostname}:${t}`));
|
|
2414
|
+
let h = {
|
|
2402
2415
|
onTestFileUpdate (e) {
|
|
2403
|
-
|
|
2416
|
+
eF("[Container RPC] onTestFileUpdate called:", e), d.current(e);
|
|
2404
2417
|
},
|
|
2405
|
-
reloadTestFile (e, t) {
|
|
2406
|
-
|
|
2407
|
-
ey("[Container RPC] reloadTestFile called:", e, t), null == (s = p.current) || s.call(p, e, t);
|
|
2418
|
+
async reloadTestFile (e, t) {
|
|
2419
|
+
eF("[Container RPC] reloadTestFile called:", e, t), await u.current?.(e, t);
|
|
2408
2420
|
}
|
|
2409
2421
|
};
|
|
2410
2422
|
e.onopen = ()=>{
|
|
2411
|
-
if (!
|
|
2412
|
-
|
|
2413
|
-
let t = (0,
|
|
2423
|
+
if (!o || !e) return;
|
|
2424
|
+
eF("[Container] WebSocket connected"), s = 0, c(!0);
|
|
2425
|
+
let t = (0, eS.L)(h, {
|
|
2414
2426
|
post: (t)=>{
|
|
2415
|
-
|
|
2427
|
+
e?.readyState === WebSocket.OPEN && e.send(JSON.stringify(t));
|
|
2416
2428
|
},
|
|
2417
2429
|
on: (t)=>{
|
|
2418
2430
|
e && (e.onmessage = (e)=>{
|
|
@@ -2423,67 +2435,76 @@
|
|
|
2423
2435
|
});
|
|
2424
2436
|
}
|
|
2425
2437
|
});
|
|
2426
|
-
|
|
2427
|
-
|
|
2438
|
+
r(t), t.getTestFiles().then((e)=>{
|
|
2439
|
+
o && (d.current(e), a(!1));
|
|
2428
2440
|
}).catch(()=>{
|
|
2429
|
-
|
|
2441
|
+
o && a(!1);
|
|
2430
2442
|
});
|
|
2431
2443
|
}, e.onclose = ()=>{
|
|
2432
|
-
if (
|
|
2433
|
-
|
|
2434
|
-
let t =
|
|
2435
|
-
|
|
2436
|
-
|
|
2444
|
+
if (p.current !== e || !o) return;
|
|
2445
|
+
eF("[Container] WebSocket disconnected"), r(null), c(!1);
|
|
2446
|
+
let t = eC[Math.min(s, eC.length - 1)];
|
|
2447
|
+
eF(`[Container] Reconnecting in ${t}ms (attempt ${s + 1})`), s++, l = setTimeout(()=>{
|
|
2448
|
+
o && i();
|
|
2437
2449
|
}, t);
|
|
2438
2450
|
}, e.onerror = ()=>{
|
|
2439
|
-
|
|
2451
|
+
o && eF("[Container] WebSocket error");
|
|
2440
2452
|
};
|
|
2441
2453
|
};
|
|
2442
2454
|
return i(), ()=>{
|
|
2443
|
-
|
|
2455
|
+
o = !1, l && clearTimeout(l), e && e.close();
|
|
2444
2456
|
};
|
|
2445
2457
|
}, [
|
|
2446
2458
|
t
|
|
2447
2459
|
]), {
|
|
2448
2460
|
rpc: l,
|
|
2449
|
-
loading:
|
|
2450
|
-
connected:
|
|
2461
|
+
loading: o,
|
|
2462
|
+
connected: i
|
|
2451
2463
|
};
|
|
2452
|
-
})(
|
|
2453
|
-
(0,
|
|
2454
|
-
|
|
2464
|
+
})(u, t?.wsPort, P);
|
|
2465
|
+
(0, n.useEffect)(()=>()=>{
|
|
2466
|
+
if (0 === w.current.size) return;
|
|
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)=>{
|
|
2455
2472
|
let t = {};
|
|
2456
|
-
for (let s of
|
|
2473
|
+
for (let s of c)t[s.testPath] = e[s.testPath] ?? "idle";
|
|
2457
2474
|
return t;
|
|
2458
|
-
}),
|
|
2475
|
+
}), g((e)=>{
|
|
2459
2476
|
let t = {};
|
|
2460
|
-
for (let s of
|
|
2477
|
+
for (let s of c)t[s.testPath] = e[s.testPath] ?? {};
|
|
2478
|
+
return t;
|
|
2479
|
+
}), b((e)=>{
|
|
2480
|
+
let t = {};
|
|
2481
|
+
for (let s of c)t[s.testPath] = e[s.testPath] ?? eb();
|
|
2461
2482
|
return t;
|
|
2462
2483
|
});
|
|
2463
|
-
let e =
|
|
2464
|
-
|
|
2484
|
+
let e = c.map((e)=>e.testPath);
|
|
2485
|
+
v((t)=>t.filter((t)=>e.includes(t))), h((t)=>!t && c.length > 0 || t && !e.includes(t) && c.length > 0 ? c[0].testPath : t);
|
|
2465
2486
|
}, [
|
|
2466
|
-
|
|
2487
|
+
c
|
|
2467
2488
|
]);
|
|
2468
|
-
let
|
|
2469
|
-
|
|
2470
|
-
}, []),
|
|
2489
|
+
let R = (0, n.useCallback)((e)=>"pass" === e ? "pass" : "fail" === e ? "fail" : "skip" === e || "todo" === e ? "skip" : "running", []), U = (0, n.useCallback)((e)=>{
|
|
2490
|
+
h(e);
|
|
2491
|
+
}, []), E = (0, n.useCallback)((e, t)=>{
|
|
2471
2492
|
let s = (t.parentNames ?? []).filter(Boolean), l = [
|
|
2472
2493
|
...s,
|
|
2473
2494
|
t.name
|
|
2474
2495
|
].join(" ") || t.name;
|
|
2475
|
-
|
|
2476
|
-
let
|
|
2496
|
+
g((r)=>{
|
|
2497
|
+
let o = r[e] ?? {};
|
|
2477
2498
|
return {
|
|
2478
|
-
...
|
|
2499
|
+
...r,
|
|
2479
2500
|
[e]: {
|
|
2480
|
-
...
|
|
2501
|
+
...o,
|
|
2481
2502
|
[t.testId]: {
|
|
2482
2503
|
id: t.testId,
|
|
2483
2504
|
name: t.name,
|
|
2484
2505
|
parentNames: s,
|
|
2485
2506
|
fullName: l,
|
|
2486
|
-
status:
|
|
2507
|
+
status: R(t.status),
|
|
2487
2508
|
filePath: t.testPath || e,
|
|
2488
2509
|
location: t.location
|
|
2489
2510
|
}
|
|
@@ -2491,101 +2512,130 @@
|
|
|
2491
2512
|
};
|
|
2492
2513
|
});
|
|
2493
2514
|
}, [
|
|
2494
|
-
|
|
2495
|
-
]),
|
|
2496
|
-
|
|
2515
|
+
R
|
|
2516
|
+
]), T = (0, n.useCallback)((e)=>{
|
|
2517
|
+
h(e), M && O && M.rerunTest(e);
|
|
2497
2518
|
}, [
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
]),
|
|
2501
|
-
|
|
2519
|
+
M,
|
|
2520
|
+
O
|
|
2521
|
+
]), B = (0, n.useCallback)((e, t)=>{
|
|
2522
|
+
h(e), M && O && M.rerunTest(e, t);
|
|
2502
2523
|
}, [
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
]),
|
|
2506
|
-
if (
|
|
2524
|
+
M,
|
|
2525
|
+
O
|
|
2526
|
+
]), I = (0, n.useCallback)(()=>{
|
|
2527
|
+
if (M && O) for (let e of c)M.rerunTest(e.testPath);
|
|
2507
2528
|
}, [
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2529
|
+
c,
|
|
2530
|
+
M,
|
|
2531
|
+
O
|
|
2511
2532
|
]);
|
|
2512
|
-
(0,
|
|
2533
|
+
(0, n.useEffect)(()=>{
|
|
2513
2534
|
let e = (e)=>{
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
...e,
|
|
2529
|
-
[t]: l
|
|
2530
|
-
};
|
|
2531
|
-
}), null == A || A.onTestFileStart({
|
|
2532
|
-
testPath: t,
|
|
2533
|
-
projectName: e.projectName ?? ""
|
|
2534
|
-
}));
|
|
2535
|
-
} else if ("case-result" === s.type) {
|
|
2536
|
-
let e = s.payload;
|
|
2537
|
-
(null == e ? void 0 : e.testPath) && (U(e.testPath, e), null == A || A.onTestCaseResult(e));
|
|
2538
|
-
} else if ("file-complete" === s.type) {
|
|
2539
|
-
let e = s.payload, t = e.testPath;
|
|
2540
|
-
if ("string" == typeof t) {
|
|
2541
|
-
let s = "pass" === e.status || "skip" === e.status;
|
|
2542
|
-
m((e)=>({
|
|
2535
|
+
let t = e.data?.type !== "__rstest_dispatch__" ? null : e.data.payload;
|
|
2536
|
+
if (t) {
|
|
2537
|
+
if ("file-start" === t.type) {
|
|
2538
|
+
let e = t.payload, s = e.testPath;
|
|
2539
|
+
"string" == typeof s && (x((e)=>({
|
|
2540
|
+
...e,
|
|
2541
|
+
[s]: "running"
|
|
2542
|
+
})), g((e)=>{
|
|
2543
|
+
let t = e[s] ?? {}, l = {};
|
|
2544
|
+
for (let [e, s] of Object.entries(t))l[e] = {
|
|
2545
|
+
...s,
|
|
2546
|
+
status: "running"
|
|
2547
|
+
};
|
|
2548
|
+
return {
|
|
2543
2549
|
...e,
|
|
2544
|
-
[
|
|
2545
|
-
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2550
|
+
[s]: l
|
|
2551
|
+
};
|
|
2552
|
+
}), M?.onTestFileStart({
|
|
2553
|
+
testPath: s,
|
|
2554
|
+
projectName: e.projectName ?? ""
|
|
2555
|
+
}));
|
|
2556
|
+
} else if ("case-result" === t.type) {
|
|
2557
|
+
let e = t.payload;
|
|
2558
|
+
e?.testPath && (E(e.testPath, e), M?.onTestCaseResult(e));
|
|
2559
|
+
} else if ("file-complete" === t.type) {
|
|
2560
|
+
let e = t.payload, s = e.testPath;
|
|
2561
|
+
if ("string" == typeof s) {
|
|
2562
|
+
let t = "pass" === e.status || "skip" === e.status;
|
|
2563
|
+
x((e)=>({
|
|
2549
2564
|
...e,
|
|
2550
|
-
s
|
|
2551
|
-
|
|
2552
|
-
l
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2565
|
+
[s]: t ? "pass" : "fail"
|
|
2566
|
+
})), g((t)=>{
|
|
2567
|
+
let l = {};
|
|
2568
|
+
for (let t of e.results ?? [])if (t?.testId) {
|
|
2569
|
+
let e = (t.parentNames ?? []).filter(Boolean), r = [
|
|
2570
|
+
...e,
|
|
2571
|
+
t.name
|
|
2572
|
+
].join(" ") || t.name;
|
|
2573
|
+
l[t.testId] = {
|
|
2574
|
+
id: t.testId,
|
|
2575
|
+
name: t.name,
|
|
2576
|
+
parentNames: e,
|
|
2577
|
+
fullName: r,
|
|
2578
|
+
status: R(t.status),
|
|
2579
|
+
filePath: t.testPath || s,
|
|
2580
|
+
location: t.location
|
|
2581
|
+
};
|
|
2582
|
+
}
|
|
2583
|
+
return {
|
|
2584
|
+
...t,
|
|
2585
|
+
[s]: l
|
|
2560
2586
|
};
|
|
2587
|
+
});
|
|
2588
|
+
let l = w.current.get(s);
|
|
2589
|
+
l && (w.current.delete(s), l.resolve()), M?.onTestFileComplete(e);
|
|
2590
|
+
}
|
|
2591
|
+
} else if ("fatal" === t.type) {
|
|
2592
|
+
let e = t.payload;
|
|
2593
|
+
if (p && x((e)=>({
|
|
2594
|
+
...e,
|
|
2595
|
+
[p]: "fail"
|
|
2596
|
+
})), w.current.size > 0) {
|
|
2597
|
+
let t = Error(e.message || "Browser runner fatal");
|
|
2598
|
+
for (let e of w.current.values())e.reject(t);
|
|
2599
|
+
w.current.clear();
|
|
2600
|
+
}
|
|
2601
|
+
M?.onFatal(e);
|
|
2602
|
+
} else if ("log" === t.type) {
|
|
2603
|
+
let e = t.payload;
|
|
2604
|
+
M?.onLog(e);
|
|
2605
|
+
} else if ("dispatch-rpc-request" === t.type) {
|
|
2606
|
+
let s = t.payload, l = ((e)=>{
|
|
2607
|
+
if (!ev(e) || "browser" !== e.namespace || "rpc" !== e.method) return null;
|
|
2608
|
+
let t = e.args;
|
|
2609
|
+
return ev(t) && ey(t, "id") && ey(t, "kind") && ey(t, "method") && ey(t, "testPath") && ey(t, "runId") ? t : null;
|
|
2610
|
+
})(s);
|
|
2611
|
+
if (l) {
|
|
2612
|
+
let t, o = (t = l.testPath, Array.from(document.querySelectorAll("iframe[data-test-file]")).find((e)=>e.dataset.testFile === t)), a = o ? eN(o) : void 0;
|
|
2613
|
+
if (!a || l.runId !== a) {
|
|
2614
|
+
let t, o;
|
|
2615
|
+
null !== (t = e.source) && "function" == typeof t.postMessage && e.source.postMessage({
|
|
2616
|
+
type: r,
|
|
2617
|
+
payload: (o = s.requestId, {
|
|
2618
|
+
requestId: o,
|
|
2619
|
+
stale: !0,
|
|
2620
|
+
error: `Ignored stale browser RPC request from previous run: ${l.kind}.${l.method} (testPath: ${l.testPath}, runId: ${l.runId}, currentRunId: ${a ?? "none"})`
|
|
2621
|
+
})
|
|
2622
|
+
}, "*");
|
|
2623
|
+
return;
|
|
2561
2624
|
}
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
[t]: l
|
|
2565
|
-
};
|
|
2566
|
-
}), null == A || A.onTestFileComplete(e);
|
|
2625
|
+
}
|
|
2626
|
+
ew(M, s, e.source);
|
|
2567
2627
|
}
|
|
2568
|
-
}
|
|
2569
|
-
u && m((e)=>({
|
|
2570
|
-
...e,
|
|
2571
|
-
[u]: "fail"
|
|
2572
|
-
}));
|
|
2573
|
-
let e = s.payload;
|
|
2574
|
-
null == A || A.onFatal(e);
|
|
2575
|
-
} else if ("log" === s.type) {
|
|
2576
|
-
let e = s.payload;
|
|
2577
|
-
null == A || A.onLog(e);
|
|
2578
|
-
} else "snapshot-rpc-request" === s.type && em(A, s.payload, e.source);
|
|
2628
|
+
}
|
|
2579
2629
|
};
|
|
2580
2630
|
return window.addEventListener("message", e), ()=>window.removeEventListener("message", e);
|
|
2581
2631
|
}, [
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2632
|
+
p,
|
|
2633
|
+
E,
|
|
2634
|
+
R,
|
|
2635
|
+
M
|
|
2586
2636
|
]);
|
|
2587
|
-
let
|
|
2588
|
-
let e = Object.values(
|
|
2637
|
+
let W = (0, n.useMemo)(()=>{
|
|
2638
|
+
let e = Object.values(m).flatMap((e)=>Object.values(e));
|
|
2589
2639
|
return {
|
|
2590
2640
|
idle: e.filter((e)=>"idle" === e.status).length,
|
|
2591
2641
|
running: e.filter((e)=>"running" === e.status).length,
|
|
@@ -2594,215 +2644,217 @@
|
|
|
2594
2644
|
skip: e.filter((e)=>"skip" === e.status).length
|
|
2595
2645
|
};
|
|
2596
2646
|
}, [
|
|
2597
|
-
|
|
2598
|
-
]),
|
|
2599
|
-
|
|
2600
|
-
]),
|
|
2647
|
+
m
|
|
2648
|
+
]), L = (0, n.useMemo)(()=>Object.values(f).some((e)=>"running" === e), [
|
|
2649
|
+
f
|
|
2650
|
+
]), q = (0, n.useMemo)(()=>{
|
|
2601
2651
|
let e = [], t = [
|
|
2602
|
-
...new Set(
|
|
2652
|
+
...new Set(c.map((e)=>e.projectName))
|
|
2603
2653
|
];
|
|
2604
2654
|
if (t.length > 1) for (let s of t)e.push(`__project__${s}`);
|
|
2605
|
-
for (let t of
|
|
2655
|
+
for (let t of c){
|
|
2606
2656
|
let s = t.testPath;
|
|
2607
2657
|
e.push(s);
|
|
2608
|
-
let l = Object.values(
|
|
2658
|
+
let l = Object.values(m[s] ?? {}), r = new Set;
|
|
2609
2659
|
for (let e of l){
|
|
2610
2660
|
let t = e.parentNames;
|
|
2611
2661
|
for(let e = 1; e <= t.length; e++){
|
|
2612
2662
|
let s = t.slice(0, e).join("::");
|
|
2613
|
-
|
|
2663
|
+
r.add(s);
|
|
2614
2664
|
}
|
|
2615
2665
|
}
|
|
2616
|
-
for (let t of
|
|
2617
|
-
let l = t.split("::"),
|
|
2666
|
+
for (let t of r){
|
|
2667
|
+
let l = t.split("::"), r = s;
|
|
2618
2668
|
for(let e = 1; e <= l.length; e++){
|
|
2619
2669
|
let t = l.slice(0, e).join("::");
|
|
2620
|
-
|
|
2670
|
+
r = `${r}::suite::${t}`;
|
|
2621
2671
|
}
|
|
2622
|
-
e.push(
|
|
2672
|
+
e.push(r);
|
|
2623
2673
|
}
|
|
2624
2674
|
}
|
|
2625
2675
|
return [
|
|
2626
2676
|
...new Set(e)
|
|
2627
2677
|
];
|
|
2628
2678
|
}, [
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
]),
|
|
2679
|
+
c,
|
|
2680
|
+
m
|
|
2681
|
+
]), H = t.projects?.[0]?.name || t.rootPath.split("/").filter(Boolean).pop() || "default", J = `rstest-split-${H}`, X = (0, n.useMemo)(()=>{
|
|
2632
2682
|
let e = new Map;
|
|
2633
|
-
for (let
|
|
2683
|
+
for (let s of t.projects ?? [])e.set(s.name, s.viewport);
|
|
2634
2684
|
return e;
|
|
2635
2685
|
}, [
|
|
2636
|
-
|
|
2637
|
-
]),
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
return (null == o ? void 0 : o.projectName) ?? (null == (t = a.projects) || null == (e = t[0]) ? void 0 : e.name);
|
|
2686
|
+
t.projects
|
|
2687
|
+
]), K = (0, n.useMemo)(()=>{
|
|
2688
|
+
if (!p) return t.projects?.[0]?.name;
|
|
2689
|
+
let e = c.find((e)=>e.testPath === p);
|
|
2690
|
+
return e?.projectName ?? t.projects?.[0]?.name;
|
|
2642
2691
|
}, [
|
|
2643
|
-
u,
|
|
2644
2692
|
p,
|
|
2645
|
-
|
|
2646
|
-
|
|
2693
|
+
c,
|
|
2694
|
+
t.projects
|
|
2695
|
+
]), Y = (0, n.useMemo)(()=>K ? N[K] ?? em(X.get(K)) : {
|
|
2647
2696
|
mode: "full"
|
|
2648
2697
|
}, [
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
]),
|
|
2653
|
-
|
|
2698
|
+
K,
|
|
2699
|
+
N,
|
|
2700
|
+
X
|
|
2701
|
+
]), Q = (0, n.useCallback)((e)=>{
|
|
2702
|
+
K && (F(K, e), A((t)=>({
|
|
2654
2703
|
...t,
|
|
2655
|
-
[
|
|
2704
|
+
[K]: e
|
|
2656
2705
|
})));
|
|
2657
2706
|
}, [
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
]),
|
|
2661
|
-
|
|
2707
|
+
K,
|
|
2708
|
+
F
|
|
2709
|
+
]), ee = (0, n.useCallback)((e, t)=>{
|
|
2710
|
+
A((s)=>{
|
|
2662
2711
|
let l = s[e];
|
|
2663
2712
|
if (!l || "responsive" !== l.mode || l.width === t.width && l.height === t.height) return s;
|
|
2664
|
-
let
|
|
2713
|
+
let r = {
|
|
2665
2714
|
mode: "responsive",
|
|
2666
2715
|
width: t.width,
|
|
2667
2716
|
height: t.height
|
|
2668
2717
|
};
|
|
2669
|
-
return
|
|
2718
|
+
return F(e, r), {
|
|
2670
2719
|
...s,
|
|
2671
|
-
[e]:
|
|
2720
|
+
[e]: r
|
|
2672
2721
|
};
|
|
2673
2722
|
});
|
|
2674
2723
|
}, [
|
|
2675
|
-
|
|
2724
|
+
F
|
|
2676
2725
|
]);
|
|
2677
2726
|
return (0, l.jsx)("div", {
|
|
2678
2727
|
className: "m-0 h-screen w-full overflow-hidden p-0",
|
|
2679
2728
|
style: {
|
|
2680
|
-
background:
|
|
2729
|
+
background: i.colorBgContainer
|
|
2681
2730
|
},
|
|
2682
|
-
children: (0, l.jsxs)(
|
|
2731
|
+
children: (0, l.jsxs)(G, {
|
|
2683
2732
|
direction: "horizontal",
|
|
2684
2733
|
className: "h-full w-full",
|
|
2685
|
-
autoSaveId:
|
|
2734
|
+
autoSaveId: J,
|
|
2686
2735
|
children: [
|
|
2687
|
-
(0, l.jsx)(
|
|
2736
|
+
(0, l.jsx)(Z, {
|
|
2688
2737
|
defaultSize: 32,
|
|
2689
2738
|
minSize: 20,
|
|
2690
2739
|
maxSize: 50,
|
|
2691
2740
|
children: (0, l.jsxs)("div", {
|
|
2692
2741
|
className: "flex h-full flex-col overflow-hidden",
|
|
2693
2742
|
style: {
|
|
2694
|
-
background:
|
|
2743
|
+
background: i.colorBgContainer
|
|
2695
2744
|
},
|
|
2696
2745
|
children: [
|
|
2697
|
-
(0, l.jsx)(
|
|
2698
|
-
theme:
|
|
2699
|
-
onThemeToggle:
|
|
2700
|
-
isConnected:
|
|
2701
|
-
token:
|
|
2702
|
-
counts:
|
|
2703
|
-
}),
|
|
2704
|
-
(0, l.jsx)(
|
|
2705
|
-
token:
|
|
2706
|
-
filterText:
|
|
2707
|
-
onFilterChange:
|
|
2708
|
-
isAllExpanded:
|
|
2746
|
+
(0, l.jsx)(V, {
|
|
2747
|
+
theme: s,
|
|
2748
|
+
onThemeToggle: a,
|
|
2749
|
+
isConnected: O,
|
|
2750
|
+
token: i,
|
|
2751
|
+
counts: W
|
|
2752
|
+
}),
|
|
2753
|
+
(0, l.jsx)(el, {
|
|
2754
|
+
token: i,
|
|
2755
|
+
filterText: y,
|
|
2756
|
+
onFilterChange: _,
|
|
2757
|
+
isAllExpanded: q.length > 0 && q.every((e)=>j.includes(e)),
|
|
2709
2758
|
onToggleExpandAll: ()=>{
|
|
2710
|
-
|
|
2759
|
+
q.length > 0 && q.every((e)=>j.includes(e)) ? v([]) : v(q);
|
|
2711
2760
|
},
|
|
2712
|
-
onRerun:
|
|
2713
|
-
counts:
|
|
2714
|
-
isRunning:
|
|
2761
|
+
onRerun: O ? I : void 0,
|
|
2762
|
+
counts: W,
|
|
2763
|
+
isRunning: L
|
|
2715
2764
|
}),
|
|
2716
2765
|
(0, l.jsx)("div", {
|
|
2717
2766
|
className: "flex-1 overflow-x-hidden overflow-y-auto",
|
|
2718
2767
|
style: {
|
|
2719
|
-
background:
|
|
2768
|
+
background: i.colorBgContainer
|
|
2720
2769
|
},
|
|
2721
|
-
children: (0, l.jsx)(
|
|
2722
|
-
testFiles:
|
|
2723
|
-
statusMap:
|
|
2724
|
-
caseMap:
|
|
2725
|
-
rootPath:
|
|
2726
|
-
projects:
|
|
2727
|
-
loading:
|
|
2728
|
-
connected:
|
|
2729
|
-
openFiles:
|
|
2730
|
-
activeFile:
|
|
2731
|
-
token:
|
|
2732
|
-
filterText:
|
|
2733
|
-
onExpandChange:
|
|
2734
|
-
onSelect:
|
|
2735
|
-
onRerunFile:
|
|
2736
|
-
onRerunTestCase:
|
|
2770
|
+
children: (0, l.jsx)(ex, {
|
|
2771
|
+
testFiles: c,
|
|
2772
|
+
statusMap: f,
|
|
2773
|
+
caseMap: m,
|
|
2774
|
+
rootPath: t.rootPath,
|
|
2775
|
+
projects: t.projects,
|
|
2776
|
+
loading: z,
|
|
2777
|
+
connected: O,
|
|
2778
|
+
openFiles: j,
|
|
2779
|
+
activeFile: p,
|
|
2780
|
+
token: i,
|
|
2781
|
+
filterText: y,
|
|
2782
|
+
onExpandChange: v,
|
|
2783
|
+
onSelect: U,
|
|
2784
|
+
onRerunFile: T,
|
|
2785
|
+
onRerunTestCase: B
|
|
2737
2786
|
})
|
|
2738
2787
|
})
|
|
2739
2788
|
]
|
|
2740
2789
|
})
|
|
2741
2790
|
}),
|
|
2742
|
-
(0, l.jsx)(
|
|
2791
|
+
(0, l.jsx)(Z, {
|
|
2743
2792
|
defaultSize: 68,
|
|
2744
2793
|
minSize: 40,
|
|
2745
2794
|
children: (0, l.jsxs)("div", {
|
|
2746
2795
|
className: "flex h-full flex-col overflow-hidden",
|
|
2747
2796
|
style: {
|
|
2748
|
-
background:
|
|
2797
|
+
background: i.colorBgLayout
|
|
2749
2798
|
},
|
|
2750
2799
|
children: [
|
|
2751
|
-
(0, l.jsx)(
|
|
2752
|
-
token:
|
|
2753
|
-
activeFile:
|
|
2754
|
-
rootPath:
|
|
2755
|
-
status:
|
|
2756
|
-
viewport:
|
|
2757
|
-
onViewportChange:
|
|
2800
|
+
(0, l.jsx)(D, {
|
|
2801
|
+
token: i,
|
|
2802
|
+
activeFile: p ?? void 0,
|
|
2803
|
+
rootPath: t.rootPath,
|
|
2804
|
+
status: p ? f[p] ?? "idle" : void 0,
|
|
2805
|
+
viewport: K ? Y : void 0,
|
|
2806
|
+
onViewportChange: K ? Q : void 0
|
|
2758
2807
|
}),
|
|
2759
2808
|
(0, l.jsxs)("div", {
|
|
2760
2809
|
className: "relative min-h-0 flex-1 overflow-auto",
|
|
2761
2810
|
style: {
|
|
2762
|
-
background:
|
|
2811
|
+
background: i.colorBgLayout
|
|
2763
2812
|
},
|
|
2764
2813
|
children: [
|
|
2765
|
-
!
|
|
2814
|
+
!p && (0, l.jsx)(d, {
|
|
2766
2815
|
message: "Select a test file on the left to view its run output"
|
|
2767
2816
|
}),
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2817
|
+
c.map((e)=>(()=>{
|
|
2818
|
+
var s;
|
|
2819
|
+
let r, o = e.testPath === p, a = C[e.testPath];
|
|
2820
|
+
if (!a) return null;
|
|
2821
|
+
let n = N[e.projectName] ?? em(X.get(e.projectName));
|
|
2822
|
+
return (0, l.jsx)("div", {
|
|
2823
|
+
className: "h-full w-full",
|
|
2824
|
+
style: {
|
|
2825
|
+
display: o ? "block" : "none"
|
|
2826
|
+
},
|
|
2827
|
+
children: (0, l.jsx)(ej, {
|
|
2828
|
+
token: i,
|
|
2829
|
+
selection: n,
|
|
2830
|
+
active: o,
|
|
2831
|
+
onResponsiveResize: "responsive" === n.mode ? (t)=>ee(e.projectName, t) : void 0,
|
|
2832
|
+
"data-testid": "responsive" === n.mode ? "viewport-resizer" : void 0,
|
|
2833
|
+
"data-test-project": e.projectName,
|
|
2785
2834
|
"data-test-file": e.testPath,
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2835
|
+
children: (0, l.jsx)("iframe", {
|
|
2836
|
+
"data-test-file": e.testPath,
|
|
2837
|
+
title: `Test runner for ${(r = (s = e.testPath).split("/"))[r.length - 1] || s}`,
|
|
2838
|
+
src: ek(e.testPath, t.runnerUrl, void 0, !1, a),
|
|
2839
|
+
className: "block h-full w-full border-0",
|
|
2840
|
+
style: {
|
|
2841
|
+
background: i.colorBgContainer
|
|
2842
|
+
},
|
|
2843
|
+
onLoad: (s)=>{
|
|
2844
|
+
let l = s.currentTarget, r = eN(l) ?? a;
|
|
2845
|
+
l.contentWindow && l.contentWindow.postMessage({
|
|
2846
|
+
type: "RSTEST_CONFIG",
|
|
2847
|
+
payload: {
|
|
2848
|
+
...t,
|
|
2849
|
+
testFile: e.testPath,
|
|
2850
|
+
runId: r
|
|
2851
|
+
}
|
|
2852
|
+
}, "*");
|
|
2853
|
+
}
|
|
2854
|
+
})
|
|
2802
2855
|
})
|
|
2803
|
-
})
|
|
2804
|
-
}
|
|
2805
|
-
})
|
|
2856
|
+
}, e.testPath);
|
|
2857
|
+
})())
|
|
2806
2858
|
]
|
|
2807
2859
|
})
|
|
2808
2860
|
]
|
|
@@ -2811,19 +2863,19 @@
|
|
|
2811
2863
|
]
|
|
2812
2864
|
})
|
|
2813
2865
|
});
|
|
2814
|
-
},
|
|
2815
|
-
let e = window.__RSTEST_BROWSER_OPTIONS__, [t, s] = (0,
|
|
2816
|
-
(0,
|
|
2866
|
+
}, eP = ()=>{
|
|
2867
|
+
let e = window.__RSTEST_BROWSER_OPTIONS__, [t, s] = (0, n.useState)("dark"), [r, c] = (0, n.useState)("dark");
|
|
2868
|
+
(0, n.useEffect)(()=>{
|
|
2817
2869
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e)=>c(e.matches ? "dark" : "light");
|
|
2818
2870
|
return c(e.matches ? "dark" : "light"), e.addEventListener("change", t), ()=>e.removeEventListener("change", t);
|
|
2819
|
-
}, []), (0,
|
|
2871
|
+
}, []), (0, n.useEffect)(()=>{
|
|
2820
2872
|
try {
|
|
2821
2873
|
let e = window.localStorage.getItem("rstest-theme");
|
|
2822
2874
|
("light" === e || "dark" === e || "system" === e) && s(e);
|
|
2823
2875
|
} catch {}
|
|
2824
2876
|
}, []);
|
|
2825
|
-
let d = "system" === t ?
|
|
2826
|
-
if ((0,
|
|
2877
|
+
let d = "system" === t ? r : t;
|
|
2878
|
+
if ((0, n.useEffect)(()=>{
|
|
2827
2879
|
document.body.dataset.theme = d;
|
|
2828
2880
|
try {
|
|
2829
2881
|
window.localStorage.setItem("rstest-theme", t);
|
|
@@ -2835,43 +2887,41 @@
|
|
|
2835
2887
|
className: "flex h-screen w-full items-center justify-center bg-zinc-950 text-white",
|
|
2836
2888
|
children: "Missing browser options"
|
|
2837
2889
|
});
|
|
2838
|
-
let
|
|
2839
|
-
return (0,
|
|
2840
|
-
|
|
2841
|
-
let l = (null == (s = e.projects) || null == (t = s[0]) ? void 0 : t.name) || e.rootPath.split("/").filter(Boolean).pop() || "rstest";
|
|
2842
|
-
document.title = `${l} [RSTEST BROWSER]`;
|
|
2890
|
+
let u = "dark" === d, p = e.projects?.[0]?.name || e.rootPath.split("/").filter(Boolean).pop() || "rstest";
|
|
2891
|
+
return (0, n.useEffect)(()=>{
|
|
2892
|
+
document.title = `${p} [RSTEST BROWSER]`;
|
|
2843
2893
|
}, [
|
|
2844
|
-
|
|
2894
|
+
p
|
|
2845
2895
|
]), (0, l.jsx)(a.Ay, {
|
|
2846
2896
|
componentSize: "small",
|
|
2847
2897
|
theme: {
|
|
2848
|
-
algorithm:
|
|
2898
|
+
algorithm: u ? o.A.darkAlgorithm : o.A.defaultAlgorithm,
|
|
2849
2899
|
token: {
|
|
2850
2900
|
fontFamily: '"Inter",system-ui,-apple-system,"Segoe UI",sans-serif',
|
|
2851
2901
|
fontFamilyCode: '"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
2852
2902
|
colorInfo: "#0070f3",
|
|
2853
2903
|
colorPrimary: "#0070f3",
|
|
2854
2904
|
colorSuccess: "#45a557",
|
|
2855
|
-
colorError:
|
|
2905
|
+
colorError: u ? "#d93036" : "#da2f35",
|
|
2856
2906
|
colorWarning: "#ffb224",
|
|
2857
2907
|
borderRadius: 6
|
|
2858
2908
|
}
|
|
2859
2909
|
},
|
|
2860
|
-
children: (0, l.jsx)(
|
|
2861
|
-
children: (0, l.jsx)(
|
|
2910
|
+
children: (0, l.jsx)(i.A, {
|
|
2911
|
+
children: (0, l.jsx)(eA, {
|
|
2862
2912
|
options: e,
|
|
2863
2913
|
theme: t,
|
|
2864
2914
|
setTheme: s
|
|
2865
2915
|
})
|
|
2866
2916
|
})
|
|
2867
2917
|
});
|
|
2868
|
-
},
|
|
2918
|
+
}, eM = ()=>{
|
|
2869
2919
|
let e = document.getElementById("root");
|
|
2870
|
-
e &&
|
|
2871
|
-
children: (0, l.jsx)(
|
|
2920
|
+
e && c.createRoot(e).render((0, l.jsx)(n.StrictMode, {
|
|
2921
|
+
children: (0, l.jsx)(eP, {})
|
|
2872
2922
|
}));
|
|
2873
2923
|
};
|
|
2874
|
-
"loading" === document.readyState ? document.addEventListener("DOMContentLoaded",
|
|
2924
|
+
"loading" === document.readyState ? document.addEventListener("DOMContentLoaded", eM) : eM();
|
|
2875
2925
|
}
|
|
2876
2926
|
}, i = {};
|
|
2877
2927
|
function n(e) {
|
|
@@ -2880,23 +2930,23 @@
|
|
|
2880
2930
|
var s = i[e] = {
|
|
2881
2931
|
exports: {}
|
|
2882
2932
|
};
|
|
2883
|
-
return
|
|
2933
|
+
return a[e](s, s.exports, n), s.exports;
|
|
2884
2934
|
}
|
|
2885
|
-
n.m =
|
|
2935
|
+
n.m = a, t = Object.getPrototypeOf ? (e)=>Object.getPrototypeOf(e) : (e)=>e.__proto__, n.t = function(s, l) {
|
|
2886
2936
|
if (1 & l && (s = this(s)), 8 & l || "object" == typeof s && s && (4 & l && s.__esModule || 16 & l && "function" == typeof s.then)) return s;
|
|
2887
|
-
var
|
|
2888
|
-
n.r(
|
|
2889
|
-
var
|
|
2937
|
+
var r = Object.create(null);
|
|
2938
|
+
n.r(r);
|
|
2939
|
+
var o = {};
|
|
2890
2940
|
e = e || [
|
|
2891
2941
|
null,
|
|
2892
2942
|
t({}),
|
|
2893
2943
|
t([]),
|
|
2894
2944
|
t(t)
|
|
2895
2945
|
];
|
|
2896
|
-
for(var
|
|
2897
|
-
|
|
2946
|
+
for(var a = 2 & l && s; ("object" == typeof a || "function" == typeof a) && !~e.indexOf(a); a = t(a))Object.getOwnPropertyNames(a).forEach((e)=>{
|
|
2947
|
+
o[e] = ()=>s[e];
|
|
2898
2948
|
});
|
|
2899
|
-
return
|
|
2949
|
+
return o.default = ()=>s, n.d(r, o), r;
|
|
2900
2950
|
}, n.d = (e, t)=>{
|
|
2901
2951
|
for(var s in t)n.o(t, s) && !n.o(e, s) && Object.defineProperty(e, s, {
|
|
2902
2952
|
enumerable: !0,
|
|
@@ -2908,21 +2958,21 @@
|
|
|
2908
2958
|
}), Object.defineProperty(e, "__esModule", {
|
|
2909
2959
|
value: !0
|
|
2910
2960
|
});
|
|
2911
|
-
}, s = [], n.O = (e, t, l,
|
|
2961
|
+
}, s = [], n.O = (e, t, l, r)=>{
|
|
2912
2962
|
if (t) {
|
|
2913
|
-
|
|
2914
|
-
for(var
|
|
2915
|
-
s[
|
|
2963
|
+
r = r || 0;
|
|
2964
|
+
for(var o = s.length; o > 0 && s[o - 1][2] > r; o--)s[o] = s[o - 1];
|
|
2965
|
+
s[o] = [
|
|
2916
2966
|
t,
|
|
2917
2967
|
l,
|
|
2918
|
-
|
|
2968
|
+
r
|
|
2919
2969
|
];
|
|
2920
2970
|
return;
|
|
2921
2971
|
}
|
|
2922
|
-
for(var
|
|
2923
|
-
for(var [t, l,
|
|
2972
|
+
for(var a = 1 / 0, o = 0; o < s.length; o++){
|
|
2973
|
+
for(var [t, l, r] = s[o], i = !0, c = 0; c < t.length; c++)(!1 & r || a >= r) && Object.keys(n.O).every((e)=>n.O[e](t[c])) ? t.splice(c--, 1) : (i = !1, r < a && (a = r));
|
|
2924
2974
|
if (i) {
|
|
2925
|
-
s.splice(
|
|
2975
|
+
s.splice(o--, 1);
|
|
2926
2976
|
var d = l();
|
|
2927
2977
|
void 0 !== d && (e = d);
|
|
2928
2978
|
}
|
|
@@ -2930,18 +2980,18 @@
|
|
|
2930
2980
|
return e;
|
|
2931
2981
|
}, l = {
|
|
2932
2982
|
410: 0
|
|
2933
|
-
}, n.O.j = (e)=>0 === l[e],
|
|
2934
|
-
var s,
|
|
2935
|
-
if (
|
|
2936
|
-
for(s in
|
|
2983
|
+
}, n.O.j = (e)=>0 === l[e], r = (e, t)=>{
|
|
2984
|
+
var s, r, [o, a, i] = t, c = 0;
|
|
2985
|
+
if (o.some((e)=>0 !== l[e])) {
|
|
2986
|
+
for(s in a)n.o(a, s) && (n.m[s] = a[s]);
|
|
2937
2987
|
if (i) var d = i(n);
|
|
2938
2988
|
}
|
|
2939
|
-
for(e && e(t); c <
|
|
2989
|
+
for(e && e(t); c < o.length; c++)r = o[c], n.o(l, r) && l[r] && l[r][0](), l[r] = 0;
|
|
2940
2990
|
return n.O(d);
|
|
2941
|
-
}, (
|
|
2991
|
+
}, (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));
|
|
2942
2992
|
var c = n.O(void 0, [
|
|
2943
2993
|
"783",
|
|
2944
|
-
"
|
|
2945
|
-
], ()=>n(
|
|
2994
|
+
"101"
|
|
2995
|
+
], ()=>n(7723));
|
|
2946
2996
|
c = n.O(c);
|
|
2947
2997
|
})();
|