wix-storybook-utils
Version:
Utilities for automated component documentation within Storybook
25 lines • 974 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var extract_tabs_1 = require("./extract-tabs");
var Section = tslib_1.__importStar(require("./"));
describe('extractTabs()', function () {
it('should extract tab names from TabSection and return array', function () {
var expectedTabs = ['first tab', 'second tab'];
var section = Section.tab({
title: 'root, ignored',
sections: [
Section.tab({
title: expectedTabs[0],
sections: [Section.code({ source: '"hello";' })],
}),
Section.tab({
title: expectedTabs[1],
sections: [Section.code({ source: '"hello";' })],
}),
],
});
expect((0, extract_tabs_1.extractTabs)(section)).toEqual(expectedTabs);
});
});
//# sourceMappingURL=extract-tabs.test.js.map