import React from 'react';
import { mount } from 'enzyme';
import { expect } from 'chai';
import { describe, it, specs } from '../../storybook/facade';
import Breadcrumb from './index';

export default (stories) => {
	stories.add('Breadcrumb', () => {
		const path = [
			{
				title: 'Teams'
			},
			{
				title: 'Backlog Change',
			},
			{
				options: [
					{ text: 'Frontend', value: 'fe', active: true },
					{ text: 'Backend', value: 'be' }
				],
				search: true
			}
		];

		const component = (
			<div style={{ padding: 20 }}>
				<Breadcrumb
					path={path}
					onChange={(e, { value }) => {
						console.log(`Switched to ${value}`);
					}}
				/>
			</div>
		);

		specs(() => describe('Breadcrumb', () => {
			const wrapper = mount(component);

			it('Should be ok', () => {
				expect(wrapper).be.ok;
			});
		}));

		return component;
	});
};
