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