UNPKG

wix-storybook-utils

Version:

Utilities for automated component documentation within Storybook

27 lines (21 loc) 665 B
import { extractTabs } from './extract-tabs'; import * as Section from './'; describe('extractTabs()', () => { it('should extract tab names from TabSection and return array', () => { const expectedTabs = ['first tab', 'second tab']; const 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(extractTabs(section)).toEqual(expectedTabs); }); });