@storybook/addon-vitest 0.0.0-pr-32795-sha-f0ac445c → 0.0.0-pr-32717-sha-b8c5e103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_browser-chunks/chunk-JK72E6FR.js +6 -0
- package/dist/_browser-chunks/chunk-RPDOPHZX.js +77 -0
- package/dist/_node-chunks/{chunk-PI4OHO3O.js → chunk-7I3XZAZ7.js} +24 -15
- package/dist/_node-chunks/chunk-AKC4U5HL.js +40 -0
- package/dist/_node-chunks/chunk-KSSAW7TR.js +247 -0
- package/dist/_node-chunks/chunk-NGGAGIMA.js +69 -0
- package/dist/_node-chunks/chunk-UJUXFQ2W.js +260 -0
- package/dist/_node-chunks/chunk-WR6HRATV.js +60 -0
- package/dist/_node-chunks/chunk-X4AEIMZO.js +92 -0
- package/dist/_node-chunks/chunk-Y2XQIAV5.js +502 -0
- package/dist/_node-chunks/chunk-ZMWJWQPS.js +50 -0
- package/dist/index.js +5 -1
- package/dist/manager.js +354 -163
- package/dist/node/coverage-reporter.js +864 -319
- package/dist/node/vitest.js +466 -190
- package/dist/postinstall.js +1276 -633
- package/dist/preset.js +354 -160
- package/dist/vitest-plugin/global-setup.js +105 -51
- package/dist/vitest-plugin/index.js +2381 -1161
- package/dist/vitest-plugin/setup-file.js +12 -6
- package/dist/vitest-plugin/test-utils.js +71 -31
- package/package.json +3 -7
- package/dist/_browser-chunks/chunk-ULSHVN74.js +0 -60
- package/dist/_node-chunks/chunk-3JME42XS.js +0 -1697
- package/dist/_node-chunks/chunk-3MTE45JW.js +0 -339
- package/dist/_node-chunks/chunk-CKQN7IR2.js +0 -69
- package/dist/_node-chunks/chunk-HCCHV65D.js +0 -45
- package/dist/_node-chunks/chunk-MQUBKGKA.js +0 -35
- package/dist/_node-chunks/chunk-RIAV333R.js +0 -83
- package/dist/_node-chunks/chunk-SNWBLFHL.js +0 -138
package/dist/manager.js
CHANGED
|
@@ -9,7 +9,10 @@ import {
|
|
|
9
9
|
STATUS_TYPE_ID_COMPONENT_TEST,
|
|
10
10
|
TEST_PROVIDER_ID,
|
|
11
11
|
storeOptions
|
|
12
|
-
} from "./_browser-chunks/chunk-
|
|
12
|
+
} from "./_browser-chunks/chunk-RPDOPHZX.js";
|
|
13
|
+
import {
|
|
14
|
+
__name
|
|
15
|
+
} from "./_browser-chunks/chunk-JK72E6FR.js";
|
|
13
16
|
|
|
14
17
|
// src/manager.tsx
|
|
15
18
|
import React5, { useState as useState3 } from "react";
|
|
@@ -24,7 +27,10 @@ import {
|
|
|
24
27
|
var store = experimental_UniversalStore.create({
|
|
25
28
|
...storeOptions,
|
|
26
29
|
leader: globalThis.CONFIG_TYPE === "PRODUCTION"
|
|
27
|
-
})
|
|
30
|
+
});
|
|
31
|
+
var componentTestStatusStore = experimental_getStatusStore(STATUS_TYPE_ID_COMPONENT_TEST);
|
|
32
|
+
var a11yStatusStore = experimental_getStatusStore(STATUS_TYPE_ID_A11Y);
|
|
33
|
+
var testProviderStore = experimental_getTestProviderStore(ADDON_ID2);
|
|
28
34
|
|
|
29
35
|
// src/manager.tsx
|
|
30
36
|
import { addons as addons2 } from "storybook/manager-api";
|
|
@@ -40,44 +46,58 @@ var ModalBar = styled.div({
|
|
|
40
46
|
justifyContent: "space-between",
|
|
41
47
|
alignItems: "center",
|
|
42
48
|
padding: "6px 6px 6px 20px"
|
|
43
|
-
})
|
|
49
|
+
});
|
|
50
|
+
var ModalActionBar = styled.div({
|
|
44
51
|
display: "flex",
|
|
45
52
|
justifyContent: "space-between",
|
|
46
53
|
alignItems: "center"
|
|
47
|
-
})
|
|
54
|
+
});
|
|
55
|
+
var ModalTitle = styled(Modal.Title)(({ theme: { typography } }) => ({
|
|
48
56
|
fontSize: typography.size.s2,
|
|
49
57
|
fontWeight: typography.weight.bold
|
|
50
|
-
}))
|
|
58
|
+
}));
|
|
59
|
+
var ModalStackTrace = styled.pre(({ theme }) => ({
|
|
51
60
|
whiteSpace: "pre-wrap",
|
|
52
61
|
wordWrap: "break-word",
|
|
53
62
|
overflow: "auto",
|
|
54
63
|
maxHeight: "60vh",
|
|
55
64
|
margin: 0,
|
|
56
|
-
padding:
|
|
65
|
+
padding: `20px`,
|
|
57
66
|
fontFamily: theme.typography.fonts.mono,
|
|
58
67
|
fontSize: "12px",
|
|
59
68
|
borderTop: `1px solid ${theme.appBorderColor}`,
|
|
60
69
|
borderRadius: 0
|
|
61
|
-
}))
|
|
70
|
+
}));
|
|
71
|
+
var TroubleshootLink = styled.a(({ theme }) => ({
|
|
62
72
|
color: theme.color.defaultText
|
|
63
|
-
}))
|
|
64
|
-
|
|
73
|
+
}));
|
|
74
|
+
var GlobalErrorContext = React.createContext({
|
|
75
|
+
isModalOpen: false,
|
|
65
76
|
setModalOpen: void 0
|
|
66
77
|
});
|
|
67
78
|
function ErrorCause({ error }) {
|
|
68
|
-
|
|
79
|
+
if (!error) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return React.createElement("div", null, React.createElement("h4", null, "Caused by: ", error.name || "Error", ": ", error.message), error.stack && React.createElement("pre", null, error.stack), error.cause && React.createElement(ErrorCause, { error: error.cause }));
|
|
69
83
|
}
|
|
84
|
+
__name(ErrorCause, "ErrorCause");
|
|
70
85
|
function GlobalErrorModal({ onRerun, storeState }) {
|
|
71
|
-
|
|
86
|
+
const api = useStorybookApi();
|
|
87
|
+
const { isModalOpen, setModalOpen } = useContext(GlobalErrorContext);
|
|
88
|
+
const troubleshootURL = api.getDocsUrl({
|
|
72
89
|
subpath: DOCUMENTATION_FATAL_ERROR_LINK,
|
|
73
|
-
versioned:
|
|
74
|
-
renderer:
|
|
75
|
-
})
|
|
90
|
+
versioned: true,
|
|
91
|
+
renderer: true
|
|
92
|
+
});
|
|
93
|
+
const {
|
|
76
94
|
fatalError,
|
|
77
95
|
currentRun: { unhandledErrors }
|
|
78
|
-
} = storeState
|
|
79
|
-
|
|
96
|
+
} = storeState;
|
|
97
|
+
const content = fatalError ? React.createElement(React.Fragment, null, React.createElement("p", null, fatalError.error.name || "Error"), fatalError.message && React.createElement("p", null, fatalError.message), fatalError.error.message && React.createElement("p", null, fatalError.error.message), fatalError.error.stack && React.createElement("p", null, fatalError.error.stack), fatalError.error.cause && React.createElement(ErrorCause, { error: fatalError.error.cause })) : unhandledErrors.length > 0 ? React.createElement("ol", null, unhandledErrors.map((error) => React.createElement("li", { key: error.name + error.message }, React.createElement("p", null, error.name, ": ", error.message), error.VITEST_TEST_PATH && React.createElement("p", null, 'This error originated in "', React.createElement("b", null, error.VITEST_TEST_PATH), `". It doesn't mean the error was thrown inside the file itself, but while it was running.`), error.VITEST_TEST_NAME && React.createElement(React.Fragment, null, React.createElement("p", null, `The latest test that might've caused the error is "`, React.createElement("b", null, error.VITEST_TEST_NAME), '". It might mean one of the following:'), React.createElement("ul", null, React.createElement("li", null, "The error was thrown, while Vitest was running this test."), React.createElement("li", null, "If the error occurred after the test had been completed, this was the last documented test before it was thrown."))), error.stacks && React.createElement(React.Fragment, null, React.createElement("p", null, React.createElement("b", null, "Stacks:")), React.createElement("ul", null, error.stacks.map((stack) => React.createElement("li", { key: stack.file + stack.line + stack.column }, stack.file, ":", stack.line, ":", stack.column, " - ", stack.method || "unknown method")))), error.stack && React.createElement("p", null, error.stack), error.cause ? React.createElement(ErrorCause, { error: error.cause }) : null))) : null;
|
|
98
|
+
return React.createElement(Modal, { ariaLabel: "Storybook Tests error details", onOpenChange: setModalOpen, open: isModalOpen }, React.createElement(ModalBar, null, React.createElement(ModalTitle, null, "Storybook Tests error details"), React.createElement(ModalActionBar, null, React.createElement(Button, { onClick: onRerun, variant: "ghost", ariaLabel: false }, React.createElement(SyncIcon, null), "Rerun"), React.createElement(Button, { variant: "ghost", ariaLabel: false, asChild: true }, React.createElement("a", { target: "_blank", href: troubleshootURL, rel: "noreferrer" }, "Troubleshoot")), React.createElement(Modal.Close, null))), React.createElement(ModalStackTrace, null, content, React.createElement("br", null), React.createElement("br", null), "Troubleshoot:", " ", React.createElement(TroubleshootLink, { target: "_blank", href: troubleshootURL }, troubleshootURL)));
|
|
80
99
|
}
|
|
100
|
+
__name(GlobalErrorModal, "GlobalErrorModal");
|
|
81
101
|
|
|
82
102
|
// src/components/SidebarContextMenu.tsx
|
|
83
103
|
import React4 from "react";
|
|
@@ -87,103 +107,172 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
87
107
|
|
|
88
108
|
// ../../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
89
109
|
function isPlainObject(value) {
|
|
90
|
-
if (!value || typeof value
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
|
|
110
|
+
if (!value || typeof value !== "object") {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
const proto = Object.getPrototypeOf(value);
|
|
114
|
+
const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
|
|
115
|
+
if (!hasObjectPrototype) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
94
119
|
}
|
|
120
|
+
__name(isPlainObject, "isPlainObject");
|
|
95
121
|
|
|
96
122
|
// ../../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
|
|
97
123
|
function getSymbols(object) {
|
|
98
124
|
return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
|
|
99
125
|
}
|
|
126
|
+
__name(getSymbols, "getSymbols");
|
|
100
127
|
|
|
101
128
|
// ../../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
102
129
|
function getTag(value) {
|
|
103
|
-
|
|
130
|
+
if (value == null) {
|
|
131
|
+
return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
132
|
+
}
|
|
133
|
+
return Object.prototype.toString.call(value);
|
|
104
134
|
}
|
|
135
|
+
__name(getTag, "getTag");
|
|
105
136
|
|
|
106
137
|
// ../../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
|
|
107
|
-
var regexpTag = "[object RegExp]"
|
|
138
|
+
var regexpTag = "[object RegExp]";
|
|
139
|
+
var stringTag = "[object String]";
|
|
140
|
+
var numberTag = "[object Number]";
|
|
141
|
+
var booleanTag = "[object Boolean]";
|
|
142
|
+
var argumentsTag = "[object Arguments]";
|
|
143
|
+
var symbolTag = "[object Symbol]";
|
|
144
|
+
var dateTag = "[object Date]";
|
|
145
|
+
var mapTag = "[object Map]";
|
|
146
|
+
var setTag = "[object Set]";
|
|
147
|
+
var arrayTag = "[object Array]";
|
|
148
|
+
var functionTag = "[object Function]";
|
|
149
|
+
var arrayBufferTag = "[object ArrayBuffer]";
|
|
150
|
+
var objectTag = "[object Object]";
|
|
151
|
+
var errorTag = "[object Error]";
|
|
152
|
+
var dataViewTag = "[object DataView]";
|
|
153
|
+
var uint8ArrayTag = "[object Uint8Array]";
|
|
154
|
+
var uint8ClampedArrayTag = "[object Uint8ClampedArray]";
|
|
155
|
+
var uint16ArrayTag = "[object Uint16Array]";
|
|
156
|
+
var uint32ArrayTag = "[object Uint32Array]";
|
|
157
|
+
var bigUint64ArrayTag = "[object BigUint64Array]";
|
|
158
|
+
var int8ArrayTag = "[object Int8Array]";
|
|
159
|
+
var int16ArrayTag = "[object Int16Array]";
|
|
160
|
+
var int32ArrayTag = "[object Int32Array]";
|
|
161
|
+
var bigInt64ArrayTag = "[object BigInt64Array]";
|
|
162
|
+
var float32ArrayTag = "[object Float32Array]";
|
|
163
|
+
var float64ArrayTag = "[object Float64Array]";
|
|
108
164
|
|
|
109
165
|
// ../../node_modules/es-toolkit/dist/compat/util/eq.mjs
|
|
110
166
|
function eq(value, other) {
|
|
111
167
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
112
168
|
}
|
|
169
|
+
__name(eq, "eq");
|
|
113
170
|
|
|
114
171
|
// ../../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
|
|
115
172
|
function isEqualWith(a, b, areValuesEqual) {
|
|
116
173
|
return isEqualWithImpl(a, b, void 0, void 0, void 0, void 0, areValuesEqual);
|
|
117
174
|
}
|
|
175
|
+
__name(isEqualWith, "isEqualWith");
|
|
118
176
|
function isEqualWithImpl(a, b, property, aParent, bParent, stack, areValuesEqual) {
|
|
119
|
-
|
|
120
|
-
if (result !== void 0)
|
|
177
|
+
const result = areValuesEqual(a, b, property, aParent, bParent, stack);
|
|
178
|
+
if (result !== void 0) {
|
|
121
179
|
return result;
|
|
122
|
-
|
|
180
|
+
}
|
|
181
|
+
if (typeof a === typeof b) {
|
|
123
182
|
switch (typeof a) {
|
|
124
183
|
case "bigint":
|
|
125
184
|
case "string":
|
|
126
185
|
case "boolean":
|
|
127
186
|
case "symbol":
|
|
128
|
-
case "undefined":
|
|
187
|
+
case "undefined": {
|
|
129
188
|
return a === b;
|
|
130
|
-
|
|
189
|
+
}
|
|
190
|
+
case "number": {
|
|
131
191
|
return a === b || Object.is(a, b);
|
|
132
|
-
|
|
192
|
+
}
|
|
193
|
+
case "function": {
|
|
133
194
|
return a === b;
|
|
134
|
-
|
|
195
|
+
}
|
|
196
|
+
case "object": {
|
|
135
197
|
return areObjectsEqual(a, b, stack, areValuesEqual);
|
|
198
|
+
}
|
|
136
199
|
}
|
|
200
|
+
}
|
|
137
201
|
return areObjectsEqual(a, b, stack, areValuesEqual);
|
|
138
202
|
}
|
|
203
|
+
__name(isEqualWithImpl, "isEqualWithImpl");
|
|
139
204
|
function areObjectsEqual(a, b, stack, areValuesEqual) {
|
|
140
|
-
if (Object.is(a, b))
|
|
141
|
-
return
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
205
|
+
if (Object.is(a, b)) {
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
let aTag = getTag(a);
|
|
209
|
+
let bTag = getTag(b);
|
|
210
|
+
if (aTag === argumentsTag) {
|
|
211
|
+
aTag = objectTag;
|
|
212
|
+
}
|
|
213
|
+
if (bTag === argumentsTag) {
|
|
214
|
+
bTag = objectTag;
|
|
215
|
+
}
|
|
216
|
+
if (aTag !== bTag) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
145
219
|
switch (aTag) {
|
|
146
220
|
case stringTag:
|
|
147
221
|
return a.toString() === b.toString();
|
|
148
222
|
case numberTag: {
|
|
149
|
-
|
|
223
|
+
const x = a.valueOf();
|
|
224
|
+
const y = b.valueOf();
|
|
150
225
|
return eq(x, y);
|
|
151
226
|
}
|
|
152
227
|
case booleanTag:
|
|
153
228
|
case dateTag:
|
|
154
229
|
case symbolTag:
|
|
155
230
|
return Object.is(a.valueOf(), b.valueOf());
|
|
156
|
-
case regexpTag:
|
|
231
|
+
case regexpTag: {
|
|
157
232
|
return a.source === b.source && a.flags === b.flags;
|
|
158
|
-
|
|
233
|
+
}
|
|
234
|
+
case functionTag: {
|
|
159
235
|
return a === b;
|
|
236
|
+
}
|
|
160
237
|
}
|
|
161
238
|
stack = stack ?? /* @__PURE__ */ new Map();
|
|
162
|
-
|
|
163
|
-
|
|
239
|
+
const aStack = stack.get(a);
|
|
240
|
+
const bStack = stack.get(b);
|
|
241
|
+
if (aStack != null && bStack != null) {
|
|
164
242
|
return aStack === b;
|
|
165
|
-
|
|
243
|
+
}
|
|
244
|
+
stack.set(a, b);
|
|
245
|
+
stack.set(b, a);
|
|
166
246
|
try {
|
|
167
247
|
switch (aTag) {
|
|
168
248
|
case mapTag: {
|
|
169
|
-
if (a.size !== b.size)
|
|
170
|
-
return
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
249
|
+
if (a.size !== b.size) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
for (const [key, value] of a.entries()) {
|
|
253
|
+
if (!b.has(key) || !isEqualWithImpl(value, b.get(key), key, a, b, stack, areValuesEqual)) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return true;
|
|
175
258
|
}
|
|
176
259
|
case setTag: {
|
|
177
|
-
if (a.size !== b.size)
|
|
178
|
-
return
|
|
179
|
-
|
|
260
|
+
if (a.size !== b.size) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
const aValues = Array.from(a.values());
|
|
264
|
+
const bValues = Array.from(b.values());
|
|
180
265
|
for (let i = 0; i < aValues.length; i++) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return
|
|
266
|
+
const aValue = aValues[i];
|
|
267
|
+
const index = bValues.findIndex((bValue) => {
|
|
268
|
+
return isEqualWithImpl(aValue, bValue, void 0, a, b, stack, areValuesEqual);
|
|
269
|
+
});
|
|
270
|
+
if (index === -1) {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
184
273
|
bValues.splice(index, 1);
|
|
185
274
|
}
|
|
186
|
-
return
|
|
275
|
+
return true;
|
|
187
276
|
}
|
|
188
277
|
case arrayTag:
|
|
189
278
|
case uint8ArrayTag:
|
|
@@ -197,51 +286,78 @@ function areObjectsEqual(a, b, stack, areValuesEqual) {
|
|
|
197
286
|
case bigInt64ArrayTag:
|
|
198
287
|
case float32ArrayTag:
|
|
199
288
|
case float64ArrayTag: {
|
|
200
|
-
if (typeof Buffer
|
|
201
|
-
return
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
289
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(a) !== Buffer.isBuffer(b)) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
if (a.length !== b.length) {
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
for (let i = 0; i < a.length; i++) {
|
|
296
|
+
if (!isEqualWithImpl(a[i], b[i], i, a, b, stack, areValuesEqual)) {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
case arrayBufferTag: {
|
|
303
|
+
if (a.byteLength !== b.byteLength) {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
|
|
307
|
+
}
|
|
308
|
+
case dataViewTag: {
|
|
309
|
+
if (a.byteLength !== b.byteLength || a.byteOffset !== b.byteOffset) {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
|
|
206
313
|
}
|
|
207
|
-
case
|
|
208
|
-
return a.byteLength !== b.byteLength ? !1 : areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
|
|
209
|
-
case dataViewTag:
|
|
210
|
-
return a.byteLength !== b.byteLength || a.byteOffset !== b.byteOffset ? !1 : areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
|
|
211
|
-
case errorTag:
|
|
314
|
+
case errorTag: {
|
|
212
315
|
return a.name === b.name && a.message === b.message;
|
|
316
|
+
}
|
|
213
317
|
case objectTag: {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
318
|
+
const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack, areValuesEqual) || isPlainObject(a) && isPlainObject(b);
|
|
319
|
+
if (!areEqualInstances) {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
const aKeys = [...Object.keys(a), ...getSymbols(a)];
|
|
323
|
+
const bKeys = [...Object.keys(b), ...getSymbols(b)];
|
|
324
|
+
if (aKeys.length !== bKeys.length) {
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
219
327
|
for (let i = 0; i < aKeys.length; i++) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
328
|
+
const propKey = aKeys[i];
|
|
329
|
+
const aProp = a[propKey];
|
|
330
|
+
if (!Object.hasOwn(b, propKey)) {
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
const bProp = b[propKey];
|
|
334
|
+
if (!isEqualWithImpl(aProp, bProp, propKey, a, b, stack, areValuesEqual)) {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
226
337
|
}
|
|
227
|
-
return
|
|
338
|
+
return true;
|
|
339
|
+
}
|
|
340
|
+
default: {
|
|
341
|
+
return false;
|
|
228
342
|
}
|
|
229
|
-
default:
|
|
230
|
-
return !1;
|
|
231
343
|
}
|
|
232
344
|
} finally {
|
|
233
|
-
stack.delete(a)
|
|
345
|
+
stack.delete(a);
|
|
346
|
+
stack.delete(b);
|
|
234
347
|
}
|
|
235
348
|
}
|
|
349
|
+
__name(areObjectsEqual, "areObjectsEqual");
|
|
236
350
|
|
|
237
351
|
// ../../node_modules/es-toolkit/dist/function/noop.mjs
|
|
238
352
|
function noop() {
|
|
239
353
|
}
|
|
354
|
+
__name(noop, "noop");
|
|
240
355
|
|
|
241
356
|
// ../../node_modules/es-toolkit/dist/predicate/isEqual.mjs
|
|
242
357
|
function isEqual(a, b) {
|
|
243
358
|
return isEqualWith(a, b, noop);
|
|
244
359
|
}
|
|
360
|
+
__name(isEqual, "isEqual");
|
|
245
361
|
|
|
246
362
|
// src/use-test-provider-state.ts
|
|
247
363
|
import {
|
|
@@ -249,42 +365,61 @@ import {
|
|
|
249
365
|
experimental_useTestProviderStore,
|
|
250
366
|
experimental_useUniversalStore
|
|
251
367
|
} from "storybook/manager-api";
|
|
252
|
-
var statusValueToStoryIds = (allStatuses, typeId, storyIds) => {
|
|
253
|
-
|
|
368
|
+
var statusValueToStoryIds = /* @__PURE__ */ __name((allStatuses, typeId, storyIds) => {
|
|
369
|
+
const statusValueToStoryIdsMap = {
|
|
254
370
|
"status-value:pending": [],
|
|
255
371
|
"status-value:success": [],
|
|
256
372
|
"status-value:error": [],
|
|
257
373
|
"status-value:warning": [],
|
|
258
374
|
"status-value:unknown": []
|
|
259
375
|
};
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
status
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
376
|
+
const stories = storyIds ? storyIds.map((storyId) => allStatuses[storyId]).filter(Boolean) : Object.values(allStatuses);
|
|
377
|
+
stories.forEach((statusByTypeId) => {
|
|
378
|
+
const status = statusByTypeId[typeId];
|
|
379
|
+
if (!status) {
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
statusValueToStoryIdsMap[status.value].push(status.storyId);
|
|
383
|
+
});
|
|
384
|
+
return statusValueToStoryIdsMap;
|
|
385
|
+
}, "statusValueToStoryIds");
|
|
386
|
+
var useTestProvider = /* @__PURE__ */ __name((api, entryId) => {
|
|
387
|
+
const testProviderState = experimental_useTestProviderStore((s) => s[ADDON_ID2]);
|
|
388
|
+
const [storeState, setStoreState] = experimental_useUniversalStore(store);
|
|
389
|
+
const [isSettingsUpdated, setIsSettingsUpdated] = useState(false);
|
|
390
|
+
const settingsUpdatedTimeoutRef = useRef();
|
|
266
391
|
useEffect(() => {
|
|
267
|
-
|
|
268
|
-
isEqual(state.config, previousState.config)
|
|
269
|
-
|
|
270
|
-
|
|
392
|
+
const unsubscribe = store.onStateChange((state, previousState) => {
|
|
393
|
+
if (!isEqual(state.config, previousState.config)) {
|
|
394
|
+
testProviderStore.settingsChanged();
|
|
395
|
+
setIsSettingsUpdated(true);
|
|
396
|
+
clearTimeout(settingsUpdatedTimeoutRef.current);
|
|
397
|
+
settingsUpdatedTimeoutRef.current = setTimeout(() => {
|
|
398
|
+
setIsSettingsUpdated(false);
|
|
399
|
+
}, 1e3);
|
|
400
|
+
}
|
|
271
401
|
});
|
|
272
402
|
return () => {
|
|
273
|
-
unsubscribe()
|
|
403
|
+
unsubscribe();
|
|
404
|
+
clearTimeout(settingsUpdatedTimeoutRef.current);
|
|
274
405
|
};
|
|
275
406
|
}, []);
|
|
276
|
-
|
|
407
|
+
const storyIds = useMemo(
|
|
277
408
|
() => entryId ? api.findAllLeafStoryIds(entryId) : void 0,
|
|
278
409
|
[entryId, api]
|
|
279
|
-
)
|
|
410
|
+
);
|
|
411
|
+
const componentTestStatusSelector = useCallback(
|
|
280
412
|
(allStatuses) => statusValueToStoryIds(allStatuses, STATUS_TYPE_ID_COMPONENT_TEST, storyIds),
|
|
281
413
|
[storyIds]
|
|
282
|
-
)
|
|
414
|
+
);
|
|
415
|
+
const componentTestStatusValueToStoryIds = experimental_useStatusStore(
|
|
283
416
|
componentTestStatusSelector
|
|
284
|
-
)
|
|
417
|
+
);
|
|
418
|
+
const a11yStatusValueToStoryIdsSelector = useCallback(
|
|
285
419
|
(allStatuses) => statusValueToStoryIds(allStatuses, STATUS_TYPE_ID_A11Y, storyIds),
|
|
286
420
|
[storyIds]
|
|
287
|
-
)
|
|
421
|
+
);
|
|
422
|
+
const a11yStatusValueToStoryIds = experimental_useStatusStore(a11yStatusValueToStoryIdsSelector);
|
|
288
423
|
return {
|
|
289
424
|
storeState,
|
|
290
425
|
setStoreState,
|
|
@@ -293,7 +428,7 @@ var statusValueToStoryIds = (allStatuses, typeId, storyIds) => {
|
|
|
293
428
|
a11yStatusValueToStoryIds,
|
|
294
429
|
isSettingsUpdated
|
|
295
430
|
};
|
|
296
|
-
};
|
|
431
|
+
}, "useTestProvider");
|
|
297
432
|
|
|
298
433
|
// src/components/TestProviderRender.tsx
|
|
299
434
|
import React3 from "react";
|
|
@@ -315,28 +450,33 @@ import { styled as styled2 } from "storybook/theming";
|
|
|
315
450
|
|
|
316
451
|
// src/components/RelativeTime.tsx
|
|
317
452
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
318
|
-
var RelativeTime = ({ timestamp }) => {
|
|
319
|
-
|
|
320
|
-
|
|
453
|
+
var RelativeTime = /* @__PURE__ */ __name(({ timestamp }) => {
|
|
454
|
+
const [timeAgo, setTimeAgo] = useState2(null);
|
|
455
|
+
useEffect2(() => {
|
|
321
456
|
if (timestamp) {
|
|
322
457
|
setTimeAgo(Date.now() - timestamp);
|
|
323
|
-
|
|
458
|
+
const interval = setInterval(() => setTimeAgo(Date.now() - timestamp), 1e4);
|
|
324
459
|
return () => clearInterval(interval);
|
|
325
460
|
}
|
|
326
|
-
}, [timestamp])
|
|
461
|
+
}, [timestamp]);
|
|
462
|
+
if (timeAgo === null) {
|
|
327
463
|
return null;
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
464
|
+
}
|
|
465
|
+
const seconds = Math.round(timeAgo / 1e3);
|
|
466
|
+
if (seconds < 60) {
|
|
467
|
+
return `just now`;
|
|
468
|
+
}
|
|
469
|
+
const minutes = Math.floor(seconds / 60);
|
|
470
|
+
if (minutes < 60) {
|
|
471
|
+
return minutes === 1 ? `a minute ago` : `${minutes} minutes ago`;
|
|
472
|
+
}
|
|
473
|
+
const hours = Math.floor(minutes / 60);
|
|
474
|
+
if (hours < 24) {
|
|
475
|
+
return hours === 1 ? `an hour ago` : `${hours} hours ago`;
|
|
476
|
+
}
|
|
477
|
+
const days = Math.floor(hours / 24);
|
|
478
|
+
return days === 1 ? `yesterday` : `${days} days ago`;
|
|
479
|
+
}, "RelativeTime");
|
|
340
480
|
|
|
341
481
|
// src/components/Description.tsx
|
|
342
482
|
var Wrapper = styled2.div(({ theme }) => ({
|
|
@@ -345,7 +485,8 @@ var Wrapper = styled2.div(({ theme }) => ({
|
|
|
345
485
|
textOverflow: "ellipsis",
|
|
346
486
|
fontSize: theme.typography.size.s1,
|
|
347
487
|
color: theme.textMutedColor
|
|
348
|
-
}))
|
|
488
|
+
}));
|
|
489
|
+
var PositiveText = styled2.span(({ theme }) => ({
|
|
349
490
|
color: theme.color.positiveText
|
|
350
491
|
}));
|
|
351
492
|
function Description({
|
|
@@ -355,19 +496,29 @@ function Description({
|
|
|
355
496
|
isSettingsUpdated,
|
|
356
497
|
...props
|
|
357
498
|
}) {
|
|
358
|
-
|
|
359
|
-
|
|
499
|
+
const { setModalOpen } = React2.useContext(GlobalErrorContext);
|
|
500
|
+
const { componentTestCount, totalTestCount, unhandledErrors, finishedAt } = storeState.currentRun;
|
|
501
|
+
const finishedTestCount = componentTestCount.success + componentTestCount.error;
|
|
502
|
+
let description = "Not run";
|
|
503
|
+
if (!entryId && isSettingsUpdated) {
|
|
360
504
|
description = React2.createElement(PositiveText, null, "Settings updated");
|
|
361
|
-
else if (testProviderState === "test-provider-state:running")
|
|
505
|
+
} else if (testProviderState === "test-provider-state:running") {
|
|
362
506
|
description = (finishedTestCount ?? 0) === 0 ? "Starting..." : `Testing... ${finishedTestCount}/${totalTestCount}`;
|
|
363
|
-
else if (!entryId && testProviderState === "test-provider-state:crashed")
|
|
364
|
-
description = setModalOpen ? React2.createElement(LinkComponent, { isButton:
|
|
365
|
-
else if (!entryId && unhandledErrors.length > 0) {
|
|
366
|
-
|
|
367
|
-
description = setModalOpen ? React2.createElement(LinkComponent, { isButton:
|
|
368
|
-
} else entryId && totalTestCount
|
|
507
|
+
} else if (!entryId && testProviderState === "test-provider-state:crashed") {
|
|
508
|
+
description = setModalOpen ? React2.createElement(LinkComponent, { isButton: true, onClick: () => setModalOpen(true) }, "View full error") : "Crashed";
|
|
509
|
+
} else if (!entryId && unhandledErrors.length > 0) {
|
|
510
|
+
const unhandledErrorDescription = `View ${unhandledErrors.length} unhandled error${unhandledErrors?.length > 1 ? "s" : ""}`;
|
|
511
|
+
description = setModalOpen ? React2.createElement(LinkComponent, { isButton: true, onClick: () => setModalOpen(true) }, unhandledErrorDescription) : unhandledErrorDescription;
|
|
512
|
+
} else if (entryId && totalTestCount) {
|
|
513
|
+
description = `Ran ${totalTestCount} ${totalTestCount === 1 ? "test" : "tests"}`;
|
|
514
|
+
} else if (finishedAt) {
|
|
515
|
+
description = React2.createElement(React2.Fragment, null, "Ran ", totalTestCount, " ", totalTestCount === 1 ? "test" : "tests", " ", React2.createElement(RelativeTime, { timestamp: finishedAt }));
|
|
516
|
+
} else if (storeState.watching) {
|
|
517
|
+
description = "Watching for file changes";
|
|
518
|
+
}
|
|
369
519
|
return React2.createElement(Wrapper, { ...props }, description);
|
|
370
520
|
}
|
|
521
|
+
__name(Description, "Description");
|
|
371
522
|
|
|
372
523
|
// src/components/TestStatusIcon.tsx
|
|
373
524
|
import { styled as styled3 } from "storybook/theming";
|
|
@@ -408,38 +559,53 @@ var TestStatusIcon = styled3.div(
|
|
|
408
559
|
var Container = styled4.div({
|
|
409
560
|
display: "flex",
|
|
410
561
|
flexDirection: "column"
|
|
411
|
-
})
|
|
562
|
+
});
|
|
563
|
+
var Heading = styled4.div({
|
|
412
564
|
display: "flex",
|
|
413
565
|
justifyContent: "space-between",
|
|
414
566
|
padding: "8px 0",
|
|
415
567
|
gap: 12
|
|
416
|
-
})
|
|
568
|
+
});
|
|
569
|
+
var Info = styled4.div({
|
|
417
570
|
display: "flex",
|
|
418
571
|
flexDirection: "column",
|
|
419
572
|
marginLeft: 8,
|
|
420
573
|
minWidth: 0
|
|
421
|
-
})
|
|
574
|
+
});
|
|
575
|
+
var Title = styled4.div(({ crashed, theme }) => ({
|
|
422
576
|
fontSize: theme.typography.size.s1,
|
|
423
577
|
fontWeight: crashed ? "bold" : "normal",
|
|
424
578
|
color: crashed ? theme.color.negativeText : theme.color.defaultText
|
|
425
|
-
}))
|
|
579
|
+
}));
|
|
580
|
+
var Actions = styled4.div({
|
|
426
581
|
display: "flex",
|
|
427
582
|
gap: 4
|
|
428
|
-
})
|
|
583
|
+
});
|
|
584
|
+
var Extras = styled4.div({
|
|
429
585
|
marginBottom: 2
|
|
430
|
-
})
|
|
586
|
+
});
|
|
587
|
+
var Muted = styled4.span(({ theme }) => ({
|
|
431
588
|
color: theme.textMutedColor
|
|
432
|
-
}))
|
|
589
|
+
}));
|
|
590
|
+
var Progress = styled4(ProgressSpinner)({
|
|
433
591
|
margin: 4
|
|
434
|
-
})
|
|
592
|
+
});
|
|
593
|
+
var Row = styled4.div({
|
|
435
594
|
display: "flex",
|
|
436
595
|
gap: 4
|
|
437
|
-
})
|
|
596
|
+
});
|
|
597
|
+
var StopIcon = styled4(StopAltIcon)({
|
|
438
598
|
width: 10
|
|
439
|
-
})
|
|
440
|
-
|
|
441
|
-
story
|
|
442
|
-
|
|
599
|
+
});
|
|
600
|
+
var openPanel = /* @__PURE__ */ __name(({ api, panelId, entryId }) => {
|
|
601
|
+
const story = entryId ? api.findAllLeafStoryIds(entryId)[0] : void 0;
|
|
602
|
+
if (story) {
|
|
603
|
+
api.selectStory(story);
|
|
604
|
+
}
|
|
605
|
+
api.setSelectedPanel(panelId);
|
|
606
|
+
api.togglePanel(true);
|
|
607
|
+
}, "openPanel");
|
|
608
|
+
var TestProviderRender = /* @__PURE__ */ __name(({
|
|
443
609
|
api,
|
|
444
610
|
entry,
|
|
445
611
|
testProviderState,
|
|
@@ -450,7 +616,13 @@ var Container = styled4.div({
|
|
|
450
616
|
isSettingsUpdated,
|
|
451
617
|
...props
|
|
452
618
|
}) => {
|
|
453
|
-
|
|
619
|
+
const { config, watching, cancelling, currentRun, fatalError } = storeState;
|
|
620
|
+
const finishedTestCount = currentRun.componentTestCount.success + currentRun.componentTestCount.error;
|
|
621
|
+
const hasA11yAddon = addons.experimental_getRegisteredAddons().includes(ADDON_ID);
|
|
622
|
+
const isRunning = testProviderState === "test-provider-state:running";
|
|
623
|
+
const isStarting = isRunning && finishedTestCount === 0;
|
|
624
|
+
const [componentTestStatusIcon, componentTestStatusLabel] = fatalError ? ["critical", "Component tests crashed"] : componentTestStatusValueToStoryIds["status-value:error"].length > 0 ? ["negative", "Component tests failed"] : isRunning ? ["unknown", "Testing in progress"] : componentTestStatusValueToStoryIds["status-value:success"].length > 0 ? ["positive", "Component tests passed"] : ["unknown", "Run tests to see results"];
|
|
625
|
+
const [a11yStatusIcon, a11yStatusLabel] = fatalError ? ["critical", "Component tests crashed"] : a11yStatusValueToStoryIds["status-value:error"].length > 0 ? ["negative", "Accessibility tests failed"] : a11yStatusValueToStoryIds["status-value:warning"].length > 0 ? ["warning", "Accessibility tests failed"] : isRunning ? ["unknown", "Testing in progress"] : a11yStatusValueToStoryIds["status-value:success"].length > 0 ? ["positive", "Accessibility tests passed"] : ["unknown", "Run tests to see accessibility results"];
|
|
454
626
|
return React3.createElement(Container, { ...props }, React3.createElement(Heading, null, React3.createElement(Info, null, entry ? React3.createElement(Title, { id: "testing-module-title" }, "Run component tests") : React3.createElement(
|
|
455
627
|
Title,
|
|
456
628
|
{
|
|
@@ -513,7 +685,10 @@ var Container = styled4.div({
|
|
|
513
685
|
variant: "ghost",
|
|
514
686
|
onClick: () => {
|
|
515
687
|
let storyIds;
|
|
516
|
-
|
|
688
|
+
if (entry) {
|
|
689
|
+
storyIds = entry.type === "story" ? [entry.id] : api.findAllLeafStoryIds(entry.id);
|
|
690
|
+
}
|
|
691
|
+
store.send({
|
|
517
692
|
type: "TRIGGER_RUN",
|
|
518
693
|
payload: { storyIds, triggeredBy: entry?.type ?? "global" }
|
|
519
694
|
});
|
|
@@ -525,7 +700,7 @@ var Container = styled4.div({
|
|
|
525
700
|
{
|
|
526
701
|
as: "label",
|
|
527
702
|
title: "Interactions",
|
|
528
|
-
icon: entry ? null : React3.createElement(Form.Checkbox, { checked:
|
|
703
|
+
icon: entry ? null : React3.createElement(Form.Checkbox, { checked: true, disabled: true })
|
|
529
704
|
}
|
|
530
705
|
), React3.createElement(
|
|
531
706
|
Button2,
|
|
@@ -569,14 +744,14 @@ var Container = styled4.div({
|
|
|
569
744
|
padding: "small",
|
|
570
745
|
size: "medium",
|
|
571
746
|
variant: "ghost",
|
|
572
|
-
disabled:
|
|
573
|
-
ariaLabel: watching ?
|
|
747
|
+
disabled: true,
|
|
748
|
+
ariaLabel: watching ? `Coverage unavailable in watch mode` : `Coverage unavailable when running focused tests`
|
|
574
749
|
},
|
|
575
750
|
React3.createElement(InfoIcon, null)
|
|
576
751
|
) : currentRun.coverageSummary ? React3.createElement(
|
|
577
752
|
Button2,
|
|
578
753
|
{
|
|
579
|
-
asChild:
|
|
754
|
+
asChild: true,
|
|
580
755
|
padding: "small",
|
|
581
756
|
size: "medium",
|
|
582
757
|
variant: "ghost",
|
|
@@ -600,7 +775,7 @@ var Container = styled4.div({
|
|
|
600
775
|
padding: "small",
|
|
601
776
|
size: "medium",
|
|
602
777
|
variant: "ghost",
|
|
603
|
-
disabled:
|
|
778
|
+
disabled: true,
|
|
604
779
|
ariaLabel: isRunning ? "Coverage unavailable, testing still in progress" : fatalError ? "Coverage unavailable, component tests crashed" : "Coverage unavailable, run tests first"
|
|
605
780
|
},
|
|
606
781
|
React3.createElement(
|
|
@@ -646,11 +821,11 @@ var Container = styled4.div({
|
|
|
646
821
|
React3.createElement(TestStatusIcon, { status: a11yStatusIcon, isRunning }),
|
|
647
822
|
a11yStatusValueToStoryIds["status-value:error"].length + a11yStatusValueToStoryIds["status-value:warning"].length || null
|
|
648
823
|
))));
|
|
649
|
-
};
|
|
824
|
+
}, "TestProviderRender");
|
|
650
825
|
|
|
651
826
|
// src/components/SidebarContextMenu.tsx
|
|
652
|
-
var SidebarContextMenu = ({ context, api }) => {
|
|
653
|
-
|
|
827
|
+
var SidebarContextMenu = /* @__PURE__ */ __name(({ context, api }) => {
|
|
828
|
+
const {
|
|
654
829
|
testProviderState,
|
|
655
830
|
componentTestStatusValueToStoryIds,
|
|
656
831
|
a11yStatusValueToStoryIds,
|
|
@@ -668,37 +843,44 @@ var SidebarContextMenu = ({ context, api }) => {
|
|
|
668
843
|
a11yStatusValueToStoryIds,
|
|
669
844
|
storeState,
|
|
670
845
|
setStoreState,
|
|
671
|
-
isSettingsUpdated:
|
|
846
|
+
isSettingsUpdated: false
|
|
672
847
|
}
|
|
673
848
|
);
|
|
674
|
-
};
|
|
849
|
+
}, "SidebarContextMenu");
|
|
675
850
|
|
|
676
851
|
// src/manager.tsx
|
|
677
852
|
addons2.register(ADDON_ID2, (api) => {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
853
|
+
const storybookBuilder = globalThis.STORYBOOK_BUILDER || "";
|
|
854
|
+
if (storybookBuilder.includes("vite")) {
|
|
855
|
+
const openPanel2 = /* @__PURE__ */ __name((panelId) => {
|
|
856
|
+
api.setSelectedPanel(panelId);
|
|
857
|
+
api.togglePanel(true);
|
|
858
|
+
}, "openPanel");
|
|
682
859
|
componentTestStatusStore.onSelect(() => {
|
|
683
860
|
openPanel2(PANEL_ID);
|
|
684
|
-
})
|
|
861
|
+
});
|
|
862
|
+
a11yStatusStore.onSelect(() => {
|
|
685
863
|
openPanel2(PANEL_ID2);
|
|
686
|
-
})
|
|
864
|
+
});
|
|
865
|
+
testProviderStore.onRunAll(() => {
|
|
687
866
|
store.send({
|
|
688
867
|
type: "TRIGGER_RUN",
|
|
689
868
|
payload: {
|
|
690
869
|
triggeredBy: "run-all"
|
|
691
870
|
}
|
|
692
871
|
});
|
|
693
|
-
})
|
|
872
|
+
});
|
|
873
|
+
store.untilReady().then(() => {
|
|
694
874
|
store.setState((state) => ({
|
|
695
875
|
...state,
|
|
696
876
|
indexUrl: new URL("index.json", window.location.href).toString()
|
|
697
877
|
}));
|
|
698
|
-
})
|
|
878
|
+
});
|
|
879
|
+
addons2.add(TEST_PROVIDER_ID, {
|
|
699
880
|
type: Addon_TypesEnum.experimental_TEST_PROVIDER,
|
|
700
|
-
render: () => {
|
|
701
|
-
|
|
881
|
+
render: /* @__PURE__ */ __name(() => {
|
|
882
|
+
const [isModalOpen, setModalOpen] = useState3(false);
|
|
883
|
+
const {
|
|
702
884
|
storeState,
|
|
703
885
|
setStoreState,
|
|
704
886
|
testProviderState,
|
|
@@ -722,7 +904,8 @@ addons2.register(ADDON_ID2, (api) => {
|
|
|
722
904
|
{
|
|
723
905
|
storeState,
|
|
724
906
|
onRerun: () => {
|
|
725
|
-
setModalOpen(
|
|
907
|
+
setModalOpen(false);
|
|
908
|
+
store.send({
|
|
726
909
|
type: "TRIGGER_RUN",
|
|
727
910
|
payload: {
|
|
728
911
|
triggeredBy: "global"
|
|
@@ -731,8 +914,16 @@ addons2.register(ADDON_ID2, (api) => {
|
|
|
731
914
|
}
|
|
732
915
|
}
|
|
733
916
|
));
|
|
734
|
-
},
|
|
735
|
-
sidebarContextMenu: ({ context }) =>
|
|
917
|
+
}, "render"),
|
|
918
|
+
sidebarContextMenu: /* @__PURE__ */ __name(({ context }) => {
|
|
919
|
+
if (context.type === "docs") {
|
|
920
|
+
return null;
|
|
921
|
+
}
|
|
922
|
+
if (context.type === "story" && !context.tags.includes("test")) {
|
|
923
|
+
return null;
|
|
924
|
+
}
|
|
925
|
+
return React5.createElement(SidebarContextMenu, { context, api });
|
|
926
|
+
}, "sidebarContextMenu")
|
|
736
927
|
});
|
|
737
928
|
}
|
|
738
929
|
});
|