@storybook/test 0.0.0-pr-28483-sha-98ec3d9e → 0.0.0-pr-28483-sha-c6902abe

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.js CHANGED
@@ -175,7 +175,7 @@ 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});async function mouseTo(target,{cursorStyle="hand",delay=1700}){return globalThis.test||!target?new Promise(resolve=>resolve(void 0)):new Promise(resolve=>{let cursorEl=document.getElementById("sb-demo-cursor");if(cursorEl||(cursorEl=document.createElement("div"),cursorEl.id="sb-demo-cursor",cursorEl.dataset.type=cursorStyle,cursorStyle==="hand"&&(cursorEl.innerHTML=`
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});async function mouseTo(target,{cursorStyle="hand",delay=1e3}){return globalThis.test||!target?new Promise(resolve=>resolve(void 0)):new Promise(resolve=>{let cursorEl=document.getElementById("sb-demo-cursor");if(cursorEl||(cursorEl=document.createElement("div"),cursorEl.id="sb-demo-cursor",cursorEl.dataset.type=cursorStyle,cursorStyle==="hand"&&(cursorEl.innerHTML=`
179
179
  <svg width="40" height="40" viewBox="0 0 800 800" fill="none" xmlns="http://www.w3.org/2000/svg">
180
180
  <g clip-path="url(#clip0_16_94)">
181
181
  <path d="M273.5 366L95.5 348L108.5 495.5L301 765L618.5 754L727.5 608L710 348L376.5 220L357 51.5L273.5 38.5V366Z"
@@ -189,4 +189,4 @@ Unable to find an `+(hidden===!1?"accessible ":"")+'element with the role "'+rol
189
189
  <rect width="800" height="800" fill="white" />
190
190
  </clipPath>
191
191
  </defs>
192
- </svg>`),cursorEl.addEventListener("transitionend",()=>{cursorEl&&(cursorEl.className="hide"),target.dispatchEvent(new MouseEvent("mouseover",{view:window,bubbles:!0,cancelable:!0}))},{capture:!0}),document.body.appendChild(cursorEl)),!target.getBoundingClientRect){console.log("target does not have getBoundingClientRect",target);return}(el=>{let rect=el.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)})(target)||target.scrollIntoView({block:"center",inline:"center"}),setTimeout(()=>{let{left,top,width,height}=target.getBoundingClientRect(),sTop=Math.round(top+Math.min(height/2,50))+"px",sLeft=Math.round(left+Math.min(width/2,50))+"px";cursorStyle!=="hand"&&(cursorEl.className="moving"),cursorEl.style.top=sTop,cursorEl.style.left=sLeft,cursorEl.style.transitionDuration=`${Math.round(delay*.9)}ms`,setTimeout(resolve,delay)},300)})}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=>{if(globalThis.HTMLElement&&context.canvasElement instanceof globalThis.HTMLElement){context.canvas=within(context.canvasElement);let user=userEvent2.setup();context.userEvent={...user,click:context.parameters.test?.demoMode?async target=>(await mouseTo(target,{cursorStyle:context.parameters.test?.cursorStyle,delay:context.parameters.test?.demoModeDelay}),user.click(target)):user.click}}};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});
192
+ </svg>`),cursorEl.addEventListener("transitionend",()=>{cursorEl&&(cursorEl.className="sb-cursor-hide"),target.dispatchEvent(new MouseEvent("mouseover",{view:window,bubbles:!0,cancelable:!0}))},{capture:!0}),document.body.appendChild(cursorEl)),!target.getBoundingClientRect){console.log("target does not have getBoundingClientRect",target);return}(el=>{let rect=el.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)})(target)||target.scrollIntoView({block:"center",inline:"center"}),setTimeout(()=>{let{left,top,width,height}=target.getBoundingClientRect(),sTop=Math.round(top+Math.min(height/2,50))+"px",sLeft=Math.round(left+Math.min(width/2,50))+"px";cursorEl.className="",cursorStyle==="circle"&&(cursorEl.className="sb-cursor-moving"),cursorEl.style.top=sTop,cursorEl.style.left=sLeft,cursorEl.style.transitionDuration=`${Math.round(delay*.9)}ms`,setTimeout(resolve,delay)},300)})}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=>{if(globalThis.HTMLElement&&context.canvasElement instanceof globalThis.HTMLElement){context.canvas=within(context.canvasElement);let user=userEvent2.setup({delay:context.parameters.test?.demoMode?50:0});context.userEvent={...user,type:context.parameters.test?.inputDemoMode?async(...params)=>{let[element,text,options]=params;return await mouseTo(element,{cursorStyle:context.parameters.test?.cursorStyle,delay:context.parameters.test?.demoModeDelay}),user.type(element,text,options)}:user.click,click:context.parameters.test?.demoMode?async target=>(await mouseTo(target,{cursorStyle:context.parameters.test?.cursorStyle,delay:context.parameters.test?.demoModeDelay}),user.click(target)):user.click}}};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,7 +179,7 @@ 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});async function mouseTo(target,{cursorStyle="hand",delay=1700}){return globalThis.test||!target?new Promise(resolve=>resolve(void 0)):new Promise(resolve=>{let cursorEl=document.getElementById("sb-demo-cursor");if(cursorEl||(cursorEl=document.createElement("div"),cursorEl.id="sb-demo-cursor",cursorEl.dataset.type=cursorStyle,cursorStyle==="hand"&&(cursorEl.innerHTML=`
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});async function mouseTo(target,{cursorStyle="hand",delay=1e3}){return globalThis.test||!target?new Promise(resolve=>resolve(void 0)):new Promise(resolve=>{let cursorEl=document.getElementById("sb-demo-cursor");if(cursorEl||(cursorEl=document.createElement("div"),cursorEl.id="sb-demo-cursor",cursorEl.dataset.type=cursorStyle,cursorStyle==="hand"&&(cursorEl.innerHTML=`
183
183
  <svg width="40" height="40" viewBox="0 0 800 800" fill="none" xmlns="http://www.w3.org/2000/svg">
184
184
  <g clip-path="url(#clip0_16_94)">
185
185
  <path d="M273.5 366L95.5 348L108.5 495.5L301 765L618.5 754L727.5 608L710 348L376.5 220L357 51.5L273.5 38.5V366Z"
@@ -193,6 +193,6 @@ Unable to find an `+(hidden===!1?"accessible ":"")+'element with the role "'+rol
193
193
  <rect width="800" height="800" fill="white" />
194
194
  </clipPath>
195
195
  </defs>
196
- </svg>`),cursorEl.addEventListener("transitionend",()=>{cursorEl&&(cursorEl.className="hide"),target.dispatchEvent(new MouseEvent("mouseover",{view:window,bubbles:!0,cancelable:!0}));},{capture:!0}),document.body.appendChild(cursorEl)),!target.getBoundingClientRect){console.log("target does not have getBoundingClientRect",target);return}(el=>{let rect=el.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)})(target)||target.scrollIntoView({block:"center",inline:"center"}),setTimeout(()=>{let{left,top,width,height}=target.getBoundingClientRect(),sTop=Math.round(top+Math.min(height/2,50))+"px",sLeft=Math.round(left+Math.min(width/2,50))+"px";cursorStyle!=="hand"&&(cursorEl.className="moving"),cursorEl.style.top=sTop,cursorEl.style.left=sLeft,cursorEl.style.transitionDuration=`${Math.round(delay*.9)}ms`,setTimeout(resolve,delay);},300);})}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=>{if(globalThis.HTMLElement&&context.canvasElement instanceof globalThis.HTMLElement){context.canvas=within(context.canvasElement);let user=userEvent2.setup();context.userEvent={...user,click:context.parameters.test?.demoMode?async target=>(await mouseTo(target,{cursorStyle:context.parameters.test?.cursorStyle,delay:context.parameters.test?.demoModeDelay}),user.click(target)):user.click};}};scope.__STORYBOOK_TEST_LOADERS__=[resetAllMocksLoader,nameSpiesAndWrapActionsInSpies,enhanceContext];scope.__STORYBOOK_TEST_ON_MOCK_CALL__=onMockCall;
196
+ </svg>`),cursorEl.addEventListener("transitionend",()=>{cursorEl&&(cursorEl.className="sb-cursor-hide"),target.dispatchEvent(new MouseEvent("mouseover",{view:window,bubbles:!0,cancelable:!0}));},{capture:!0}),document.body.appendChild(cursorEl)),!target.getBoundingClientRect){console.log("target does not have getBoundingClientRect",target);return}(el=>{let rect=el.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)})(target)||target.scrollIntoView({block:"center",inline:"center"}),setTimeout(()=>{let{left,top,width,height}=target.getBoundingClientRect(),sTop=Math.round(top+Math.min(height/2,50))+"px",sLeft=Math.round(left+Math.min(width/2,50))+"px";cursorEl.className="",cursorStyle==="circle"&&(cursorEl.className="sb-cursor-moving"),cursorEl.style.top=sTop,cursorEl.style.left=sLeft,cursorEl.style.transitionDuration=`${Math.round(delay*.9)}ms`,setTimeout(resolve,delay);},300);})}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=>{if(globalThis.HTMLElement&&context.canvasElement instanceof globalThis.HTMLElement){context.canvas=within(context.canvasElement);let user=userEvent2.setup({delay:context.parameters.test?.demoMode?50:0});context.userEvent={...user,type:context.parameters.test?.inputDemoMode?async(...params)=>{let[element,text,options]=params;return await mouseTo(element,{cursorStyle:context.parameters.test?.cursorStyle,delay:context.parameters.test?.demoModeDelay}),user.type(element,text,options)}:user.click,click:context.parameters.test?.demoMode?async target=>(await mouseTo(target,{cursorStyle:context.parameters.test?.cursorStyle,delay:context.parameters.test?.demoModeDelay}),user.click(target)):user.click};}};scope.__STORYBOOK_TEST_LOADERS__=[resetAllMocksLoader,nameSpiesAndWrapActionsInSpies,enhanceContext];scope.__STORYBOOK_TEST_ON_MOCK_CALL__=onMockCall;
197
197
 
198
198
  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-28483-sha-98ec3d9e",
3
+ "version": "0.0.0-pr-28483-sha-c6902abe",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "storybook"
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@storybook/csf": "0.1.11",
48
- "@storybook/instrumenter": "0.0.0-pr-28483-sha-98ec3d9e",
48
+ "@storybook/instrumenter": "0.0.0-pr-28483-sha-c6902abe",
49
49
  "@testing-library/dom": "10.1.0",
50
50
  "@testing-library/jest-dom": "6.4.5",
51
51
  "@testing-library/user-event": "14.5.2",
@@ -61,7 +61,7 @@
61
61
  "typescript": "^5.3.2"
62
62
  },
63
63
  "peerDependencies": {
64
- "storybook": "^0.0.0-pr-28483-sha-98ec3d9e"
64
+ "storybook": "^0.0.0-pr-28483-sha-c6902abe"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"