Port form chai to jest

This commit is contained in:
Chi Vinh Le
2017-10-03 21:54:15 +07:00
parent bd83e9e118
commit 33920afc74
3 changed files with 18 additions and 3 deletions
@@ -1,6 +1,5 @@
import React from 'react';
import {shallow} from 'enzyme';
import {expect} from 'chai';
import Markdown from '../Markdown';
const render = (props) => shallow(<Markdown {...props} />);
@@ -9,12 +8,12 @@ describe('Markdown', () => {
it('should convert Markdown to html', () => {
const wrapper = render({content: '*test*'});
const html = wrapper.html();
expect(html).to.contain('<em>');
expect(html).toMatch('<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"');
expect(html).toMatch('target="_parent"');
});
});
@@ -0,0 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`InfoBox renders correctly 1`] = `
<div
className="talk-plugin-infobox-info "
>
<div
dangerouslySetInnerHTML={
Object {
"__html": "<p>test</p>
",
}
}
/>
</div>
`;