UNPKG

wix-storybook-utils

Version:

Utilities for automated component documentation within Storybook

23 lines 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var react_1 = tslib_1.__importDefault(require("react")); var enzyme_1 = require("enzyme"); var components_1 = require("./components"); var AutoExampleTestkit = /** @class */ (function () { function AutoExampleTestkit(AutoExample) { var _this = this; this.when = { created: function (props) { return (_this.component = (0, enzyme_1.mount)(react_1.default.createElement(_this.AutoExample, tslib_1.__assign({}, props)))); }, }; this.get = { options: function () { return _this.component.find(components_1.Option); }, codeBlock: function () { return _this.component.find(components_1.Code); }, exists: function (selector) { return _this.component.exists(selector); }, }; this.AutoExample = AutoExample; } return AutoExampleTestkit; }()); exports.default = AutoExampleTestkit; //# sourceMappingURL=testkit.js.map