@storybook/test 0.0.0-pr-28418-sha-1934512b → 0.0.0-pr-28385-sha-61d0ddf0
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/index.d.ts +59 -52
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import { AsymmetricMatchersContaining, MatchersObject, MatcherState, JestAssertion, ExpectStatic } from '@vitest/expect';
|
2
2
|
import { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers';
|
3
|
+
import * as domTestingLibrary from '@testing-library/dom';
|
4
|
+
import _userEvent from '@testing-library/user-event';
|
3
5
|
import { spyOn as spyOn$1, fn as fn$1, MaybeMocked, MaybeMockedDeep, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
4
6
|
export * from '@vitest/spy';
|
5
7
|
export { isMockFunction, mocks } from '@vitest/spy';
|
6
|
-
import * as domTestingLibrary from '@testing-library/dom';
|
7
|
-
import _userEvent from '@testing-library/user-event';
|
8
8
|
|
9
9
|
type Promisify<Fn> = Fn extends (...args: infer A) => infer R ? (...args: A) => R extends Promise<any> ? R : Promise<R> : Fn;
|
10
10
|
type PromisifyObject<O> = {
|
@@ -33,56 +33,6 @@ interface Expect extends AsymmetricMatchersContaining {
|
|
33
33
|
not: AsymmetricMatchersContaining;
|
34
34
|
}
|
35
35
|
|
36
|
-
type Listener = (mock: MockInstance, args: unknown[]) => void;
|
37
|
-
declare function onMockCall(callback: Listener): () => void;
|
38
|
-
declare const spyOn: typeof spyOn$1;
|
39
|
-
declare const fn: typeof fn$1;
|
40
|
-
/**
|
41
|
-
* Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function. This will only empty `.mock` state, it will not reset implementation.
|
42
|
-
*
|
43
|
-
* It is useful if you need to clean up mock between different assertions.
|
44
|
-
*/
|
45
|
-
declare function clearAllMocks(): void;
|
46
|
-
/**
|
47
|
-
* Calls [`.mockReset()`](https://vitest.dev/api/mock#mockreset) on every mocked function. This will empty `.mock` state, reset "once" implementations and force the base implementation to return `undefined` when invoked.
|
48
|
-
*
|
49
|
-
* This is useful when you want to completely reset a mock to the default state.
|
50
|
-
*/
|
51
|
-
declare function resetAllMocks(): void;
|
52
|
-
/**
|
53
|
-
* Calls [`.mockRestore()`](https://vitest.dev/api/mock#mockrestore) on every mocked function. This will restore all original implementations.
|
54
|
-
*/
|
55
|
-
declare function restoreAllMocks(): void;
|
56
|
-
/**
|
57
|
-
* Type helper for TypeScript. Just returns the object that was passed.
|
58
|
-
*
|
59
|
-
* When `partial` is `true` it will expect a `Partial<T>` as a return value. By default, this will only make TypeScript believe that
|
60
|
-
* the first level values are mocked. You can pass down `{ deep: true }` as a second argument to tell TypeScript that the whole object is mocked, if it actually is.
|
61
|
-
*
|
62
|
-
* @param item Anything that can be mocked
|
63
|
-
* @param deep If the object is deeply mocked
|
64
|
-
* @param options If the object is partially or deeply mocked
|
65
|
-
*/
|
66
|
-
declare function mocked<T>(item: T, deep?: false): MaybeMocked<T>;
|
67
|
-
declare function mocked<T>(item: T, deep: true): MaybeMockedDeep<T>;
|
68
|
-
declare function mocked<T>(item: T, options: {
|
69
|
-
partial?: false;
|
70
|
-
deep?: false;
|
71
|
-
}): MaybeMocked<T>;
|
72
|
-
declare function mocked<T>(item: T, options: {
|
73
|
-
partial?: false;
|
74
|
-
deep: true;
|
75
|
-
}): MaybeMockedDeep<T>;
|
76
|
-
declare function mocked<T>(item: T, options: {
|
77
|
-
partial: true;
|
78
|
-
deep?: false;
|
79
|
-
}): MaybePartiallyMocked<T>;
|
80
|
-
declare function mocked<T>(item: T, options: {
|
81
|
-
partial: true;
|
82
|
-
deep: true;
|
83
|
-
}): MaybePartiallyMockedDeep<T>;
|
84
|
-
declare function mocked<T>(item: T): MaybeMocked<T>;
|
85
|
-
|
86
36
|
declare const buildQueries: typeof domTestingLibrary.buildQueries;
|
87
37
|
declare const configure: typeof domTestingLibrary.configure;
|
88
38
|
declare const createEvent: domTestingLibrary.CreateObject & domTestingLibrary.CreateFunction;
|
@@ -160,6 +110,63 @@ interface UserEvent extends _UserEvent {
|
|
160
110
|
}
|
161
111
|
declare const userEvent: UserEvent;
|
162
112
|
|
113
|
+
type Listener = (mock: MockInstance, args: unknown[]) => void;
|
114
|
+
declare function onMockCall(callback: Listener): () => void;
|
115
|
+
declare const spyOn: typeof spyOn$1;
|
116
|
+
declare const fn: typeof fn$1;
|
117
|
+
/**
|
118
|
+
* Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function. This will only empty `.mock` state, it will not reset implementation.
|
119
|
+
*
|
120
|
+
* It is useful if you need to clean up mock between different assertions.
|
121
|
+
*/
|
122
|
+
declare function clearAllMocks(): void;
|
123
|
+
/**
|
124
|
+
* Calls [`.mockReset()`](https://vitest.dev/api/mock#mockreset) on every mocked function. This will empty `.mock` state, reset "once" implementations and force the base implementation to return `undefined` when invoked.
|
125
|
+
*
|
126
|
+
* This is useful when you want to completely reset a mock to the default state.
|
127
|
+
*/
|
128
|
+
declare function resetAllMocks(): void;
|
129
|
+
/**
|
130
|
+
* Calls [`.mockRestore()`](https://vitest.dev/api/mock#mockrestore) on every mocked function. This will restore all original implementations.
|
131
|
+
*/
|
132
|
+
declare function restoreAllMocks(): void;
|
133
|
+
/**
|
134
|
+
* Type helper for TypeScript. Just returns the object that was passed.
|
135
|
+
*
|
136
|
+
* When `partial` is `true` it will expect a `Partial<T>` as a return value. By default, this will only make TypeScript believe that
|
137
|
+
* the first level values are mocked. You can pass down `{ deep: true }` as a second argument to tell TypeScript that the whole object is mocked, if it actually is.
|
138
|
+
*
|
139
|
+
* @param item Anything that can be mocked
|
140
|
+
* @param deep If the object is deeply mocked
|
141
|
+
* @param options If the object is partially or deeply mocked
|
142
|
+
*/
|
143
|
+
declare function mocked<T>(item: T, deep?: false): MaybeMocked<T>;
|
144
|
+
declare function mocked<T>(item: T, deep: true): MaybeMockedDeep<T>;
|
145
|
+
declare function mocked<T>(item: T, options: {
|
146
|
+
partial?: false;
|
147
|
+
deep?: false;
|
148
|
+
}): MaybeMocked<T>;
|
149
|
+
declare function mocked<T>(item: T, options: {
|
150
|
+
partial?: false;
|
151
|
+
deep: true;
|
152
|
+
}): MaybeMockedDeep<T>;
|
153
|
+
declare function mocked<T>(item: T, options: {
|
154
|
+
partial: true;
|
155
|
+
deep?: false;
|
156
|
+
}): MaybePartiallyMocked<T>;
|
157
|
+
declare function mocked<T>(item: T, options: {
|
158
|
+
partial: true;
|
159
|
+
deep: true;
|
160
|
+
}): MaybePartiallyMockedDeep<T>;
|
161
|
+
declare function mocked<T>(item: T): MaybeMocked<T>;
|
162
|
+
|
163
|
+
type Queries = ReturnType<typeof within<typeof queries>>;
|
164
|
+
declare module '@storybook/csf' {
|
165
|
+
interface Canvas extends Queries {
|
166
|
+
}
|
167
|
+
interface StoryContext {
|
168
|
+
}
|
169
|
+
}
|
163
170
|
declare const expect: Expect;
|
164
171
|
|
165
172
|
declare const traverseArgs: (value: unknown, depth?: number, key?: string) => unknown;
|
package/dist/index.js
CHANGED
@@ -175,4 +175,4 @@ Unable to find an `+(hidden===!1?"accessible ":"")+'element with the role "'+rol
|
|
175
175
|
`)),string2+=indentedValue+strings[i+1]}),string2}var esm_default=dedent;var testingLibrary=(0,import_instrumenter.instrument)({...dom_esm_exports},{intercept:(method,path)=>path[0]==="fireEvent"||method.startsWith("find")||method.startsWith("waitFor")});testingLibrary.screen=new Proxy(testingLibrary.screen,{get(target,prop,receiver){return import_client_logger.once.warn(esm_default`
|
176
176
|
You are using Testing Library's \`screen\` object. Use \`within(canvasElement)\` instead.
|
177
177
|
More info: https://storybook.js.org/docs/react/essentials/interactions
|
178
|
-
`),Reflect.get(target,prop,receiver)}});var{buildQueries:buildQueries2,configure:configure2,createEvent:createEvent3,fireEvent:fireEvent2,findAllByAltText:findAllByAltText2,findAllByDisplayValue:findAllByDisplayValue2,findAllByLabelText:findAllByLabelText2,findAllByPlaceholderText:findAllByPlaceholderText2,findAllByRole:findAllByRole2,findAllByTestId:findAllByTestId2,findAllByText:findAllByText2,findAllByTitle:findAllByTitle2,findByAltText:findByAltText2,findByDisplayValue:findByDisplayValue2,findByLabelText:findByLabelText2,findByPlaceholderText:findByPlaceholderText2,findByRole:findByRole2,findByTestId:findByTestId2,findByText:findByText2,findByTitle:findByTitle2,getAllByAltText:getAllByAltText2,getAllByDisplayValue:getAllByDisplayValue2,getAllByLabelText:getAllByLabelText2,getAllByPlaceholderText:getAllByPlaceholderText2,getAllByRole:getAllByRole2,getAllByTestId:getAllByTestId2,getAllByText:getAllByText2,getAllByTitle:getAllByTitle2,getByAltText:getByAltText2,getByDisplayValue:getByDisplayValue2,getByLabelText:getByLabelText2,getByPlaceholderText:getByPlaceholderText2,getByRole:getByRole2,getByTestId:getByTestId2,getByText:getByText2,getByTitle:getByTitle2,getConfig:getConfig2,getDefaultNormalizer:getDefaultNormalizer2,getElementError:getElementError2,getNodeText:getNodeText2,getQueriesForElement:getQueriesForElement2,getRoles:getRoles2,getSuggestedQuery:getSuggestedQuery2,isInaccessible:isInaccessible2,logDOM:logDOM2,logRoles:logRoles2,prettyDOM:prettyDOM2,queries:queries2,queryAllByAltText:queryAllByAltText2,queryAllByAttribute:queryAllByAttribute2,queryAllByDisplayValue:queryAllByDisplayValue2,queryAllByLabelText:queryAllByLabelText2,queryAllByPlaceholderText:queryAllByPlaceholderText2,queryAllByRole:queryAllByRole2,queryAllByTestId:queryAllByTestId2,queryAllByText:queryAllByText2,queryAllByTitle:queryAllByTitle2,queryByAltText:queryByAltText2,queryByAttribute:queryByAttribute2,queryByDisplayValue:queryByDisplayValue2,queryByLabelText:queryByLabelText2,queryByPlaceholderText:queryByPlaceholderText2,queryByRole:queryByRole2,queryByTestId:queryByTestId2,queryByText:queryByText2,queryByTitle:queryByTitle2,queryHelpers:queryHelpers2,screen:screen2,waitFor:waitFor2,waitForElementToBeRemoved:waitForElementToBeRemoved2,within,prettyFormat:prettyFormat2}=testingLibrary,{userEvent:userEvent2}=(0,import_instrumenter.instrument)({userEvent},{intercept:!0});var{expect:expect3}=(0,import_instrumenter2.instrument)({expect:expect2},{getKeys:(obj,depth)=>{let privateApi=["assert","__methods","__flags","_obj"];if(obj.constructor===chai_default.Assertion){let keys2=Object.keys(Object.getPrototypeOf(obj)).filter(it=>!privateApi.includes(it));return depth>2?keys2:[...keys2,"not"]}return Object.keys(obj)},intercept:method=>method!=="expect"}),resetAllMocksLoader=({parameters})=>{parameters?.test?.mockReset===!0?resetAllMocks():parameters?.test?.clearMocks===!0?clearAllMocks():parameters?.test?.restoreMocks!==!1&&restoreAllMocks()},traverseArgs=(value,depth=0,key)=>{if(depth>5||value==null)return value;if(isMockFunction(value))return key&&value.mockName(key),value;if(typeof value=="function"&&"isAction"in value&&value.isAction&&!("implicit"in value&&value.implicit)){let mock=fn2(value);return key&&mock.mockName(key),mock}if(Array.isArray(value))return depth++,value.map(item=>traverseArgs(item,depth));if(typeof value=="object"&&value.constructor===Object){depth++;for(let[k,v2]of Object.entries(value))Object.getOwnPropertyDescriptor(value,k)?.writable&&(value[k]=traverseArgs(v2,depth,k));return value}return value},nameSpiesAndWrapActionsInSpies=({initialArgs})=>{traverseArgs(initialArgs)};scope.__STORYBOOK_TEST_LOADERS__=[resetAllMocksLoader,nameSpiesAndWrapActionsInSpies];scope.__STORYBOOK_TEST_ON_MOCK_CALL__=onMockCall;0&&(module.exports={buildQueries,clearAllMocks,configure,createEvent,expect,findAllByAltText,findAllByDisplayValue,findAllByLabelText,findAllByPlaceholderText,findAllByRole,findAllByTestId,findAllByText,findAllByTitle,findByAltText,findByDisplayValue,findByLabelText,findByPlaceholderText,findByRole,findByTestId,findByText,findByTitle,fireEvent,fn,getAllByAltText,getAllByDisplayValue,getAllByLabelText,getAllByPlaceholderText,getAllByRole,getAllByTestId,getAllByText,getAllByTitle,getByAltText,getByDisplayValue,getByLabelText,getByPlaceholderText,getByRole,getByTestId,getByText,getByTitle,getConfig,getDefaultNormalizer,getElementError,getNodeText,getQueriesForElement,getRoles,getSuggestedQuery,isInaccessible,isMockFunction,logDOM,logRoles,mocked,mocks,onMockCall,prettyDOM,prettyFormat,queries,queryAllByAltText,queryAllByAttribute,queryAllByDisplayValue,queryAllByLabelText,queryAllByPlaceholderText,queryAllByRole,queryAllByTestId,queryAllByText,queryAllByTitle,queryByAltText,queryByAttribute,queryByDisplayValue,queryByLabelText,queryByPlaceholderText,queryByRole,queryByTestId,queryByText,queryByTitle,queryHelpers,resetAllMocks,restoreAllMocks,screen,spyOn,traverseArgs,userEvent,waitFor,waitForElementToBeRemoved,within});
|
178
|
+
`),Reflect.get(target,prop,receiver)}});var{buildQueries:buildQueries2,configure:configure2,createEvent:createEvent3,fireEvent:fireEvent2,findAllByAltText:findAllByAltText2,findAllByDisplayValue:findAllByDisplayValue2,findAllByLabelText:findAllByLabelText2,findAllByPlaceholderText:findAllByPlaceholderText2,findAllByRole:findAllByRole2,findAllByTestId:findAllByTestId2,findAllByText:findAllByText2,findAllByTitle:findAllByTitle2,findByAltText:findByAltText2,findByDisplayValue:findByDisplayValue2,findByLabelText:findByLabelText2,findByPlaceholderText:findByPlaceholderText2,findByRole:findByRole2,findByTestId:findByTestId2,findByText:findByText2,findByTitle:findByTitle2,getAllByAltText:getAllByAltText2,getAllByDisplayValue:getAllByDisplayValue2,getAllByLabelText:getAllByLabelText2,getAllByPlaceholderText:getAllByPlaceholderText2,getAllByRole:getAllByRole2,getAllByTestId:getAllByTestId2,getAllByText:getAllByText2,getAllByTitle:getAllByTitle2,getByAltText:getByAltText2,getByDisplayValue:getByDisplayValue2,getByLabelText:getByLabelText2,getByPlaceholderText:getByPlaceholderText2,getByRole:getByRole2,getByTestId:getByTestId2,getByText:getByText2,getByTitle:getByTitle2,getConfig:getConfig2,getDefaultNormalizer:getDefaultNormalizer2,getElementError:getElementError2,getNodeText:getNodeText2,getQueriesForElement:getQueriesForElement2,getRoles:getRoles2,getSuggestedQuery:getSuggestedQuery2,isInaccessible:isInaccessible2,logDOM:logDOM2,logRoles:logRoles2,prettyDOM:prettyDOM2,queries:queries2,queryAllByAltText:queryAllByAltText2,queryAllByAttribute:queryAllByAttribute2,queryAllByDisplayValue:queryAllByDisplayValue2,queryAllByLabelText:queryAllByLabelText2,queryAllByPlaceholderText:queryAllByPlaceholderText2,queryAllByRole:queryAllByRole2,queryAllByTestId:queryAllByTestId2,queryAllByText:queryAllByText2,queryAllByTitle:queryAllByTitle2,queryByAltText:queryByAltText2,queryByAttribute:queryByAttribute2,queryByDisplayValue:queryByDisplayValue2,queryByLabelText:queryByLabelText2,queryByPlaceholderText:queryByPlaceholderText2,queryByRole:queryByRole2,queryByTestId:queryByTestId2,queryByText:queryByText2,queryByTitle:queryByTitle2,queryHelpers:queryHelpers2,screen:screen2,waitFor:waitFor2,waitForElementToBeRemoved:waitForElementToBeRemoved2,within,prettyFormat:prettyFormat2}=testingLibrary,{userEvent:userEvent2}=(0,import_instrumenter.instrument)({userEvent},{intercept:!0});var{expect:expect3}=(0,import_instrumenter2.instrument)({expect:expect2},{getKeys:(obj,depth)=>{let privateApi=["assert","__methods","__flags","_obj"];if(obj.constructor===chai_default.Assertion){let keys2=Object.keys(Object.getPrototypeOf(obj)).filter(it=>!privateApi.includes(it));return depth>2?keys2:[...keys2,"not"]}return Object.keys(obj)},intercept:method=>method!=="expect"}),resetAllMocksLoader=({parameters})=>{parameters?.test?.mockReset===!0?resetAllMocks():parameters?.test?.clearMocks===!0?clearAllMocks():parameters?.test?.restoreMocks!==!1&&restoreAllMocks()},traverseArgs=(value,depth=0,key)=>{if(depth>5||value==null)return value;if(isMockFunction(value))return key&&value.mockName(key),value;if(typeof value=="function"&&"isAction"in value&&value.isAction&&!("implicit"in value&&value.implicit)){let mock=fn2(value);return key&&mock.mockName(key),mock}if(Array.isArray(value))return depth++,value.map(item=>traverseArgs(item,depth));if(typeof value=="object"&&value.constructor===Object){depth++;for(let[k,v2]of Object.entries(value))Object.getOwnPropertyDescriptor(value,k)?.writable&&(value[k]=traverseArgs(v2,depth,k));return value}return value},nameSpiesAndWrapActionsInSpies=({initialArgs})=>{traverseArgs(initialArgs)},enhanceContext=context=>{globalThis.HTMLElement&&context.canvasElement instanceof globalThis.HTMLElement&&(context.canvas=within(context.canvasElement))};scope.__STORYBOOK_TEST_LOADERS__=[resetAllMocksLoader,nameSpiesAndWrapActionsInSpies,enhanceContext];scope.__STORYBOOK_TEST_ON_MOCK_CALL__=onMockCall;0&&(module.exports={buildQueries,clearAllMocks,configure,createEvent,expect,findAllByAltText,findAllByDisplayValue,findAllByLabelText,findAllByPlaceholderText,findAllByRole,findAllByTestId,findAllByText,findAllByTitle,findByAltText,findByDisplayValue,findByLabelText,findByPlaceholderText,findByRole,findByTestId,findByText,findByTitle,fireEvent,fn,getAllByAltText,getAllByDisplayValue,getAllByLabelText,getAllByPlaceholderText,getAllByRole,getAllByTestId,getAllByText,getAllByTitle,getByAltText,getByDisplayValue,getByLabelText,getByPlaceholderText,getByRole,getByTestId,getByText,getByTitle,getConfig,getDefaultNormalizer,getElementError,getNodeText,getQueriesForElement,getRoles,getSuggestedQuery,isInaccessible,isMockFunction,logDOM,logRoles,mocked,mocks,onMockCall,prettyDOM,prettyFormat,queries,queryAllByAltText,queryAllByAttribute,queryAllByDisplayValue,queryAllByLabelText,queryAllByPlaceholderText,queryAllByRole,queryAllByTestId,queryAllByText,queryAllByTitle,queryByAltText,queryByAttribute,queryByDisplayValue,queryByLabelText,queryByPlaceholderText,queryByRole,queryByTestId,queryByText,queryByTitle,queryHelpers,resetAllMocks,restoreAllMocks,screen,spyOn,traverseArgs,userEvent,waitFor,waitForElementToBeRemoved,within});
|
package/dist/index.mjs
CHANGED
@@ -179,6 +179,6 @@ Unable to find an `+(hidden===!1?"accessible ":"")+'element with the role "'+rol
|
|
179
179
|
`)),string2+=indentedValue+strings[i+1];}),string2}var esm_default=dedent;var testingLibrary=instrument({...dom_esm_exports},{intercept:(method,path)=>path[0]==="fireEvent"||method.startsWith("find")||method.startsWith("waitFor")});testingLibrary.screen=new Proxy(testingLibrary.screen,{get(target,prop,receiver){return once.warn(esm_default`
|
180
180
|
You are using Testing Library's \`screen\` object. Use \`within(canvasElement)\` instead.
|
181
181
|
More info: https://storybook.js.org/docs/react/essentials/interactions
|
182
|
-
`),Reflect.get(target,prop,receiver)}});var {buildQueries:buildQueries2,configure:configure2,createEvent:createEvent3,fireEvent:fireEvent2,findAllByAltText:findAllByAltText2,findAllByDisplayValue:findAllByDisplayValue2,findAllByLabelText:findAllByLabelText2,findAllByPlaceholderText:findAllByPlaceholderText2,findAllByRole:findAllByRole2,findAllByTestId:findAllByTestId2,findAllByText:findAllByText2,findAllByTitle:findAllByTitle2,findByAltText:findByAltText2,findByDisplayValue:findByDisplayValue2,findByLabelText:findByLabelText2,findByPlaceholderText:findByPlaceholderText2,findByRole:findByRole2,findByTestId:findByTestId2,findByText:findByText2,findByTitle:findByTitle2,getAllByAltText:getAllByAltText2,getAllByDisplayValue:getAllByDisplayValue2,getAllByLabelText:getAllByLabelText2,getAllByPlaceholderText:getAllByPlaceholderText2,getAllByRole:getAllByRole2,getAllByTestId:getAllByTestId2,getAllByText:getAllByText2,getAllByTitle:getAllByTitle2,getByAltText:getByAltText2,getByDisplayValue:getByDisplayValue2,getByLabelText:getByLabelText2,getByPlaceholderText:getByPlaceholderText2,getByRole:getByRole2,getByTestId:getByTestId2,getByText:getByText2,getByTitle:getByTitle2,getConfig:getConfig2,getDefaultNormalizer:getDefaultNormalizer2,getElementError:getElementError2,getNodeText:getNodeText2,getQueriesForElement:getQueriesForElement2,getRoles:getRoles2,getSuggestedQuery:getSuggestedQuery2,isInaccessible:isInaccessible2,logDOM:logDOM2,logRoles:logRoles2,prettyDOM:prettyDOM2,queries:queries2,queryAllByAltText:queryAllByAltText2,queryAllByAttribute:queryAllByAttribute2,queryAllByDisplayValue:queryAllByDisplayValue2,queryAllByLabelText:queryAllByLabelText2,queryAllByPlaceholderText:queryAllByPlaceholderText2,queryAllByRole:queryAllByRole2,queryAllByTestId:queryAllByTestId2,queryAllByText:queryAllByText2,queryAllByTitle:queryAllByTitle2,queryByAltText:queryByAltText2,queryByAttribute:queryByAttribute2,queryByDisplayValue:queryByDisplayValue2,queryByLabelText:queryByLabelText2,queryByPlaceholderText:queryByPlaceholderText2,queryByRole:queryByRole2,queryByTestId:queryByTestId2,queryByText:queryByText2,queryByTitle:queryByTitle2,queryHelpers:queryHelpers2,screen:screen2,waitFor:waitFor2,waitForElementToBeRemoved:waitForElementToBeRemoved2,within,prettyFormat:prettyFormat2}=testingLibrary,{userEvent:userEvent2}=instrument({userEvent},{intercept:!0});var {expect:expect3}=instrument({expect:expect2},{getKeys:(obj,depth)=>{let privateApi=["assert","__methods","__flags","_obj"];if(obj.constructor===chai_default.Assertion){let keys2=Object.keys(Object.getPrototypeOf(obj)).filter(it=>!privateApi.includes(it));return depth>2?keys2:[...keys2,"not"]}return Object.keys(obj)},intercept:method=>method!=="expect"}),resetAllMocksLoader=({parameters})=>{parameters?.test?.mockReset===!0?resetAllMocks():parameters?.test?.clearMocks===!0?clearAllMocks():parameters?.test?.restoreMocks!==!1&&restoreAllMocks();},traverseArgs=(value,depth=0,key)=>{if(depth>5||value==null)return value;if(isMockFunction(value))return key&&value.mockName(key),value;if(typeof value=="function"&&"isAction"in value&&value.isAction&&!("implicit"in value&&value.implicit)){let mock=fn2(value);return key&&mock.mockName(key),mock}if(Array.isArray(value))return depth++,value.map(item=>traverseArgs(item,depth));if(typeof value=="object"&&value.constructor===Object){depth++;for(let[k,v2]of Object.entries(value))Object.getOwnPropertyDescriptor(value,k)?.writable&&(value[k]=traverseArgs(v2,depth,k));return value}return value},nameSpiesAndWrapActionsInSpies=({initialArgs})=>{traverseArgs(initialArgs);};scope.__STORYBOOK_TEST_LOADERS__=[resetAllMocksLoader,nameSpiesAndWrapActionsInSpies];scope.__STORYBOOK_TEST_ON_MOCK_CALL__=onMockCall;
|
182
|
+
`),Reflect.get(target,prop,receiver)}});var {buildQueries:buildQueries2,configure:configure2,createEvent:createEvent3,fireEvent:fireEvent2,findAllByAltText:findAllByAltText2,findAllByDisplayValue:findAllByDisplayValue2,findAllByLabelText:findAllByLabelText2,findAllByPlaceholderText:findAllByPlaceholderText2,findAllByRole:findAllByRole2,findAllByTestId:findAllByTestId2,findAllByText:findAllByText2,findAllByTitle:findAllByTitle2,findByAltText:findByAltText2,findByDisplayValue:findByDisplayValue2,findByLabelText:findByLabelText2,findByPlaceholderText:findByPlaceholderText2,findByRole:findByRole2,findByTestId:findByTestId2,findByText:findByText2,findByTitle:findByTitle2,getAllByAltText:getAllByAltText2,getAllByDisplayValue:getAllByDisplayValue2,getAllByLabelText:getAllByLabelText2,getAllByPlaceholderText:getAllByPlaceholderText2,getAllByRole:getAllByRole2,getAllByTestId:getAllByTestId2,getAllByText:getAllByText2,getAllByTitle:getAllByTitle2,getByAltText:getByAltText2,getByDisplayValue:getByDisplayValue2,getByLabelText:getByLabelText2,getByPlaceholderText:getByPlaceholderText2,getByRole:getByRole2,getByTestId:getByTestId2,getByText:getByText2,getByTitle:getByTitle2,getConfig:getConfig2,getDefaultNormalizer:getDefaultNormalizer2,getElementError:getElementError2,getNodeText:getNodeText2,getQueriesForElement:getQueriesForElement2,getRoles:getRoles2,getSuggestedQuery:getSuggestedQuery2,isInaccessible:isInaccessible2,logDOM:logDOM2,logRoles:logRoles2,prettyDOM:prettyDOM2,queries:queries2,queryAllByAltText:queryAllByAltText2,queryAllByAttribute:queryAllByAttribute2,queryAllByDisplayValue:queryAllByDisplayValue2,queryAllByLabelText:queryAllByLabelText2,queryAllByPlaceholderText:queryAllByPlaceholderText2,queryAllByRole:queryAllByRole2,queryAllByTestId:queryAllByTestId2,queryAllByText:queryAllByText2,queryAllByTitle:queryAllByTitle2,queryByAltText:queryByAltText2,queryByAttribute:queryByAttribute2,queryByDisplayValue:queryByDisplayValue2,queryByLabelText:queryByLabelText2,queryByPlaceholderText:queryByPlaceholderText2,queryByRole:queryByRole2,queryByTestId:queryByTestId2,queryByText:queryByText2,queryByTitle:queryByTitle2,queryHelpers:queryHelpers2,screen:screen2,waitFor:waitFor2,waitForElementToBeRemoved:waitForElementToBeRemoved2,within,prettyFormat:prettyFormat2}=testingLibrary,{userEvent:userEvent2}=instrument({userEvent},{intercept:!0});var {expect:expect3}=instrument({expect:expect2},{getKeys:(obj,depth)=>{let privateApi=["assert","__methods","__flags","_obj"];if(obj.constructor===chai_default.Assertion){let keys2=Object.keys(Object.getPrototypeOf(obj)).filter(it=>!privateApi.includes(it));return depth>2?keys2:[...keys2,"not"]}return Object.keys(obj)},intercept:method=>method!=="expect"}),resetAllMocksLoader=({parameters})=>{parameters?.test?.mockReset===!0?resetAllMocks():parameters?.test?.clearMocks===!0?clearAllMocks():parameters?.test?.restoreMocks!==!1&&restoreAllMocks();},traverseArgs=(value,depth=0,key)=>{if(depth>5||value==null)return value;if(isMockFunction(value))return key&&value.mockName(key),value;if(typeof value=="function"&&"isAction"in value&&value.isAction&&!("implicit"in value&&value.implicit)){let mock=fn2(value);return key&&mock.mockName(key),mock}if(Array.isArray(value))return depth++,value.map(item=>traverseArgs(item,depth));if(typeof value=="object"&&value.constructor===Object){depth++;for(let[k,v2]of Object.entries(value))Object.getOwnPropertyDescriptor(value,k)?.writable&&(value[k]=traverseArgs(v2,depth,k));return value}return value},nameSpiesAndWrapActionsInSpies=({initialArgs})=>{traverseArgs(initialArgs);},enhanceContext=context=>{globalThis.HTMLElement&&context.canvasElement instanceof globalThis.HTMLElement&&(context.canvas=within(context.canvasElement));};scope.__STORYBOOK_TEST_LOADERS__=[resetAllMocksLoader,nameSpiesAndWrapActionsInSpies,enhanceContext];scope.__STORYBOOK_TEST_ON_MOCK_CALL__=onMockCall;
|
183
183
|
|
184
184
|
export { buildQueries2 as buildQueries, clearAllMocks, configure2 as configure, createEvent3 as createEvent, expect3 as expect, findAllByAltText2 as findAllByAltText, findAllByDisplayValue2 as findAllByDisplayValue, findAllByLabelText2 as findAllByLabelText, findAllByPlaceholderText2 as findAllByPlaceholderText, findAllByRole2 as findAllByRole, findAllByTestId2 as findAllByTestId, findAllByText2 as findAllByText, findAllByTitle2 as findAllByTitle, findByAltText2 as findByAltText, findByDisplayValue2 as findByDisplayValue, findByLabelText2 as findByLabelText, findByPlaceholderText2 as findByPlaceholderText, findByRole2 as findByRole, findByTestId2 as findByTestId, findByText2 as findByText, findByTitle2 as findByTitle, fireEvent2 as fireEvent, fn2 as fn, getAllByAltText2 as getAllByAltText, getAllByDisplayValue2 as getAllByDisplayValue, getAllByLabelText2 as getAllByLabelText, getAllByPlaceholderText2 as getAllByPlaceholderText, getAllByRole2 as getAllByRole, getAllByTestId2 as getAllByTestId, getAllByText2 as getAllByText, getAllByTitle2 as getAllByTitle, getByAltText2 as getByAltText, getByDisplayValue2 as getByDisplayValue, getByLabelText2 as getByLabelText, getByPlaceholderText2 as getByPlaceholderText, getByRole2 as getByRole, getByTestId2 as getByTestId, getByText2 as getByText, getByTitle2 as getByTitle, getConfig2 as getConfig, getDefaultNormalizer2 as getDefaultNormalizer, getElementError2 as getElementError, getNodeText2 as getNodeText, getQueriesForElement2 as getQueriesForElement, getRoles2 as getRoles, getSuggestedQuery2 as getSuggestedQuery, isInaccessible2 as isInaccessible, isMockFunction, logDOM2 as logDOM, logRoles2 as logRoles, mocked, mocks, onMockCall, prettyDOM2 as prettyDOM, prettyFormat2 as prettyFormat, queries2 as queries, queryAllByAltText2 as queryAllByAltText, queryAllByAttribute2 as queryAllByAttribute, queryAllByDisplayValue2 as queryAllByDisplayValue, queryAllByLabelText2 as queryAllByLabelText, queryAllByPlaceholderText2 as queryAllByPlaceholderText, queryAllByRole2 as queryAllByRole, queryAllByTestId2 as queryAllByTestId, queryAllByText2 as queryAllByText, queryAllByTitle2 as queryAllByTitle, queryByAltText2 as queryByAltText, queryByAttribute2 as queryByAttribute, queryByDisplayValue2 as queryByDisplayValue, queryByLabelText2 as queryByLabelText, queryByPlaceholderText2 as queryByPlaceholderText, queryByRole2 as queryByRole, queryByTestId2 as queryByTestId, queryByText2 as queryByText, queryByTitle2 as queryByTitle, queryHelpers2 as queryHelpers, resetAllMocks, restoreAllMocks, screen2 as screen, spyOn2 as spyOn, traverseArgs, userEvent2 as userEvent, waitFor2 as waitFor, waitForElementToBeRemoved2 as waitForElementToBeRemoved, within };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/test",
|
3
|
-
"version": "0.0.0-pr-
|
3
|
+
"version": "0.0.0-pr-28385-sha-61d0ddf0",
|
4
4
|
"description": "",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -44,7 +44,8 @@
|
|
44
44
|
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
45
45
|
},
|
46
46
|
"dependencies": {
|
47
|
-
"@storybook/
|
47
|
+
"@storybook/csf": "0.1.11",
|
48
|
+
"@storybook/instrumenter": "0.0.0-pr-28385-sha-61d0ddf0",
|
48
49
|
"@testing-library/dom": "10.1.0",
|
49
50
|
"@testing-library/jest-dom": "6.4.5",
|
50
51
|
"@testing-library/user-event": "14.5.2",
|
@@ -60,7 +61,7 @@
|
|
60
61
|
"typescript": "^5.3.2"
|
61
62
|
},
|
62
63
|
"peerDependencies": {
|
63
|
-
"storybook": "^0.0.0-pr-
|
64
|
+
"storybook": "^0.0.0-pr-28385-sha-61d0ddf0"
|
64
65
|
},
|
65
66
|
"publishConfig": {
|
66
67
|
"access": "public"
|