mirror of
https://github.com/wassname/talk.git
synced 2026-07-19 11:28:50 +08:00
21 lines
608 B
JavaScript
21 lines
608 B
JavaScript
import React from 'react';
|
|
import {shallow} from 'enzyme';
|
|
import {expect} from 'chai';
|
|
import Markdown from '../Markdown';
|
|
|
|
const render = props => shallow(<Markdown {...props} />);
|
|
|
|
describe('Markdown', () => {
|
|
it('should convert Markdown to html', () => {
|
|
const wrapper = render({content: '*test*'});
|
|
const html = wrapper.html();
|
|
expect(html).to.contain('<em>');
|
|
});
|
|
|
|
it('should set target="_parent" for links', () => {
|
|
const wrapper = render({content: '[link](https://coralproject.net)'});
|
|
const html = wrapper.html();
|
|
expect(html).to.contain('target="_parent"');
|
|
});
|
|
});
|