UNPKG

wix-storybook-utils

Version:

Utilities for automated component documentation within Storybook

23 lines (17 loc) 500 B
import React from 'react'; import { mount } from 'enzyme'; import { Option, Code } from './components'; export default class AutoExampleTestkit { constructor(AutoExample) { this.AutoExample = AutoExample; } component; when = { created: props => (this.component = mount(<this.AutoExample {...props} />)), }; get = { options: () => this.component.find(Option), codeBlock: () => this.component.find(Code), exists: selector => this.component.exists(selector), }; }