twd-js 0.1.1 → 0.2.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/README.md +125 -53
- package/dist/asserts/index.d.ts +1 -1
- package/dist/cli.js +35 -0
- package/dist/commands/{mockResponses.d.ts → mockBridge.d.ts} +17 -3
- package/dist/commands/url.d.ts +33 -0
- package/dist/mock-sw.js +1 -0
- package/dist/twd-types.d.ts +10 -1
- package/dist/twd.d.ts +45 -2
- package/dist/twd.es.js +665 -425
- package/dist/twd.umd.js +9 -4
- package/dist/ui/Icons/ChevronDown.d.ts +2 -0
- package/dist/ui/Icons/ChevronRight.d.ts +2 -0
- package/dist/ui/Icons/Loader.d.ts +2 -0
- package/dist/ui/Icons/Play.d.ts +2 -0
- package/dist/ui/TestListItem.d.ts +20 -0
- package/dist/utils/assertionMessage.d.ts +1 -0
- package/package.json +31 -5
package/dist/twd.es.js
CHANGED
|
@@ -1,189 +1,284 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
6
|
-
if (Date.now() -
|
|
7
|
-
setTimeout(
|
|
1
|
+
import pe, { useState as D } from "react";
|
|
2
|
+
const be = (e, n = 2e3, r = 50) => new Promise((s, i) => {
|
|
3
|
+
const a = Date.now(), c = () => {
|
|
4
|
+
const u = e();
|
|
5
|
+
if (u) return s(u);
|
|
6
|
+
if (Date.now() - a > n) return i(new Error("Timeout waiting for element"));
|
|
7
|
+
setTimeout(c, r);
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
}),
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
name:
|
|
15
|
-
fn:
|
|
9
|
+
c();
|
|
10
|
+
}), v = [];
|
|
11
|
+
let Y = [];
|
|
12
|
+
const U = (e, n, r = {}) => {
|
|
13
|
+
v.push({
|
|
14
|
+
name: e,
|
|
15
|
+
fn: n,
|
|
16
16
|
status: "idle",
|
|
17
17
|
logs: [],
|
|
18
|
-
suite: [...
|
|
19
|
-
...
|
|
18
|
+
suite: [...Y],
|
|
19
|
+
...r
|
|
20
20
|
});
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
21
|
+
}, me = (e) => {
|
|
22
|
+
Y.push(e);
|
|
23
|
+
}, he = () => {
|
|
24
|
+
Y.pop();
|
|
25
|
+
}, m = (e, n, r, s) => {
|
|
26
|
+
if (!e && !n)
|
|
27
|
+
throw new Error(s);
|
|
28
|
+
if (e && n)
|
|
29
|
+
throw new Error(
|
|
30
|
+
s.replace("to be", "to not be").replace("to have", "to not have").replace("to contain", "to not contain")
|
|
31
|
+
);
|
|
32
|
+
return r;
|
|
25
33
|
};
|
|
26
|
-
function
|
|
27
|
-
if (!
|
|
28
|
-
let
|
|
29
|
-
for (;
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
34
|
+
function xe(e) {
|
|
35
|
+
if (!e.isConnected) return !1;
|
|
36
|
+
let n = e;
|
|
37
|
+
for (; n; ) {
|
|
38
|
+
const r = getComputedStyle(n);
|
|
39
|
+
if (r.display === "none" || r.visibility === "hidden" || r.visibility === "collapse")
|
|
32
40
|
return !1;
|
|
33
|
-
|
|
41
|
+
n = n.parentElement;
|
|
34
42
|
}
|
|
35
43
|
return !0;
|
|
36
44
|
}
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
45
|
+
const ge = (e, n, ...r) => {
|
|
46
|
+
const s = n.startsWith("not."), i = s ? n.slice(4) : n, a = (e.textContent || "").trim();
|
|
47
|
+
switch (i) {
|
|
48
|
+
// Content
|
|
49
|
+
case "have.text":
|
|
50
|
+
return m(
|
|
51
|
+
a === r[0],
|
|
52
|
+
s,
|
|
53
|
+
`Assertion passed: Text is exactly "${r[0]}"`,
|
|
54
|
+
`Assertion failed: Expected text to be "${r[0]}", but got "${a}"`
|
|
55
|
+
);
|
|
56
|
+
case "contain.text":
|
|
57
|
+
return m(
|
|
58
|
+
a.includes(r[0]),
|
|
59
|
+
s,
|
|
60
|
+
`Assertion passed: Text contains "${r[0]}"`,
|
|
61
|
+
`Assertion failed: Expected text to contain "${r[0]}", but got "${a}"`
|
|
62
|
+
);
|
|
63
|
+
case "be.empty":
|
|
64
|
+
return m(
|
|
65
|
+
a.length === 0,
|
|
66
|
+
s,
|
|
67
|
+
"Assertion passed: Text is empty",
|
|
68
|
+
`Assertion failed: Expected text to be empty, but got "${a}"`
|
|
69
|
+
);
|
|
70
|
+
// Attributes
|
|
71
|
+
case "have.attr":
|
|
72
|
+
return m(
|
|
73
|
+
e.getAttribute(r[0]) === r[1],
|
|
74
|
+
s,
|
|
75
|
+
`Assertion passed: Attribute "${r[0]}" is "${r[1]}"`,
|
|
76
|
+
`Assertion failed: Expected attribute "${r[0]}" to be "${r[1]}", but got "${e.getAttribute(r[0])}"`
|
|
77
|
+
);
|
|
78
|
+
case "have.value":
|
|
79
|
+
return m(
|
|
80
|
+
e.value === r[0],
|
|
81
|
+
s,
|
|
82
|
+
`Assertion passed: Value is "${r[0]}"`,
|
|
83
|
+
`Assertion failed: Expected value to be "${r[0]}", but got "${e.value}"`
|
|
84
|
+
);
|
|
85
|
+
// State
|
|
86
|
+
case "be.disabled":
|
|
87
|
+
return m(
|
|
88
|
+
e.disabled === !0,
|
|
89
|
+
s,
|
|
90
|
+
"Assertion passed: Element is disabled",
|
|
91
|
+
"Assertion failed: Expected element to be disabled"
|
|
92
|
+
);
|
|
93
|
+
case "be.enabled":
|
|
94
|
+
return m(
|
|
95
|
+
e.disabled === !1,
|
|
96
|
+
s,
|
|
97
|
+
"Assertion passed: Element is enabled",
|
|
98
|
+
"Assertion failed: Expected element to be enabled"
|
|
99
|
+
);
|
|
100
|
+
case "be.checked":
|
|
101
|
+
return m(
|
|
102
|
+
e.checked === !0,
|
|
103
|
+
s,
|
|
104
|
+
"Assertion passed: Element is checked",
|
|
105
|
+
"Assertion failed: Expected element to be checked"
|
|
106
|
+
);
|
|
107
|
+
case "be.selected":
|
|
108
|
+
return m(
|
|
109
|
+
e.selected === !0,
|
|
110
|
+
s,
|
|
111
|
+
"Assertion passed: Element is selected",
|
|
112
|
+
"Assertion failed: Expected element to be selected"
|
|
113
|
+
);
|
|
114
|
+
case "be.focused":
|
|
115
|
+
return m(
|
|
116
|
+
document.activeElement === e,
|
|
117
|
+
s,
|
|
118
|
+
"Assertion passed: Element is focused",
|
|
119
|
+
"Assertion failed: Expected element to be focused"
|
|
120
|
+
);
|
|
121
|
+
// Visibility
|
|
122
|
+
case "be.visible":
|
|
123
|
+
return m(
|
|
124
|
+
xe(e),
|
|
125
|
+
s,
|
|
126
|
+
"Assertion passed: Element is visible",
|
|
127
|
+
"Assertion failed: Expected element to be visible"
|
|
128
|
+
);
|
|
129
|
+
// Classes
|
|
130
|
+
case "have.class":
|
|
131
|
+
return m(
|
|
132
|
+
e.classList.contains(r[0]),
|
|
133
|
+
s,
|
|
134
|
+
`Assertion passed: Element has class "${r[0]}"`,
|
|
135
|
+
`Assertion failed: Expected element to have class "${r[0]}"`
|
|
136
|
+
);
|
|
137
|
+
default:
|
|
138
|
+
throw new Error(`Unknown assertion: ${i}`);
|
|
139
|
+
}
|
|
140
|
+
}, R = (e) => {
|
|
141
|
+
const n = v.find((r) => r.status === "running");
|
|
142
|
+
n && n.logs?.push(e);
|
|
143
|
+
}, E = [], C = {}, Z = 100, we = async () => {
|
|
144
|
+
"serviceWorker" in navigator && (await navigator.serviceWorker.register("/mock-sw.js?v=1"), navigator.serviceWorker.addEventListener("message", (e) => {
|
|
145
|
+
if (e.data?.type === "EXECUTED") {
|
|
146
|
+
const { alias: n, request: r } = e.data, s = E.find((i) => i.alias === n);
|
|
147
|
+
s && (s.executed = !0, s.request = r, C[n] && (C[n](s), delete C[n]));
|
|
72
148
|
}
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const n =
|
|
83
|
-
n
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
(l) => l.method === n && (typeof l.url == "string" ? l.url === o : l.url.test(o))
|
|
93
|
-
);
|
|
94
|
-
return s ? (w(`🛡️ ${s.alias} → ${n} ${o}`), s.executed = !0, s.request = r?.body, new Response(JSON.stringify(s.response), {
|
|
95
|
-
status: s.status || 200,
|
|
96
|
-
headers: s.headers || { "Content-Type": "application/json" }
|
|
97
|
-
})) : he(t, r);
|
|
98
|
-
};
|
|
99
|
-
const xe = (t, r) => {
|
|
100
|
-
for (const n of r) {
|
|
101
|
-
const o = n.charCodeAt(0);
|
|
102
|
-
t.dispatchEvent(
|
|
149
|
+
}));
|
|
150
|
+
}, Q = (e) => new Promise((n) => setTimeout(n, e)), ve = async (e, n) => {
|
|
151
|
+
const r = { alias: e, ...n, executed: !1 }, s = E.findIndex((i) => i.alias === e);
|
|
152
|
+
s !== -1 ? E[s] = r : E.push(r), navigator.serviceWorker.controller?.postMessage({
|
|
153
|
+
type: "ADD_RULE",
|
|
154
|
+
rule: r
|
|
155
|
+
}), await Q(Z), await Promise.resolve();
|
|
156
|
+
}, Ee = async (e) => {
|
|
157
|
+
await Q(Z);
|
|
158
|
+
const n = E.find((r) => r.alias === e && r.executed);
|
|
159
|
+
return n ? Promise.resolve(n) : new Promise((r) => {
|
|
160
|
+
C[e] = r;
|
|
161
|
+
});
|
|
162
|
+
}, ye = () => E, ke = () => {
|
|
163
|
+
E.length = 0;
|
|
164
|
+
}, Re = (e, n) => {
|
|
165
|
+
for (const r of n) {
|
|
166
|
+
const s = r.charCodeAt(0);
|
|
167
|
+
e.dispatchEvent(
|
|
103
168
|
new KeyboardEvent("keydown", {
|
|
104
|
-
key:
|
|
105
|
-
code: `Key${
|
|
106
|
-
keyCode:
|
|
107
|
-
which:
|
|
169
|
+
key: r,
|
|
170
|
+
code: `Key${r.toUpperCase()}`,
|
|
171
|
+
keyCode: s,
|
|
172
|
+
which: s,
|
|
108
173
|
bubbles: !0,
|
|
109
174
|
cancelable: !0
|
|
110
175
|
})
|
|
111
|
-
),
|
|
176
|
+
), e.dispatchEvent(
|
|
112
177
|
new KeyboardEvent("keypress", {
|
|
113
|
-
key:
|
|
114
|
-
code: `Key${
|
|
115
|
-
keyCode:
|
|
116
|
-
which:
|
|
178
|
+
key: r,
|
|
179
|
+
code: `Key${r.toUpperCase()}`,
|
|
180
|
+
keyCode: s,
|
|
181
|
+
which: s,
|
|
117
182
|
bubbles: !0,
|
|
118
183
|
cancelable: !0
|
|
119
184
|
})
|
|
120
|
-
),
|
|
185
|
+
), e.dispatchEvent(
|
|
121
186
|
new InputEvent("beforeinput", {
|
|
122
187
|
bubbles: !0,
|
|
123
188
|
cancelable: !0,
|
|
124
189
|
inputType: "insertText",
|
|
125
|
-
data:
|
|
190
|
+
data: r
|
|
126
191
|
})
|
|
127
192
|
), Object.getOwnPropertyDescriptor(
|
|
128
|
-
Object.getPrototypeOf(
|
|
193
|
+
Object.getPrototypeOf(e),
|
|
129
194
|
"value"
|
|
130
|
-
)?.set?.call(
|
|
195
|
+
)?.set?.call(e, e.value + r), e.dispatchEvent(
|
|
131
196
|
new Event("input", {
|
|
132
197
|
bubbles: !0
|
|
133
198
|
})
|
|
134
|
-
),
|
|
199
|
+
), e.dispatchEvent(
|
|
135
200
|
new KeyboardEvent("keyup", {
|
|
136
|
-
key:
|
|
137
|
-
code: `Key${
|
|
138
|
-
keyCode:
|
|
139
|
-
which:
|
|
201
|
+
key: r,
|
|
202
|
+
code: `Key${r.toUpperCase()}`,
|
|
203
|
+
keyCode: s,
|
|
204
|
+
which: s,
|
|
140
205
|
bubbles: !0,
|
|
141
206
|
cancelable: !0
|
|
142
207
|
})
|
|
143
208
|
);
|
|
144
209
|
}
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
210
|
+
return e;
|
|
211
|
+
}, Ae = (e, n) => {
|
|
212
|
+
const r = e.startsWith("not.");
|
|
213
|
+
switch (r ? e.slice(4) : e) {
|
|
214
|
+
case "eq":
|
|
215
|
+
return m(
|
|
216
|
+
window.location.href === n,
|
|
217
|
+
r,
|
|
218
|
+
`Assertion passed: URL is ${n}`,
|
|
219
|
+
`Assertion failed: Expected URL to be ${n}, but got ${window.location.href}`
|
|
220
|
+
);
|
|
221
|
+
case "contain.url":
|
|
222
|
+
return m(
|
|
223
|
+
window.location.href.includes(n),
|
|
224
|
+
r,
|
|
225
|
+
`Assertion passed: URL contains ${n}`,
|
|
226
|
+
`Assertion failed: Expected URL to contain ${n}, but got ${window.location.href}`
|
|
227
|
+
);
|
|
228
|
+
default:
|
|
229
|
+
throw new Error(`Unknown assertion: ${e}`);
|
|
230
|
+
}
|
|
231
|
+
}, Te = () => ({
|
|
232
|
+
location: window.location,
|
|
233
|
+
should: Ae
|
|
234
|
+
});
|
|
235
|
+
let j = null;
|
|
236
|
+
const qe = (e) => {
|
|
237
|
+
j = e;
|
|
238
|
+
}, Fe = (e, n) => {
|
|
239
|
+
me(e), n(), he();
|
|
240
|
+
}, ze = (e, n) => {
|
|
241
|
+
U(e, async () => {
|
|
242
|
+
j && await j(), await n();
|
|
155
243
|
});
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
|
|
244
|
+
}, Be = (e, n) => {
|
|
245
|
+
U(e, async () => {
|
|
246
|
+
j && await j(), await n();
|
|
159
247
|
}, { only: !0 });
|
|
160
|
-
},
|
|
161
|
-
|
|
248
|
+
}, Ve = (e, n) => {
|
|
249
|
+
U(e, async () => {
|
|
162
250
|
}, { skip: !0 });
|
|
163
|
-
},
|
|
164
|
-
get: async (
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
el:
|
|
251
|
+
}, Je = {
|
|
252
|
+
get: async (e) => {
|
|
253
|
+
R(`Searching get("${e}")`);
|
|
254
|
+
const n = await be(() => document.querySelector(e)), r = {
|
|
255
|
+
el: n,
|
|
168
256
|
click: () => {
|
|
169
|
-
|
|
257
|
+
R(`click(${e})`), n.click();
|
|
258
|
+
},
|
|
259
|
+
type: (s) => (R(`type("${s}") into ${e}`), Re(n, s)),
|
|
260
|
+
should: (s, ...i) => {
|
|
261
|
+
const a = ge(n, s, ...i);
|
|
262
|
+
return R(a), r;
|
|
170
263
|
},
|
|
171
|
-
type: (o) => (w(`⌨️ type("${o}") into ${t}`), xe(r, o)),
|
|
172
|
-
should: (o, ...s) => (pe(r, o, ...s), n),
|
|
173
264
|
text: () => {
|
|
174
|
-
const
|
|
175
|
-
return
|
|
265
|
+
const s = n.textContent || "";
|
|
266
|
+
return R(`text(${e}) → "${s}"`), s;
|
|
176
267
|
}
|
|
177
268
|
};
|
|
178
|
-
return
|
|
269
|
+
return r;
|
|
179
270
|
},
|
|
180
|
-
visit: (
|
|
181
|
-
|
|
271
|
+
visit: (e) => {
|
|
272
|
+
R(`visit("${e}")`), window.history.pushState({}, "", e), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
182
273
|
},
|
|
183
|
-
|
|
184
|
-
|
|
274
|
+
url: Te,
|
|
275
|
+
mockRequest: ve,
|
|
276
|
+
waitForRequest: Ee,
|
|
277
|
+
initRequestMocking: we,
|
|
278
|
+
clearRequestMockRules: ke,
|
|
279
|
+
getRequestMockRules: ye
|
|
185
280
|
};
|
|
186
|
-
var
|
|
281
|
+
var S = { exports: {} }, A = {};
|
|
187
282
|
/**
|
|
188
283
|
* @license React
|
|
189
284
|
* react-jsx-runtime.production.js
|
|
@@ -193,29 +288,29 @@ var j = { exports: {} }, k = {};
|
|
|
193
288
|
* This source code is licensed under the MIT license found in the
|
|
194
289
|
* LICENSE file in the root directory of this source tree.
|
|
195
290
|
*/
|
|
196
|
-
var
|
|
197
|
-
function
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
var
|
|
201
|
-
function
|
|
202
|
-
var
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
$$typeof:
|
|
210
|
-
type:
|
|
211
|
-
key:
|
|
212
|
-
ref:
|
|
213
|
-
props:
|
|
291
|
+
var X;
|
|
292
|
+
function je() {
|
|
293
|
+
if (X) return A;
|
|
294
|
+
X = 1;
|
|
295
|
+
var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
296
|
+
function r(s, i, a) {
|
|
297
|
+
var c = null;
|
|
298
|
+
if (a !== void 0 && (c = "" + a), i.key !== void 0 && (c = "" + i.key), "key" in i) {
|
|
299
|
+
a = {};
|
|
300
|
+
for (var u in i)
|
|
301
|
+
u !== "key" && (a[u] = i[u]);
|
|
302
|
+
} else a = i;
|
|
303
|
+
return i = a.ref, {
|
|
304
|
+
$$typeof: e,
|
|
305
|
+
type: s,
|
|
306
|
+
key: c,
|
|
307
|
+
ref: i !== void 0 ? i : null,
|
|
308
|
+
props: a
|
|
214
309
|
};
|
|
215
310
|
}
|
|
216
|
-
return
|
|
311
|
+
return A.Fragment = n, A.jsx = r, A.jsxs = r, A;
|
|
217
312
|
}
|
|
218
|
-
var
|
|
313
|
+
var T = {};
|
|
219
314
|
/**
|
|
220
315
|
* @license React
|
|
221
316
|
* react-jsx-runtime.development.js
|
|
@@ -225,166 +320,166 @@ var R = {};
|
|
|
225
320
|
* This source code is licensed under the MIT license found in the
|
|
226
321
|
* LICENSE file in the root directory of this source tree.
|
|
227
322
|
*/
|
|
228
|
-
var
|
|
229
|
-
function
|
|
230
|
-
return
|
|
231
|
-
function t
|
|
232
|
-
if (
|
|
233
|
-
if (typeof
|
|
234
|
-
return
|
|
235
|
-
if (typeof
|
|
236
|
-
switch (
|
|
323
|
+
var H;
|
|
324
|
+
function _e() {
|
|
325
|
+
return H || (H = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
326
|
+
function e(t) {
|
|
327
|
+
if (t == null) return null;
|
|
328
|
+
if (typeof t == "function")
|
|
329
|
+
return t.$$typeof === ue ? null : t.displayName || t.name || null;
|
|
330
|
+
if (typeof t == "string") return t;
|
|
331
|
+
switch (t) {
|
|
237
332
|
case O:
|
|
238
333
|
return "Fragment";
|
|
239
|
-
case
|
|
334
|
+
case re:
|
|
240
335
|
return "Profiler";
|
|
241
|
-
case K:
|
|
242
|
-
return "StrictMode";
|
|
243
336
|
case te:
|
|
337
|
+
return "StrictMode";
|
|
338
|
+
case ie:
|
|
244
339
|
return "Suspense";
|
|
245
|
-
case
|
|
340
|
+
case ae:
|
|
246
341
|
return "SuspenseList";
|
|
247
|
-
case
|
|
342
|
+
case le:
|
|
248
343
|
return "Activity";
|
|
249
344
|
}
|
|
250
|
-
if (typeof
|
|
251
|
-
switch (typeof
|
|
345
|
+
if (typeof t == "object")
|
|
346
|
+
switch (typeof t.tag == "number" && console.error(
|
|
252
347
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
253
|
-
),
|
|
254
|
-
case X:
|
|
255
|
-
return "Portal";
|
|
256
|
-
case Q:
|
|
257
|
-
return (e.displayName || "Context") + ".Provider";
|
|
258
|
-
case Z:
|
|
259
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
348
|
+
), t.$$typeof) {
|
|
260
349
|
case ee:
|
|
261
|
-
|
|
262
|
-
|
|
350
|
+
return "Portal";
|
|
351
|
+
case se:
|
|
352
|
+
return (t.displayName || "Context") + ".Provider";
|
|
263
353
|
case ne:
|
|
264
|
-
return
|
|
265
|
-
case
|
|
266
|
-
|
|
354
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
355
|
+
case oe:
|
|
356
|
+
var o = t.render;
|
|
357
|
+
return t = t.displayName, t || (t = o.displayName || o.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
358
|
+
case ce:
|
|
359
|
+
return o = t.displayName || null, o !== null ? o : e(t.type) || "Memo";
|
|
360
|
+
case q:
|
|
361
|
+
o = t._payload, t = t._init;
|
|
267
362
|
try {
|
|
268
|
-
return t(
|
|
363
|
+
return e(t(o));
|
|
269
364
|
} catch {
|
|
270
365
|
}
|
|
271
366
|
}
|
|
272
367
|
return null;
|
|
273
368
|
}
|
|
274
|
-
function
|
|
275
|
-
return "" +
|
|
369
|
+
function n(t) {
|
|
370
|
+
return "" + t;
|
|
276
371
|
}
|
|
277
|
-
function
|
|
372
|
+
function r(t) {
|
|
278
373
|
try {
|
|
279
|
-
|
|
280
|
-
var
|
|
374
|
+
n(t);
|
|
375
|
+
var o = !1;
|
|
281
376
|
} catch {
|
|
282
|
-
|
|
377
|
+
o = !0;
|
|
283
378
|
}
|
|
284
|
-
if (
|
|
285
|
-
|
|
286
|
-
var
|
|
287
|
-
return
|
|
288
|
-
|
|
379
|
+
if (o) {
|
|
380
|
+
o = console;
|
|
381
|
+
var d = o.error, f = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
382
|
+
return d.call(
|
|
383
|
+
o,
|
|
289
384
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
290
385
|
f
|
|
291
|
-
),
|
|
386
|
+
), n(t);
|
|
292
387
|
}
|
|
293
388
|
}
|
|
294
|
-
function
|
|
295
|
-
if (
|
|
296
|
-
if (typeof
|
|
389
|
+
function s(t) {
|
|
390
|
+
if (t === O) return "<>";
|
|
391
|
+
if (typeof t == "object" && t !== null && t.$$typeof === q)
|
|
297
392
|
return "<...>";
|
|
298
393
|
try {
|
|
299
|
-
var
|
|
300
|
-
return
|
|
394
|
+
var o = e(t);
|
|
395
|
+
return o ? "<" + o + ">" : "<...>";
|
|
301
396
|
} catch {
|
|
302
397
|
return "<...>";
|
|
303
398
|
}
|
|
304
399
|
}
|
|
305
|
-
function
|
|
306
|
-
var
|
|
307
|
-
return
|
|
400
|
+
function i() {
|
|
401
|
+
var t = P.A;
|
|
402
|
+
return t === null ? null : t.getOwner();
|
|
308
403
|
}
|
|
309
|
-
function
|
|
404
|
+
function a() {
|
|
310
405
|
return Error("react-stack-top-frame");
|
|
311
406
|
}
|
|
312
|
-
function
|
|
313
|
-
if (
|
|
314
|
-
var
|
|
315
|
-
if (
|
|
407
|
+
function c(t) {
|
|
408
|
+
if (F.call(t, "key")) {
|
|
409
|
+
var o = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
410
|
+
if (o && o.isReactWarning) return !1;
|
|
316
411
|
}
|
|
317
|
-
return
|
|
412
|
+
return t.key !== void 0;
|
|
318
413
|
}
|
|
319
|
-
function
|
|
320
|
-
function
|
|
321
|
-
|
|
414
|
+
function u(t, o) {
|
|
415
|
+
function d() {
|
|
416
|
+
z || (z = !0, console.error(
|
|
322
417
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
323
|
-
|
|
418
|
+
o
|
|
324
419
|
));
|
|
325
420
|
}
|
|
326
|
-
|
|
327
|
-
get:
|
|
421
|
+
d.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
422
|
+
get: d,
|
|
328
423
|
configurable: !0
|
|
329
424
|
});
|
|
330
425
|
}
|
|
331
426
|
function b() {
|
|
332
|
-
var
|
|
333
|
-
return
|
|
427
|
+
var t = e(this.type);
|
|
428
|
+
return B[t] || (B[t] = !0, console.error(
|
|
334
429
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
335
|
-
)),
|
|
430
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
336
431
|
}
|
|
337
|
-
function
|
|
338
|
-
return
|
|
339
|
-
$$typeof:
|
|
340
|
-
type:
|
|
341
|
-
key:
|
|
342
|
-
props:
|
|
343
|
-
_owner:
|
|
344
|
-
}, (
|
|
432
|
+
function x(t, o, d, f, w, g, L, W) {
|
|
433
|
+
return d = g.ref, t = {
|
|
434
|
+
$$typeof: M,
|
|
435
|
+
type: t,
|
|
436
|
+
key: o,
|
|
437
|
+
props: g,
|
|
438
|
+
_owner: w
|
|
439
|
+
}, (d !== void 0 ? d : null) !== null ? Object.defineProperty(t, "ref", {
|
|
345
440
|
enumerable: !1,
|
|
346
441
|
get: b
|
|
347
|
-
}) : Object.defineProperty(
|
|
442
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
348
443
|
configurable: !1,
|
|
349
444
|
enumerable: !1,
|
|
350
445
|
writable: !0,
|
|
351
446
|
value: 0
|
|
352
|
-
}), Object.defineProperty(
|
|
447
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
353
448
|
configurable: !1,
|
|
354
449
|
enumerable: !1,
|
|
355
450
|
writable: !0,
|
|
356
451
|
value: null
|
|
357
|
-
}), Object.defineProperty(
|
|
452
|
+
}), Object.defineProperty(t, "_debugStack", {
|
|
358
453
|
configurable: !1,
|
|
359
454
|
enumerable: !1,
|
|
360
455
|
writable: !0,
|
|
361
|
-
value:
|
|
362
|
-
}), Object.defineProperty(
|
|
456
|
+
value: L
|
|
457
|
+
}), Object.defineProperty(t, "_debugTask", {
|
|
363
458
|
configurable: !1,
|
|
364
459
|
enumerable: !1,
|
|
365
460
|
writable: !0,
|
|
366
|
-
value:
|
|
367
|
-
}), Object.freeze && (Object.freeze(
|
|
461
|
+
value: W
|
|
462
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
368
463
|
}
|
|
369
|
-
function
|
|
370
|
-
var p =
|
|
464
|
+
function h(t, o, d, f, w, g, L, W) {
|
|
465
|
+
var p = o.children;
|
|
371
466
|
if (p !== void 0)
|
|
372
467
|
if (f)
|
|
373
|
-
if (
|
|
468
|
+
if (de(p)) {
|
|
374
469
|
for (f = 0; f < p.length; f++)
|
|
375
|
-
|
|
470
|
+
y(p[f]);
|
|
376
471
|
Object.freeze && Object.freeze(p);
|
|
377
472
|
} else
|
|
378
473
|
console.error(
|
|
379
474
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
380
475
|
);
|
|
381
|
-
else
|
|
382
|
-
if (
|
|
383
|
-
p = t
|
|
384
|
-
var
|
|
385
|
-
return
|
|
476
|
+
else y(p);
|
|
477
|
+
if (F.call(o, "key")) {
|
|
478
|
+
p = e(t);
|
|
479
|
+
var k = Object.keys(o).filter(function(fe) {
|
|
480
|
+
return fe !== "key";
|
|
386
481
|
});
|
|
387
|
-
f = 0 <
|
|
482
|
+
f = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", G[p + f] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
388
483
|
`A props object containing a "key" prop is being spread into JSX:
|
|
389
484
|
let props = %s;
|
|
390
485
|
<%s {...props} />
|
|
@@ -393,179 +488,313 @@ React keys must be passed directly to JSX without using spread:
|
|
|
393
488
|
<%s key={someKey} {...props} />`,
|
|
394
489
|
f,
|
|
395
490
|
p,
|
|
396
|
-
|
|
491
|
+
k,
|
|
397
492
|
p
|
|
398
|
-
),
|
|
493
|
+
), G[p + f] = !0);
|
|
399
494
|
}
|
|
400
|
-
if (p = null,
|
|
401
|
-
|
|
402
|
-
for (var
|
|
403
|
-
|
|
404
|
-
} else
|
|
405
|
-
return p &&
|
|
406
|
-
|
|
407
|
-
typeof
|
|
408
|
-
),
|
|
409
|
-
|
|
495
|
+
if (p = null, d !== void 0 && (r(d), p = "" + d), c(o) && (r(o.key), p = "" + o.key), "key" in o) {
|
|
496
|
+
d = {};
|
|
497
|
+
for (var I in o)
|
|
498
|
+
I !== "key" && (d[I] = o[I]);
|
|
499
|
+
} else d = o;
|
|
500
|
+
return p && u(
|
|
501
|
+
d,
|
|
502
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
503
|
+
), x(
|
|
504
|
+
t,
|
|
410
505
|
p,
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
506
|
+
g,
|
|
507
|
+
w,
|
|
508
|
+
i(),
|
|
509
|
+
d,
|
|
510
|
+
L,
|
|
511
|
+
W
|
|
417
512
|
);
|
|
418
513
|
}
|
|
419
|
-
function
|
|
420
|
-
typeof
|
|
514
|
+
function y(t) {
|
|
515
|
+
typeof t == "object" && t !== null && t.$$typeof === M && t._store && (t._store.validated = 1);
|
|
421
516
|
}
|
|
422
|
-
var
|
|
517
|
+
var _ = pe, M = Symbol.for("react.transitional.element"), ee = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), te = Symbol.for("react.strict_mode"), re = Symbol.for("react.profiler"), ne = Symbol.for("react.consumer"), se = Symbol.for("react.context"), oe = Symbol.for("react.forward_ref"), ie = Symbol.for("react.suspense"), ae = Symbol.for("react.suspense_list"), ce = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ue = Symbol.for("react.client.reference"), P = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, de = Array.isArray, N = console.createTask ? console.createTask : function() {
|
|
423
518
|
return null;
|
|
424
519
|
};
|
|
425
|
-
|
|
426
|
-
react_stack_bottom_frame: function(
|
|
427
|
-
return
|
|
520
|
+
_ = {
|
|
521
|
+
react_stack_bottom_frame: function(t) {
|
|
522
|
+
return t();
|
|
428
523
|
}
|
|
429
524
|
};
|
|
430
|
-
var
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
)(),
|
|
434
|
-
|
|
435
|
-
var
|
|
436
|
-
return
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
525
|
+
var z, B = {}, V = _.react_stack_bottom_frame.bind(
|
|
526
|
+
_,
|
|
527
|
+
a
|
|
528
|
+
)(), J = N(s(a)), G = {};
|
|
529
|
+
T.Fragment = O, T.jsx = function(t, o, d, f, w) {
|
|
530
|
+
var g = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
531
|
+
return h(
|
|
532
|
+
t,
|
|
533
|
+
o,
|
|
534
|
+
d,
|
|
440
535
|
!1,
|
|
441
536
|
f,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
537
|
+
w,
|
|
538
|
+
g ? Error("react-stack-top-frame") : V,
|
|
539
|
+
g ? N(s(t)) : J
|
|
445
540
|
);
|
|
446
|
-
},
|
|
447
|
-
var
|
|
448
|
-
return
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
541
|
+
}, T.jsxs = function(t, o, d, f, w) {
|
|
542
|
+
var g = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
543
|
+
return h(
|
|
544
|
+
t,
|
|
545
|
+
o,
|
|
546
|
+
d,
|
|
452
547
|
!0,
|
|
453
548
|
f,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
549
|
+
w,
|
|
550
|
+
g ? Error("react-stack-top-frame") : V,
|
|
551
|
+
g ? N(s(t)) : J
|
|
457
552
|
);
|
|
458
553
|
};
|
|
459
|
-
})()),
|
|
554
|
+
})()), T;
|
|
460
555
|
}
|
|
461
|
-
var
|
|
462
|
-
function
|
|
463
|
-
return
|
|
556
|
+
var K;
|
|
557
|
+
function Se() {
|
|
558
|
+
return K || (K = 1, process.env.NODE_ENV === "production" ? S.exports = je() : S.exports = _e()), S.exports;
|
|
464
559
|
}
|
|
465
|
-
var
|
|
466
|
-
const
|
|
467
|
-
const
|
|
468
|
-
for (const
|
|
469
|
-
let
|
|
470
|
-
|
|
471
|
-
let
|
|
472
|
-
(
|
|
560
|
+
var l = Se();
|
|
561
|
+
const $e = (e) => {
|
|
562
|
+
const n = { children: [] };
|
|
563
|
+
for (const r of e) {
|
|
564
|
+
let s = n;
|
|
565
|
+
r.suite.forEach((i) => {
|
|
566
|
+
let a = s.children.find(
|
|
567
|
+
(c) => "name" in c && !c.status && c.name === i
|
|
473
568
|
);
|
|
474
|
-
|
|
475
|
-
}),
|
|
569
|
+
a || (a = { name: i, children: [] }, s.children.push(a)), s = a;
|
|
570
|
+
}), s.children.push(r);
|
|
476
571
|
}
|
|
477
|
-
return
|
|
478
|
-
},
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
572
|
+
return n.children;
|
|
573
|
+
}, Ce = {
|
|
574
|
+
animation: "spin 1s linear infinite"
|
|
575
|
+
}, Oe = () => /* @__PURE__ */ l.jsx(
|
|
576
|
+
"svg",
|
|
577
|
+
{
|
|
578
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
579
|
+
width: "24",
|
|
580
|
+
height: "24",
|
|
581
|
+
viewBox: "0 0 24 24",
|
|
582
|
+
fill: "none",
|
|
583
|
+
stroke: "currentColor",
|
|
584
|
+
strokeWidth: "2",
|
|
585
|
+
strokeLinecap: "round",
|
|
586
|
+
strokeLinejoin: "round",
|
|
587
|
+
className: "lucide lucide-loader-circle-icon lucide-loader-circle",
|
|
588
|
+
style: Ce,
|
|
589
|
+
"data-testid": "loader-icon",
|
|
590
|
+
children: /* @__PURE__ */ l.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
591
|
+
}
|
|
592
|
+
), $ = typeof document < "u" ? document.createElement("style") : null;
|
|
593
|
+
$ && !document.getElementById("loader-spin-keyframes") && ($.id = "loader-spin-keyframes", $.innerHTML = `
|
|
594
|
+
@keyframes spin {
|
|
595
|
+
0% { transform: rotate(0deg); }
|
|
596
|
+
100% { transform: rotate(360deg); }
|
|
597
|
+
}
|
|
598
|
+
`, document.head.appendChild($));
|
|
599
|
+
const Pe = () => /* @__PURE__ */ l.jsx(
|
|
600
|
+
"svg",
|
|
601
|
+
{
|
|
602
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
603
|
+
width: "12",
|
|
604
|
+
height: "12",
|
|
605
|
+
viewBox: "0 0 24 24",
|
|
606
|
+
fill: "none",
|
|
607
|
+
stroke: "currentColor",
|
|
608
|
+
strokeWidth: "2",
|
|
609
|
+
strokeLinecap: "round",
|
|
610
|
+
strokeLinejoin: "round",
|
|
611
|
+
className: "lucide lucide-play-icon lucide-play",
|
|
612
|
+
"data-testid": "play-icon",
|
|
613
|
+
children: /* @__PURE__ */ l.jsx("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" })
|
|
614
|
+
}
|
|
615
|
+
), Ne = (e) => {
|
|
616
|
+
switch (e.status) {
|
|
617
|
+
case "pass":
|
|
618
|
+
return {
|
|
619
|
+
item: {
|
|
620
|
+
background: "#dcfce7"
|
|
621
|
+
},
|
|
622
|
+
container: {
|
|
623
|
+
borderLeft: "3px solid #00c951"
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
case "fail":
|
|
627
|
+
return {
|
|
628
|
+
item: {
|
|
629
|
+
background: "#fee2e2"
|
|
630
|
+
},
|
|
631
|
+
container: {
|
|
632
|
+
borderLeft: "3px solid #fb2c36"
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
case "skip":
|
|
636
|
+
return {
|
|
637
|
+
item: {
|
|
638
|
+
background: "#f3f4f6"
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
case "running":
|
|
642
|
+
return {
|
|
643
|
+
item: {
|
|
644
|
+
background: "#fef9c3"
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
default:
|
|
648
|
+
return {
|
|
649
|
+
item: {
|
|
650
|
+
background: "transparent"
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
}, Le = (e) => e.startsWith("Assertion passed") ? { color: "#0d542b", fontWeight: "700" } : e.startsWith("Test failed") ? { color: "#fb2c36", fontWeight: "700" } : {}, We = ({ node: e, depth: n, idx: r, runTest: s }) => {
|
|
655
|
+
const i = Ne(e);
|
|
656
|
+
return /* @__PURE__ */ l.jsxs("li", { style: { marginBottom: "4px", marginLeft: n * 6, ...i.container }, "data-testid": `test-list-item-${r}`, children: [
|
|
657
|
+
/* @__PURE__ */ l.jsxs(
|
|
658
|
+
"div",
|
|
659
|
+
{
|
|
660
|
+
style: {
|
|
661
|
+
display: "flex",
|
|
662
|
+
alignItems: "left",
|
|
663
|
+
justifyContent: "space-between",
|
|
664
|
+
padding: "4px 6px",
|
|
665
|
+
borderRadius: "4px",
|
|
666
|
+
...i.item
|
|
667
|
+
},
|
|
668
|
+
children: [
|
|
669
|
+
/* @__PURE__ */ l.jsxs("span", { style: { fontWeight: "500", color: "#374151", maxWidth: "220px" }, children: [
|
|
670
|
+
e.name,
|
|
671
|
+
" ",
|
|
672
|
+
e.only && /* @__PURE__ */ l.jsx("span", { style: { color: "#2563eb" }, "data-testid": `only-indicator-${r}`, children: " (only)" }),
|
|
673
|
+
e.skip && /* @__PURE__ */ l.jsx("span", { style: { color: "#6b7280" }, "data-testid": `skip-indicator-${r}`, children: " (skipped)" })
|
|
674
|
+
] }),
|
|
675
|
+
/* @__PURE__ */ l.jsx(
|
|
676
|
+
"button",
|
|
677
|
+
{
|
|
678
|
+
onClick: () => s(r),
|
|
679
|
+
"aria-label": `Run ${e.name} test`,
|
|
680
|
+
style: {
|
|
681
|
+
background: "transparent",
|
|
682
|
+
border: "1px solid #d1d5db",
|
|
683
|
+
borderRadius: "4px",
|
|
684
|
+
padding: "0",
|
|
685
|
+
cursor: "pointer",
|
|
686
|
+
verticalAlign: "middle",
|
|
687
|
+
fontSize: "12px",
|
|
688
|
+
width: "24px",
|
|
689
|
+
height: "24px",
|
|
690
|
+
display: "flex",
|
|
691
|
+
alignItems: "center",
|
|
692
|
+
justifyContent: "center"
|
|
693
|
+
},
|
|
694
|
+
disabled: e.status === "running",
|
|
695
|
+
"data-testid": `run-test-button-${r}`,
|
|
696
|
+
children: e.status === "running" ? /* @__PURE__ */ l.jsx(Oe, {}) : /* @__PURE__ */ l.jsx(Pe, {})
|
|
697
|
+
}
|
|
698
|
+
)
|
|
699
|
+
]
|
|
700
|
+
}
|
|
701
|
+
),
|
|
702
|
+
e.logs && e.logs.length > 0 && /* @__PURE__ */ l.jsx(
|
|
703
|
+
"ul",
|
|
704
|
+
{
|
|
705
|
+
style: {
|
|
706
|
+
borderRadius: "4px",
|
|
707
|
+
maxHeight: "260px",
|
|
708
|
+
overflowY: "auto",
|
|
709
|
+
padding: 0,
|
|
710
|
+
background: "#f3f4f6",
|
|
711
|
+
listStyle: "none",
|
|
712
|
+
marginTop: "4px",
|
|
713
|
+
textAlign: "left"
|
|
714
|
+
},
|
|
715
|
+
children: e.logs.map((a, c) => /* @__PURE__ */ l.jsx(
|
|
716
|
+
"li",
|
|
499
717
|
{
|
|
500
|
-
onClick: () => o(n),
|
|
501
718
|
style: {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
cursor: "pointer",
|
|
507
|
-
fontSize: "12px"
|
|
719
|
+
fontSize: "12px",
|
|
720
|
+
padding: "4px 6px",
|
|
721
|
+
borderBottom: "1px solid #d1d5db",
|
|
722
|
+
...Le(a)
|
|
508
723
|
},
|
|
509
|
-
children:
|
|
510
|
-
}
|
|
511
|
-
)
|
|
512
|
-
]
|
|
513
|
-
}
|
|
514
|
-
),
|
|
515
|
-
t.logs && t.logs.length > 0 && /* @__PURE__ */ d.jsx(
|
|
516
|
-
"ul",
|
|
517
|
-
{
|
|
518
|
-
style: {
|
|
519
|
-
borderRadius: "4px",
|
|
520
|
-
maxHeight: "160px",
|
|
521
|
-
overflowY: "auto",
|
|
522
|
-
padding: 0,
|
|
523
|
-
background: "#f3f4f6",
|
|
524
|
-
listStyle: "none",
|
|
525
|
-
marginTop: "4px"
|
|
526
|
-
},
|
|
527
|
-
children: t.logs.map((s, l) => /* @__PURE__ */ d.jsx(
|
|
528
|
-
"li",
|
|
529
|
-
{
|
|
530
|
-
style: {
|
|
531
|
-
fontSize: "12px",
|
|
532
|
-
padding: "4px 6px",
|
|
533
|
-
borderBottom: "1px solid #d1d5db"
|
|
724
|
+
children: a
|
|
534
725
|
},
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
726
|
+
c
|
|
727
|
+
))
|
|
728
|
+
}
|
|
729
|
+
)
|
|
730
|
+
] }, e.name);
|
|
731
|
+
}, Ie = () => /* @__PURE__ */ l.jsx(
|
|
732
|
+
"svg",
|
|
733
|
+
{
|
|
734
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
735
|
+
width: "24",
|
|
736
|
+
height: "24",
|
|
737
|
+
viewBox: "0 0 24 24",
|
|
738
|
+
fill: "none",
|
|
739
|
+
stroke: "currentColor",
|
|
740
|
+
strokeWidth: "2",
|
|
741
|
+
strokeLinecap: "round",
|
|
742
|
+
strokeLinejoin: "round",
|
|
743
|
+
className: "lucide lucide-chevron-down-icon lucide-chevron-down",
|
|
744
|
+
"data-testid": "chevron-down-icon",
|
|
745
|
+
children: /* @__PURE__ */ l.jsx("path", { d: "m6 9 6 6 6-6" })
|
|
746
|
+
}
|
|
747
|
+
), De = () => /* @__PURE__ */ l.jsx(
|
|
748
|
+
"svg",
|
|
749
|
+
{
|
|
750
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
751
|
+
width: "24",
|
|
752
|
+
height: "24",
|
|
753
|
+
viewBox: "0 0 24 24",
|
|
754
|
+
fill: "none",
|
|
755
|
+
stroke: "currentColor",
|
|
756
|
+
strokeWidth: "2",
|
|
757
|
+
strokeLinecap: "round",
|
|
758
|
+
strokeLinejoin: "round",
|
|
759
|
+
className: "lucide lucide-chevron-right-icon lucide-chevron-right",
|
|
760
|
+
"data-testid": "chevron-right-icon",
|
|
761
|
+
children: /* @__PURE__ */ l.jsx("path", { d: "m9 18 6-6-6-6" })
|
|
762
|
+
}
|
|
763
|
+
), Ye = ({ runTest: e, tests: n }) => {
|
|
764
|
+
const [r, s] = D({}), i = (c, u = 0) => {
|
|
765
|
+
if ("status" in c)
|
|
766
|
+
return /* @__PURE__ */ l.jsx(We, { node: c, depth: u, idx: n.indexOf(c), runTest: e }, c.name);
|
|
767
|
+
const b = r[c.name];
|
|
768
|
+
return /* @__PURE__ */ l.jsxs("li", { style: { marginBottom: "6px", marginLeft: u * 12, textAlign: "left" }, children: [
|
|
769
|
+
/* @__PURE__ */ l.jsxs(
|
|
548
770
|
"div",
|
|
549
771
|
{
|
|
550
772
|
style: {
|
|
551
773
|
fontWeight: "bold",
|
|
552
774
|
cursor: "pointer",
|
|
553
775
|
color: "#374151",
|
|
554
|
-
marginBottom: "4px"
|
|
776
|
+
marginBottom: "4px",
|
|
777
|
+
display: "flex",
|
|
778
|
+
alignItems: "center",
|
|
779
|
+
gap: "4px"
|
|
555
780
|
},
|
|
556
|
-
onClick: () =>
|
|
781
|
+
onClick: () => s((x) => ({ ...x, [c.name]: !x[c.name] })),
|
|
782
|
+
"data-testid": `test-group-${c.name}`,
|
|
783
|
+
tabIndex: 0,
|
|
784
|
+
role: "button",
|
|
785
|
+
"aria-expanded": !b,
|
|
557
786
|
children: [
|
|
558
|
-
|
|
787
|
+
c.name,
|
|
559
788
|
" ",
|
|
560
|
-
b ?
|
|
789
|
+
b ? /* @__PURE__ */ l.jsx(De, {}) : /* @__PURE__ */ l.jsx(Ie, {})
|
|
561
790
|
]
|
|
562
791
|
}
|
|
563
792
|
),
|
|
564
|
-
!b && /* @__PURE__ */
|
|
565
|
-
] },
|
|
566
|
-
},
|
|
567
|
-
return /* @__PURE__ */
|
|
568
|
-
},
|
|
793
|
+
!b && /* @__PURE__ */ l.jsx("ul", { style: { listStyle: "none", padding: 0 }, children: c.children.map((x) => i(x, u + 1)) })
|
|
794
|
+
] }, c.name);
|
|
795
|
+
}, a = $e(n);
|
|
796
|
+
return /* @__PURE__ */ l.jsx("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: a.map((c) => i(c)) });
|
|
797
|
+
}, Ue = ({ setOpen: e }) => /* @__PURE__ */ l.jsx(
|
|
569
798
|
"div",
|
|
570
799
|
{
|
|
571
800
|
style: {
|
|
@@ -581,35 +810,35 @@ const ve = (t) => {
|
|
|
581
810
|
cursor: "pointer",
|
|
582
811
|
fontSize: "12px"
|
|
583
812
|
},
|
|
584
|
-
onClick: () =>
|
|
585
|
-
children: "
|
|
813
|
+
onClick: () => e(!0),
|
|
814
|
+
children: "TWD"
|
|
586
815
|
}
|
|
587
|
-
),
|
|
588
|
-
const [
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
const b = console.log,
|
|
592
|
-
if (console.log = (...
|
|
593
|
-
|
|
594
|
-
}, console.error = (...
|
|
595
|
-
|
|
596
|
-
},
|
|
597
|
-
|
|
816
|
+
), Ge = () => {
|
|
817
|
+
const [e, n] = D(0), [r, s] = D(!0), i = async (c) => {
|
|
818
|
+
const u = v[c];
|
|
819
|
+
u.logs = [];
|
|
820
|
+
const b = console.log, x = console.error;
|
|
821
|
+
if (console.log = (...h) => {
|
|
822
|
+
u.logs?.push(h.map(String).join(" ")), b(...h), n((y) => y + 1);
|
|
823
|
+
}, console.error = (...h) => {
|
|
824
|
+
u.logs?.push(h.map(String).join(" ")), x(...h), n((y) => y + 1);
|
|
825
|
+
}, u.status = "running", u.skip)
|
|
826
|
+
u.status = "skip";
|
|
598
827
|
else
|
|
599
828
|
try {
|
|
600
|
-
await
|
|
601
|
-
} catch (
|
|
602
|
-
|
|
829
|
+
await u.fn(), u.status = "pass";
|
|
830
|
+
} catch (h) {
|
|
831
|
+
u.status = "fail", console.error("Test failed:", u.name, h);
|
|
603
832
|
}
|
|
604
|
-
console.log = b, console.error =
|
|
605
|
-
},
|
|
606
|
-
const
|
|
607
|
-
for (let b = 0; b <
|
|
608
|
-
const
|
|
609
|
-
await
|
|
833
|
+
console.log = b, console.error = x, n((h) => h + 1);
|
|
834
|
+
}, a = async () => {
|
|
835
|
+
const c = v.filter((b) => b.only), u = c.length > 0 ? c : v;
|
|
836
|
+
for (let b = 0; b < u.length; b++) {
|
|
837
|
+
const x = v.indexOf(u[b]);
|
|
838
|
+
await i(x);
|
|
610
839
|
}
|
|
611
840
|
};
|
|
612
|
-
return
|
|
841
|
+
return r ? /* @__PURE__ */ l.jsxs(
|
|
613
842
|
"div",
|
|
614
843
|
{
|
|
615
844
|
style: {
|
|
@@ -618,6 +847,7 @@ const ve = (t) => {
|
|
|
618
847
|
left: 0,
|
|
619
848
|
bottom: 0,
|
|
620
849
|
width: "280px",
|
|
850
|
+
textAlign: "left",
|
|
621
851
|
background: "#f9fafb",
|
|
622
852
|
borderRight: "1px solid #e5e7eb",
|
|
623
853
|
padding: "8px",
|
|
@@ -626,9 +856,19 @@ const ve = (t) => {
|
|
|
626
856
|
boxShadow: "2px 0 6px rgba(0,0,0,0.1)"
|
|
627
857
|
},
|
|
628
858
|
children: [
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
|
|
859
|
+
/* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "14px", alignItems: "center" }, children: [
|
|
860
|
+
/* @__PURE__ */ l.jsx(
|
|
861
|
+
"strong",
|
|
862
|
+
{
|
|
863
|
+
style: {
|
|
864
|
+
fontSize: "18px",
|
|
865
|
+
fontWeight: "bold",
|
|
866
|
+
color: "#374151"
|
|
867
|
+
},
|
|
868
|
+
children: "TWD Tests"
|
|
869
|
+
}
|
|
870
|
+
),
|
|
871
|
+
/* @__PURE__ */ l.jsx(
|
|
632
872
|
"button",
|
|
633
873
|
{
|
|
634
874
|
style: {
|
|
@@ -637,15 +877,15 @@ const ve = (t) => {
|
|
|
637
877
|
cursor: "pointer",
|
|
638
878
|
fontSize: "14px"
|
|
639
879
|
},
|
|
640
|
-
onClick: () =>
|
|
880
|
+
onClick: () => s(!1),
|
|
641
881
|
children: "✖"
|
|
642
882
|
}
|
|
643
883
|
)
|
|
644
884
|
] }),
|
|
645
|
-
/* @__PURE__ */
|
|
885
|
+
/* @__PURE__ */ l.jsx(
|
|
646
886
|
"button",
|
|
647
887
|
{
|
|
648
|
-
onClick:
|
|
888
|
+
onClick: a,
|
|
649
889
|
style: {
|
|
650
890
|
background: "#3b82f6",
|
|
651
891
|
color: "white",
|
|
@@ -655,20 +895,20 @@ const ve = (t) => {
|
|
|
655
895
|
marginBottom: "10px",
|
|
656
896
|
cursor: "pointer"
|
|
657
897
|
},
|
|
658
|
-
children: "
|
|
898
|
+
children: "Run All"
|
|
659
899
|
}
|
|
660
900
|
),
|
|
661
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ l.jsx(Ye, { tests: v, runTest: i })
|
|
662
902
|
]
|
|
663
903
|
}
|
|
664
|
-
) : /* @__PURE__ */
|
|
904
|
+
) : /* @__PURE__ */ l.jsx(Ue, { setOpen: s });
|
|
665
905
|
};
|
|
666
906
|
export {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
907
|
+
Ge as TWDSidebar,
|
|
908
|
+
qe as beforeEach,
|
|
909
|
+
Fe as describe,
|
|
910
|
+
ze as it,
|
|
911
|
+
Be as itOnly,
|
|
912
|
+
Ve as itSkip,
|
|
913
|
+
Je as twd
|
|
674
914
|
};
|