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 Message from './index';

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

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

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

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

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

		return component;
	});
};
