This commit is contained in:
Gert Hengeveld 2021-09-06 16:56:57 +02:00
parent fcc078bce0
commit 7a74e78fc2
2 changed files with 3 additions and 2 deletions

View File

@ -115,7 +115,7 @@ function patch(method: string, fn: Function, options: Options) {
return patched; return patched;
} }
const initialize = () => { function initialize() {
try { try {
if (!global.window.__STORYBOOK_ADDON_TEST_PREVIEW__) { if (!global.window.__STORYBOOK_ADDON_TEST_PREVIEW__) {
global.window.__STORYBOOK_ADDON_TEST_PREVIEW__ = { global.window.__STORYBOOK_ADDON_TEST_PREVIEW__ = {
@ -145,6 +145,7 @@ const initialize = () => {
iframeState.n = iframeState.callRefsByResult.size; iframeState.n = iframeState.callRefsByResult.size;
iframeState.next = {}; iframeState.next = {};
}); });
initialized = true; initialized = true;
} catch (e) { } catch (e) {
console.warn(e); console.warn(e);

View File

@ -22,7 +22,7 @@ Demo.play = async ({ args }) => {
}; };
export const WaitFor = (args) => ( export const WaitFor = (args) => (
<button onClick={() => setTimeout(() => args.onSubmit('clicked'), 200)}>Click</button> <button onClick={() => setTimeout(() => args.onSubmit('clicked'), 100)}>Click</button>
); );
WaitFor.argTypes = { WaitFor.argTypes = {
onSubmit: { action: true }, onSubmit: { action: true },