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/dist/twd.es.js CHANGED
@@ -1,189 +1,284 @@
1
- import ce, { useState as Y } from "react";
2
- const le = (t, r = 2e3, n = 50) => new Promise((o, s) => {
3
- const l = Date.now(), i = () => {
4
- const c = t();
5
- if (c) return o(c);
6
- if (Date.now() - l > r) return s(new Error("Timeout waiting for element"));
7
- setTimeout(i, n);
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
- i();
10
- }), g = [];
11
- let I = [];
12
- const D = (t, r, n = {}) => {
13
- g.push({
14
- name: t,
15
- fn: r,
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: [...I],
19
- ...n
18
+ suite: [...Y],
19
+ ...r
20
20
  });
21
- }, ue = (t) => {
22
- I.push(t);
23
- }, de = () => {
24
- I.pop();
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 fe(t) {
27
- if (!t.isConnected) return !1;
28
- let r = t;
29
- for (; r; ) {
30
- const n = getComputedStyle(r);
31
- if (n.display === "none" || n.visibility === "hidden" || n.visibility === "collapse")
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
- r = r.parentElement;
41
+ n = n.parentElement;
34
42
  }
35
43
  return !0;
36
44
  }
37
- const pe = (t, r, ...n) => {
38
- const o = r.startsWith("not."), s = o ? r.slice(4) : r, i = (() => {
39
- const c = (t.textContent || "").trim();
40
- switch (s) {
41
- // Content
42
- case "have.text":
43
- return c === n[0];
44
- case "contain.text":
45
- return c.includes(n[0]);
46
- case "be.empty":
47
- return c.length === 0;
48
- // Attributes
49
- case "have.attr":
50
- return t.getAttribute(n[0]) === n[1];
51
- case "have.value":
52
- return t.value === n[0];
53
- // State
54
- case "be.disabled":
55
- return t.disabled === !0;
56
- case "be.enabled":
57
- return t.disabled === !1;
58
- case "be.checked":
59
- return t.checked === !0;
60
- case "be.selected":
61
- return t.selected === !0;
62
- case "be.focused":
63
- return document.activeElement === t;
64
- // Visibility
65
- case "be.visible":
66
- return fe(t);
67
- // Classes
68
- case "have.class":
69
- return t.classList.contains(n[0]);
70
- default:
71
- throw new Error(`Unknown assertion: ${s}`);
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
- if (o ? i : !i)
75
- throw new Error(
76
- `Assertion failed: ${r} ${n.length ? JSON.stringify(n) : ""}`
77
- );
78
- }, w = (t) => {
79
- const r = g.find((n) => n.status === "running");
80
- r && r.logs?.push(t);
81
- }, T = [], be = (t, r) => {
82
- const n = T.findIndex((s) => s.alias === t), o = { alias: t, ...r, executed: !1 };
83
- n !== -1 ? T[n] = o : T.push(o);
84
- }, me = async (t) => {
85
- const r = T.find((n) => n.alias === t && n.executed);
86
- if (!r)
87
- throw new Error(`No intercept rule found for ${t}`);
88
- return await new Promise((n) => setTimeout(n, 0)), r;
89
- }, he = window.fetch;
90
- window.fetch = async (t, r) => {
91
- const n = r?.method?.toUpperCase() || "GET", o = typeof t == "string" ? t : t.toString(), s = T.find(
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: n,
105
- code: `Key${n.toUpperCase()}`,
106
- keyCode: o,
107
- which: o,
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
- ), t.dispatchEvent(
176
+ ), e.dispatchEvent(
112
177
  new KeyboardEvent("keypress", {
113
- key: n,
114
- code: `Key${n.toUpperCase()}`,
115
- keyCode: o,
116
- which: o,
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
- ), t.dispatchEvent(
185
+ ), e.dispatchEvent(
121
186
  new InputEvent("beforeinput", {
122
187
  bubbles: !0,
123
188
  cancelable: !0,
124
189
  inputType: "insertText",
125
- data: n
190
+ data: r
126
191
  })
127
192
  ), Object.getOwnPropertyDescriptor(
128
- Object.getPrototypeOf(t),
193
+ Object.getPrototypeOf(e),
129
194
  "value"
130
- )?.set?.call(t, t.value + n), t.dispatchEvent(
195
+ )?.set?.call(e, e.value + r), e.dispatchEvent(
131
196
  new Event("input", {
132
197
  bubbles: !0
133
198
  })
134
- ), t.dispatchEvent(
199
+ ), e.dispatchEvent(
135
200
  new KeyboardEvent("keyup", {
136
- key: n,
137
- code: `Key${n.toUpperCase()}`,
138
- keyCode: o,
139
- which: o,
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 t;
146
- };
147
- let _ = null;
148
- const _e = (t) => {
149
- _ = t;
150
- }, Se = (t, r) => {
151
- ue(t), r(), de();
152
- }, je = (t, r) => {
153
- D(t, async () => {
154
- _ && await _(), await r();
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
- }, Oe = (t, r) => {
157
- D(t, async () => {
158
- _ && await _(), await r();
244
+ }, Be = (e, n) => {
245
+ U(e, async () => {
246
+ j && await j(), await n();
159
247
  }, { only: !0 });
160
- }, Ae = (t, r) => {
161
- D(t, async () => {
248
+ }, Ve = (e, n) => {
249
+ U(e, async () => {
162
250
  }, { skip: !0 });
163
- }, Ce = {
164
- get: async (t) => {
165
- w(`🔎 get("${t}")`);
166
- const r = await le(() => document.querySelector(t)), n = {
167
- el: r,
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
- w(`🖱️ click(${t})`), r.click();
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 o = r.textContent || "";
175
- return w(`📄 text(${t}) → "${o}"`), o;
265
+ const s = n.textContent || "";
266
+ return R(`text(${e}) → "${s}"`), s;
176
267
  }
177
268
  };
178
- return n;
269
+ return r;
179
270
  },
180
- visit: (t) => {
181
- w(`🌍 visit("${t}")`), window.history.pushState({}, "", t), window.dispatchEvent(new PopStateEvent("popstate"));
271
+ visit: (e) => {
272
+ R(`visit("${e}")`), window.history.pushState({}, "", e), window.dispatchEvent(new PopStateEvent("popstate"));
182
273
  },
183
- mockRequest: be,
184
- waitFor: me
274
+ url: Te,
275
+ mockRequest: ve,
276
+ waitForRequest: Ee,
277
+ initRequestMocking: we,
278
+ clearRequestMockRules: ke,
279
+ getRequestMockRules: ye
185
280
  };
186
- var j = { exports: {} }, k = {};
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 V;
197
- function ye() {
198
- if (V) return k;
199
- V = 1;
200
- var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
201
- function n(o, s, l) {
202
- var i = null;
203
- if (l !== void 0 && (i = "" + l), s.key !== void 0 && (i = "" + s.key), "key" in s) {
204
- l = {};
205
- for (var c in s)
206
- c !== "key" && (l[c] = s[c]);
207
- } else l = s;
208
- return s = l.ref, {
209
- $$typeof: t,
210
- type: o,
211
- key: i,
212
- ref: s !== void 0 ? s : null,
213
- props: l
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 k.Fragment = r, k.jsx = n, k.jsxs = n, k;
311
+ return A.Fragment = n, A.jsx = r, A.jsxs = r, A;
217
312
  }
218
- var R = {};
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 B;
229
- function ge() {
230
- return B || (B = 1, process.env.NODE_ENV !== "production" && (function() {
231
- function t(e) {
232
- if (e == null) return null;
233
- if (typeof e == "function")
234
- return e.$$typeof === se ? null : e.displayName || e.name || null;
235
- if (typeof e == "string") return e;
236
- switch (e) {
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 H:
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 re:
340
+ case ae:
246
341
  return "SuspenseList";
247
- case oe:
342
+ case le:
248
343
  return "Activity";
249
344
  }
250
- if (typeof e == "object")
251
- switch (typeof e.tag == "number" && console.error(
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
- ), e.$$typeof) {
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
- var a = e.render;
262
- return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
350
+ return "Portal";
351
+ case se:
352
+ return (t.displayName || "Context") + ".Provider";
263
353
  case ne:
264
- return a = e.displayName || null, a !== null ? a : t(e.type) || "Memo";
265
- case L:
266
- a = e._payload, e = e._init;
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(e(a));
363
+ return e(t(o));
269
364
  } catch {
270
365
  }
271
366
  }
272
367
  return null;
273
368
  }
274
- function r(e) {
275
- return "" + e;
369
+ function n(t) {
370
+ return "" + t;
276
371
  }
277
- function n(e) {
372
+ function r(t) {
278
373
  try {
279
- r(e);
280
- var a = !1;
374
+ n(t);
375
+ var o = !1;
281
376
  } catch {
282
- a = !0;
377
+ o = !0;
283
378
  }
284
- if (a) {
285
- a = console;
286
- var u = a.error, f = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
287
- return u.call(
288
- a,
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
- ), r(e);
386
+ ), n(t);
292
387
  }
293
388
  }
294
- function o(e) {
295
- if (e === O) return "<>";
296
- if (typeof e == "object" && e !== null && e.$$typeof === L)
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 a = t(e);
300
- return a ? "<" + a + ">" : "<...>";
394
+ var o = e(t);
395
+ return o ? "<" + o + ">" : "<...>";
301
396
  } catch {
302
397
  return "<...>";
303
398
  }
304
399
  }
305
- function s() {
306
- var e = A.A;
307
- return e === null ? null : e.getOwner();
400
+ function i() {
401
+ var t = P.A;
402
+ return t === null ? null : t.getOwner();
308
403
  }
309
- function l() {
404
+ function a() {
310
405
  return Error("react-stack-top-frame");
311
406
  }
312
- function i(e) {
313
- if (W.call(e, "key")) {
314
- var a = Object.getOwnPropertyDescriptor(e, "key").get;
315
- if (a && a.isReactWarning) return !1;
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 e.key !== void 0;
412
+ return t.key !== void 0;
318
413
  }
319
- function c(e, a) {
320
- function u() {
321
- U || (U = !0, console.error(
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
- a
418
+ o
324
419
  ));
325
420
  }
326
- u.isReactWarning = !0, Object.defineProperty(e, "key", {
327
- get: u,
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 e = t(this.type);
333
- return z[e] || (z[e] = !0, console.error(
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
- )), e = this.props.ref, e !== void 0 ? e : null;
430
+ )), t = this.props.ref, t !== void 0 ? t : null;
336
431
  }
337
- function h(e, a, u, f, y, x, P, N) {
338
- return u = x.ref, e = {
339
- $$typeof: F,
340
- type: e,
341
- key: a,
342
- props: x,
343
- _owner: y
344
- }, (u !== void 0 ? u : null) !== null ? Object.defineProperty(e, "ref", {
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(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
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(e, "_debugInfo", {
447
+ }), Object.defineProperty(t, "_debugInfo", {
353
448
  configurable: !1,
354
449
  enumerable: !1,
355
450
  writable: !0,
356
451
  value: null
357
- }), Object.defineProperty(e, "_debugStack", {
452
+ }), Object.defineProperty(t, "_debugStack", {
358
453
  configurable: !1,
359
454
  enumerable: !1,
360
455
  writable: !0,
361
- value: P
362
- }), Object.defineProperty(e, "_debugTask", {
456
+ value: L
457
+ }), Object.defineProperty(t, "_debugTask", {
363
458
  configurable: !1,
364
459
  enumerable: !1,
365
460
  writable: !0,
366
- value: N
367
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
461
+ value: W
462
+ }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
368
463
  }
369
- function m(e, a, u, f, y, x, P, N) {
370
- var p = a.children;
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 (ae(p)) {
468
+ if (de(p)) {
374
469
  for (f = 0; f < p.length; f++)
375
- E(p[f]);
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 E(p);
382
- if (W.call(a, "key")) {
383
- p = t(e);
384
- var v = Object.keys(a).filter(function(ie) {
385
- return ie !== "key";
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 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", J[p + f] || (v = 0 < v.length ? "{" + v.join(": ..., ") + ": ...}" : "{}", console.error(
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
- v,
491
+ k,
397
492
  p
398
- ), J[p + f] = !0);
493
+ ), G[p + f] = !0);
399
494
  }
400
- if (p = null, u !== void 0 && (n(u), p = "" + u), i(a) && (n(a.key), p = "" + a.key), "key" in a) {
401
- u = {};
402
- for (var $ in a)
403
- $ !== "key" && (u[$] = a[$]);
404
- } else u = a;
405
- return p && c(
406
- u,
407
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
408
- ), h(
409
- e,
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
- x,
412
- y,
413
- s(),
414
- u,
415
- P,
416
- N
506
+ g,
507
+ w,
508
+ i(),
509
+ d,
510
+ L,
511
+ W
417
512
  );
418
513
  }
419
- function E(e) {
420
- typeof e == "object" && e !== null && e.$$typeof === F && e._store && (e._store.validated = 1);
514
+ function y(t) {
515
+ typeof t == "object" && t !== null && t.$$typeof === M && t._store && (t._store.validated = 1);
421
516
  }
422
- var S = ce, F = Symbol.for("react.transitional.element"), X = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), K = Symbol.for("react.strict_mode"), H = Symbol.for("react.profiler"), Z = Symbol.for("react.consumer"), Q = Symbol.for("react.context"), ee = Symbol.for("react.forward_ref"), te = Symbol.for("react.suspense"), re = Symbol.for("react.suspense_list"), ne = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), oe = Symbol.for("react.activity"), se = Symbol.for("react.client.reference"), A = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, ae = Array.isArray, C = console.createTask ? console.createTask : function() {
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
- S = {
426
- react_stack_bottom_frame: function(e) {
427
- return e();
520
+ _ = {
521
+ react_stack_bottom_frame: function(t) {
522
+ return t();
428
523
  }
429
524
  };
430
- var U, z = {}, q = S.react_stack_bottom_frame.bind(
431
- S,
432
- l
433
- )(), M = C(o(l)), J = {};
434
- R.Fragment = O, R.jsx = function(e, a, u, f, y) {
435
- var x = 1e4 > A.recentlyCreatedOwnerStacks++;
436
- return m(
437
- e,
438
- a,
439
- u,
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
- y,
443
- x ? Error("react-stack-top-frame") : q,
444
- x ? C(o(e)) : M
537
+ w,
538
+ g ? Error("react-stack-top-frame") : V,
539
+ g ? N(s(t)) : J
445
540
  );
446
- }, R.jsxs = function(e, a, u, f, y) {
447
- var x = 1e4 > A.recentlyCreatedOwnerStacks++;
448
- return m(
449
- e,
450
- a,
451
- u,
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
- y,
455
- x ? Error("react-stack-top-frame") : q,
456
- x ? C(o(e)) : M
549
+ w,
550
+ g ? Error("react-stack-top-frame") : V,
551
+ g ? N(s(t)) : J
457
552
  );
458
553
  };
459
- })()), R;
554
+ })()), T;
460
555
  }
461
- var G;
462
- function Ee() {
463
- return G || (G = 1, process.env.NODE_ENV === "production" ? j.exports = ye() : j.exports = ge()), j.exports;
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 d = Ee();
466
- const ve = (t) => {
467
- const r = { children: [] };
468
- for (const n of t) {
469
- let o = r;
470
- n.suite.forEach((s) => {
471
- let l = o.children.find(
472
- (i) => "name" in i && !i.status && i.name === s
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
- l || (l = { name: s, children: [] }, o.children.push(l)), o = l;
475
- }), o.children.push(n);
569
+ a || (a = { name: i, children: [] }, s.children.push(a)), s = a;
570
+ }), s.children.push(r);
476
571
  }
477
- return r.children;
478
- }, we = ({ node: t, depth: r, idx: n, runTest: o }) => /* @__PURE__ */ d.jsxs("li", { style: { marginBottom: "4px", marginLeft: r * 6 }, children: [
479
- /* @__PURE__ */ d.jsxs(
480
- "div",
481
- {
482
- style: {
483
- display: "flex",
484
- alignItems: "center",
485
- justifyContent: "space-between",
486
- padding: "4px 6px",
487
- borderRadius: "4px",
488
- background: t.status === "pass" ? "#dcfce7" : t.status === "fail" ? "#fee2e2" : t.status === "skip" ? "#f3f4f6" : t.status === "running" ? "#fef9c3" : "transparent"
489
- },
490
- children: [
491
- /* @__PURE__ */ d.jsxs("span", { children: [
492
- t.name,
493
- " ",
494
- t.only && /* @__PURE__ */ d.jsx("span", { style: { color: "#2563eb" }, children: "(only)" }),
495
- t.skip && /* @__PURE__ */ d.jsx("span", { style: { color: "#6b7280" }, children: "(skipped)" })
496
- ] }),
497
- /* @__PURE__ */ d.jsx(
498
- "button",
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
- background: "transparent",
503
- border: "1px solid #d1d5db",
504
- borderRadius: "4px",
505
- padding: "2px 6px",
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
- children: s
536
- },
537
- l
538
- ))
539
- }
540
- )
541
- ] }, t.name), ke = ({ runTest: t, tests: r }) => {
542
- const [n, o] = Y({}), s = (i, c = 0) => {
543
- if ("status" in i)
544
- return /* @__PURE__ */ d.jsx(we, { node: i, depth: c, idx: r.indexOf(i), runTest: t }, i.name);
545
- const b = n[i.name];
546
- return /* @__PURE__ */ d.jsxs("li", { style: { marginBottom: "6px", marginLeft: c * 12, textAlign: "left" }, children: [
547
- /* @__PURE__ */ d.jsxs(
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: () => o((h) => ({ ...h, [i.name]: !h[i.name] })),
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
- i.name,
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__ */ d.jsx("ul", { style: { listStyle: "none", padding: 0 }, children: i.children.map((h) => s(h, c + 1)) })
565
- ] }, i.name);
566
- }, l = ve(r);
567
- return /* @__PURE__ */ d.jsx("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: l.map((i) => s(i)) });
568
- }, Re = ({ setOpen: t }) => /* @__PURE__ */ d.jsx(
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: () => t(!0),
585
- children: "TWD"
813
+ onClick: () => e(!0),
814
+ children: "TWD"
586
815
  }
587
- ), Pe = () => {
588
- const [t, r] = Y(0), [n, o] = Y(!0), s = async (i) => {
589
- const c = g[i];
590
- c.logs = [];
591
- const b = console.log, h = console.error;
592
- if (console.log = (...m) => {
593
- c.logs?.push("📝 " + m.map(String).join(" ")), b(...m), r((E) => E + 1);
594
- }, console.error = (...m) => {
595
- c.logs?.push("❌ " + m.map(String).join(" ")), h(...m), r((E) => E + 1);
596
- }, c.status = "running", c.skip)
597
- c.status = "skip";
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 c.fn(), c.status = "pass";
601
- } catch (m) {
602
- c.status = "fail", console.error("Test failed:", c.name, m);
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 = h, r((m) => m + 1);
605
- }, l = async () => {
606
- const i = g.filter((b) => b.only), c = i.length > 0 ? i : g;
607
- for (let b = 0; b < c.length; b++) {
608
- const h = g.indexOf(c[b]);
609
- await s(h);
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 n ? /* @__PURE__ */ d.jsxs(
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__ */ d.jsxs("div", { style: { display: "flex", justifyContent: "space-between", marginBottom: "8px" }, children: [
630
- /* @__PURE__ */ d.jsx("strong", { children: "TWD Tests" }),
631
- /* @__PURE__ */ d.jsx(
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: () => o(!1),
880
+ onClick: () => s(!1),
641
881
  children: "✖"
642
882
  }
643
883
  )
644
884
  ] }),
645
- /* @__PURE__ */ d.jsx(
885
+ /* @__PURE__ */ l.jsx(
646
886
  "button",
647
887
  {
648
- onClick: l,
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: "Run All"
898
+ children: "Run All"
659
899
  }
660
900
  ),
661
- /* @__PURE__ */ d.jsx(ke, { tests: g, runTest: s })
901
+ /* @__PURE__ */ l.jsx(Ye, { tests: v, runTest: i })
662
902
  ]
663
903
  }
664
- ) : /* @__PURE__ */ d.jsx(Re, { setOpen: o });
904
+ ) : /* @__PURE__ */ l.jsx(Ue, { setOpen: s });
665
905
  };
666
906
  export {
667
- Pe as TWDSidebar,
668
- _e as beforeEach,
669
- Se as describe,
670
- je as it,
671
- Oe as itOnly,
672
- Ae as itSkip,
673
- Ce as twd
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
  };