mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-01 05:05:25 +08:00
Add test
This commit is contained in:
parent
0e8230c459
commit
868dcedd12
23
addons/info/src/index.test.js
Normal file
23
addons/info/src/index.test.js
Normal file
@ -0,0 +1,23 @@
|
||||
/* global document */
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import AddonInfo, { withInfo } from './';
|
||||
|
||||
describe('addon Info', () => {
|
||||
const story = context =>
|
||||
<div>
|
||||
It's a {context.story} story
|
||||
</div>;
|
||||
const api = {
|
||||
add: (name, fn) => fn({ kind: 'addon_info', story: 'jest_test' }),
|
||||
};
|
||||
it('should render <Info />', () => {
|
||||
const Info = withInfo('Test Info')(story);
|
||||
ReactDOM.render(<Info />, document.createElement('div'));
|
||||
});
|
||||
it('should show deprecation warning', () => {
|
||||
const addWithInfo = AddonInfo.addWithInfo.bind(api);
|
||||
addWithInfo('jest', 'test info', story);
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user