happo-plugin-storybook
Advanced tools
Comparing version 3.2.4 to 3.3.0
@@ -25,5 +25,5 @@ import { within, userEvent } from '@storybook/testing-library'; | ||
const canvas = within(canvasElement); | ||
await new Promise((r) => setTimeout(r, 400)); | ||
await new Promise((r) => setTimeout(r, 3000)); | ||
await userEvent.click(canvas.getByRole('button')); | ||
}, | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { setThemeSwitcher } from '../register'; | ||
import { setThemeSwitcher, setRenderTimeoutMs } from '../register'; | ||
@@ -10,1 +10,2 @@ setThemeSwitcher(async (theme, channel) => { | ||
setRenderTimeoutMs(4000); |
{ | ||
"name": "happo-plugin-storybook", | ||
"version": "3.2.4", | ||
"version": "3.3.0", | ||
"description": "A happo.io plugin for projects using Storybook", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,3 @@ "use strict"; | ||
}); | ||
exports.setThemeSwitcher = exports.setDefaultDelay = exports.isHappoRun = void 0; | ||
exports.setThemeSwitcher = exports.setRenderTimeoutMs = exports.setDefaultDelay = exports.isHappoRun = void 0; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
@@ -24,3 +24,3 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var ASYNC_TIMEOUT = 100; | ||
var WAIT_FOR_TIMEOUT = 2000; | ||
var renderTimeoutMs = 2000; | ||
var examples; | ||
@@ -80,3 +80,3 @@ var currentIndex = 0; | ||
duration = time.originalDateNow() - start; | ||
if (!(!waitFor() && duration < WAIT_FOR_TIMEOUT)) { | ||
if (!(!waitFor() && duration < renderTimeoutMs)) { | ||
_context3.next = 4; | ||
@@ -209,3 +209,3 @@ break; | ||
return new Promise(function (resolve) { | ||
var timeout = time.originalSetTimeout(resolve, WAIT_FOR_TIMEOUT); | ||
var timeout = time.originalSetTimeout(resolve, renderTimeoutMs); | ||
function handleRenderPhaseChanged(ev) { | ||
@@ -364,2 +364,6 @@ if (ev.newPhase === 'completed') { | ||
exports.setDefaultDelay = setDefaultDelay; | ||
var setRenderTimeoutMs = function setRenderTimeoutMs(timeoutMs) { | ||
renderTimeoutMs = timeoutMs; | ||
}; | ||
exports.setRenderTimeoutMs = setRenderTimeoutMs; | ||
var setThemeSwitcher = function setThemeSwitcher(func) { | ||
@@ -366,0 +370,0 @@ themeSwitcher = func; |
@@ -9,4 +9,4 @@ const { SB_ROOT_ELEMENT_SELECTOR } = require('./constants'); | ||
const ASYNC_TIMEOUT = 100; | ||
const WAIT_FOR_TIMEOUT = 2000; | ||
let renderTimeoutMs = 2000; | ||
let examples; | ||
@@ -33,3 +33,3 @@ let currentIndex = 0; | ||
const duration = time.originalDateNow() - start; | ||
if (!waitFor() && duration < WAIT_FOR_TIMEOUT) { | ||
if (!waitFor() && duration < renderTimeoutMs) { | ||
return new Promise((resolve) => | ||
@@ -135,3 +135,3 @@ time.originalSetTimeout( | ||
return new Promise((resolve) => { | ||
const timeout = time.originalSetTimeout(resolve, WAIT_FOR_TIMEOUT); | ||
const timeout = time.originalSetTimeout(resolve, renderTimeoutMs); | ||
function handleRenderPhaseChanged(ev) { | ||
@@ -232,2 +232,5 @@ if (ev.newPhase === 'completed') { | ||
}; | ||
export const setRenderTimeoutMs = (timeoutMs) => { | ||
renderTimeoutMs = timeoutMs; | ||
}; | ||
export const setThemeSwitcher = (func) => { | ||
@@ -234,0 +237,0 @@ themeSwitcher = func; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50992
1303