@storybook/addons
Advanced tools
Comparing version 4.0.0-alpha.8 to 4.0.0-alpha.9
@@ -35,2 +35,6 @@ 'use strict'; | ||
if (parameters && parameters.disable) { | ||
return getStory(context); | ||
} | ||
if (skipIfNoParametersOrOptions && !options && !parameters) { | ||
@@ -37,0 +41,0 @@ return getStory(context); |
{ | ||
"name": "@storybook/addons", | ||
"version": "4.0.0-alpha.8", | ||
"version": "4.0.0-alpha.9", | ||
"description": "Storybook addons store", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@storybook/channels": "4.0.0-alpha.8", | ||
"@storybook/channels": "4.0.0-alpha.9", | ||
"global": "^4.3.2", | ||
@@ -26,0 +26,0 @@ "util-deprecate": "^1.0.2" |
@@ -22,2 +22,6 @@ import deprecate from 'util-deprecate'; | ||
if (parameters && parameters.disable) { | ||
return getStory(context); | ||
} | ||
if (skipIfNoParametersOrOptions && !options && !parameters) { | ||
@@ -24,0 +28,0 @@ return getStory(context); |
@@ -70,3 +70,3 @@ import deprecate from 'util-deprecate'; | ||
it('calls the story directly if neither are supplied and skipIfNoParametersOrOptions is true', () => { | ||
it('calls the story directly if neither options or parameters are supplied and skipIfNoParametersOrOptions is true', () => { | ||
const wrapper = jest.fn(); | ||
@@ -89,2 +89,20 @@ const decorator = makeDecorator({ | ||
it('calls the story directly if the disable parameter is passed to the decorator', () => { | ||
const wrapper = jest.fn(); | ||
const decorator = makeDecorator({ | ||
wrapper, | ||
name: 'test', | ||
parameterName: 'test', | ||
skipIfNoParametersOrOptions: true, | ||
}); | ||
const story = jest.fn(); | ||
const decoratedStory = defaultDecorateStory(story, [decorator]); | ||
const context = { disable: true }; | ||
decoratedStory(context); | ||
expect(wrapper).not.toHaveBeenCalled(); | ||
expect(story).toHaveBeenCalled(); | ||
}); | ||
it('passes options added at story time, but with a deprecation warning', () => { | ||
@@ -91,0 +109,0 @@ deprecatedFns = []; |
17338
405
+ Added@storybook/channels@4.0.0-alpha.9(transitive)
- Removed@storybook/channels@4.0.0-alpha.8(transitive)