Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storybook-addon-specifications

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-addon-specifications - npm Package Compare versions

Comparing version 1.0.16 to 1.1.0

10

dist/manager.js

@@ -12,5 +12,5 @@ 'use strict';

var _storybookAddons = require('@kadira/storybook-addons');
var _addons = require('@storybook/addons');
var _storybookAddons2 = _interopRequireDefault(_storybookAddons);
var _addons2 = _interopRequireDefault(_addons);

@@ -31,9 +31,9 @@ var _Specifications = require('./containers/Specifications');

// interact with the storybook manager. We're not using it in this addon.
_storybookAddons2.default.register(_.ADDON_ID, function (api) {
_addons2.default.register(_.ADDON_ID, function (api) {
// get `channel` from the addon API
var channel = _storybookAddons2.default.getChannel();
var channel = _addons2.default.getChannel();
// addons.addPanel can be used to add a new panel to storybook manager
// The `title` field will be used as the tab title and the `render` field
// will be executed to render the tab content.
_storybookAddons2.default.addPanel(_.PANEL_ID, {
_addons2.default.addPanel(_.PANEL_ID, {
title: 'Specifications',

@@ -40,0 +40,0 @@ render: function render() {

@@ -9,5 +9,5 @@ 'use strict';

var _storybookAddons = require('@kadira/storybook-addons');
var _addons = require('@storybook/addons');
var _storybookAddons2 = _interopRequireDefault(_storybookAddons);
var _addons2 = _interopRequireDefault(_addons);

@@ -26,3 +26,3 @@ var _ = require('./');

var storyName = specs();
var channel = _storybookAddons2.default.getChannel();
var channel = _addons2.default.getChannel();
channel.emit(_.EVENT_ID, { results: results[storyName] });

@@ -29,0 +29,0 @@ }

{
"name": "storybook-addon-specifications",
"version": "1.0.16",
"version": "1.1.0",
"description": "Add tests to your react storybook stories",

@@ -32,5 +32,2 @@ "main": "dist/index.js",

"devDependencies": {
"@kadira/storybook": "^2.2.1",
"@kadira/storybook-addons": "^1.3.1",
"@kadira/storybook-ui": "^3.2.0",
"babel-cli": "^6.11.4",

@@ -43,3 +40,3 @@ "babel-preset-es2015": "^6.9.0",

"expect": "^1.20.2",
"jest": "^19.0.2",
"jest": "^20.0.1",
"json": "^9.0.4",

@@ -52,3 +49,6 @@ "mocha": "^3.0.2",

"react-test-renderer": "^15.3.1",
"rimraf": "^2.5.4"
"rimraf": "^2.5.4",
"@storybook/react": "3.0.0",
"@storybook/ui": "3.0.0",
"@storybook/addons": "3.0.0"
},

@@ -55,0 +55,0 @@ "dependencies": {

@@ -298,5 +298,9 @@ # Specifications Addon [![npm version](https://img.shields.io/npm/v/storybook-addon-specifications.svg)](https://www.npmjs.com/package/storybook-addon-specifications)

>```js
> // choose one of the following
> import { jsdom } from 'jsdom'; // older versions of JSDOM
> import { JSDOM } from 'jsdom'; // newer version
>/**
> *Mocking browser-like DOM
> */
>// old jsdom
>global.document = jsdom('<!doctype html><html><body></body></html>', {

@@ -309,2 +313,16 @@ > headers: {

>});
// new version
>global.document = (new JSDOM('<!doctype html><html><body></body></html>', {
324
> headers: {
325
>   'User-Agent':
326
>   'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)' +
327
>   ' AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.71 Safari/534.24'
328
> }
329
>})).window.document;
>global.window = document.defaultView;

@@ -314,2 +332,20 @@ >global.navigator = global.window.navigator;

or if you are a newer version of jsdom
>```js
>/**
> *Mocking browser-like DOM
> */
>import { JSDOM } from 'jsdom';
>global.document = (new JSDOM('<!doctype html><html><body></body></html>', {
> headers: {
> 'User-Agent':
> 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)' +
> ' AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.71 Safari/534.24'
> }
>})).window.document;
>global.window = document.defaultView;
>global.navigator = global.window.navigator;
>```
#### Hooks and specifics mocha features

@@ -316,0 +352,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc