import React from 'react';
import { withKnobs, select } from '@storybook/addon-knobs';
import { mount } from 'enzyme';
import { expect } from 'chai';
import { describe, it, specs } from '../../storybook/facade';
import Toast from './index';

export default (stories) => {
	stories.addDecorator(withKnobs);

	stories.add('Toast', () => {
		const type = select('Toast Type', {
			Error: 'error',
			Info: 'info',
			Success: 'success',
			Warning: 'warning'
		}, 'success');

		const component = (
			<Toast
				content={(
					<>
						This is a <strong>{type}</strong> toast
					</>
				)}
				type={type}
			/>
		);

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

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

		return component;
	});
};
