storybook-addon-specifications
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -41,5 +41,15 @@ "use strict"; | ||
_this.state = { results: { wrongResults: [], goodResults: [] } }; | ||
_this._listener = function (d) { | ||
return _this.setState({ results: d.results }); | ||
_this.state = { storyName: null, results: { wrongResults: [], goodResults: [] } }; | ||
_this._listener = function (_ref2) { | ||
var asyncResultsUpdate = _ref2.asyncResultsUpdate, | ||
storyName = _ref2.storyName, | ||
results = _ref2.results; | ||
if (asyncResultsUpdate) { | ||
if (storyName === _this.state.storyName) { | ||
_this.setState({ results: results }); | ||
} | ||
} else { | ||
_this.setState({ storyName: storyName, results: results }); | ||
} | ||
}; | ||
@@ -56,3 +66,3 @@ return _this; | ||
this.props.api.onStory(function (data) { | ||
_this2.setState({ results: { wrongResults: [], goodResults: [] } }); | ||
return _this2.setState({ storyName: null, results: { wrongResults: [], goodResults: [] } }); | ||
}); | ||
@@ -59,0 +69,0 @@ } |
@@ -26,3 +26,3 @@ 'use strict'; | ||
var channel = _addons2.default.getChannel(); | ||
channel.emit(_.EVENT_ID, { results: results[storyName] }); | ||
channel.emit(_.EVENT_ID, { storyName: storyName, results: results[storyName] }); | ||
} | ||
@@ -32,11 +32,5 @@ | ||
currentStory = storyName; | ||
results[currentStory] = { | ||
goodResults: [], | ||
wrongResults: [] | ||
}; | ||
results[currentStory] = { goodResults: [], wrongResults: [] }; | ||
func(); | ||
if (afterFunc[currentStory]) afterFunc[currentStory](); | ||
return storyName; | ||
@@ -57,5 +51,5 @@ }; | ||
var emitUpdate = function emitUpdate() { | ||
var emitAsyncResultsUpdate = function emitAsyncResultsUpdate() { | ||
var channel = _addons2.default.getChannel(); | ||
channel.emit(_.EVENT_ID, { results: results[storyName] }); | ||
channel.emit(_.EVENT_ID, { asyncResultsUpdate: true, storyName: storyName, results: results[storyName] }); | ||
}; | ||
@@ -65,3 +59,3 @@ | ||
if (e) pushWrongResult(e);else pushGoodResult(); | ||
emitUpdate(); | ||
emitAsyncResultsUpdate(); | ||
}; | ||
@@ -68,0 +62,0 @@ |
{ | ||
"name": "storybook-addon-specifications", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Add tests to your react storybook stories", | ||
@@ -36,3 +36,3 @@ "main": "dist/index.js", | ||
"babel-preset-stage-0": "^6.5.0", | ||
"chai": "^3.5.0", | ||
"chai": "^4.0.2", | ||
"enzyme": "^2.4.1", | ||
@@ -49,5 +49,5 @@ "expect": "^1.20.2", | ||
"rimraf": "^2.5.4", | ||
"@storybook/react": "3.0.0", | ||
"@storybook/ui": "3.0.0", | ||
"@storybook/addons": "3.0.0" | ||
"@storybook/react": "3.1.5", | ||
"@storybook/ui": "3.1.5", | ||
"@storybook/addons": "3.1.5" | ||
}, | ||
@@ -54,0 +54,0 @@ "dependencies": { |
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
953736
375