const React = require('react');
const { shallow } = require('enzyme');
const BBCode = require('../lib');
const presetHTML5 = require('../lib/preset-html5');
const Enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-15');
Enzyme.configure({ adapter: new Adapter() });
const renderBBCode = input => shallow(
{input}
).html();
describe('@bbob/react', () => {
test('[b]bolded text[/b]', () => {
const html = renderBBCode('[b]bolded text[/b]');
expect(html).toBe('bolded text')
});
test('[i]italicized text[/i]', () => {
const html = renderBBCode('[i]italicized text[/i]');
expect(html).toBe('italicized text')
});
test('[u]underlined text[/u]', () => {
const html = renderBBCode('[u]underlined text[/u]');
expect(html).toBe('underlined text')
});
test('[s]strikethrough text[/s]', () => {
const html = renderBBCode('[s]strikethrough text[/s]');
expect(html).toBe('strikethrough text')
});
test('[url]https://en.wikipedia.org[/url]', () => {
const html = renderBBCode('[url]https://en.wikipedia.org[/url]');
expect(html).toBe('https://en.wikipedia.org')
});
});