import React from '../src';
import assertJsx from 'preact-jsx-chai';
chai.use(assertJsx);
describe('svg', () => {
let scratch;
before(() => {
scratch = document.createElement('div');
(document.body || document.documentElement).appendChild(scratch);
});
beforeEach(() => {
scratch.innerHTML = '';
});
after(() => {
scratch.parentNode.removeChild(scratch);
scratch = null;
});
it('should render SVG to string', () => {
let svg = (
);
// string -> parse
expect(svg).to.eql(svg);
});
it('should render SVG to DOM', () => {
const Demo = () => (
);
React.render(, scratch);
expect(scratch.innerHTML).to.equal('');
});
it('should render SVG to DOM', () => {
React.render((
), scratch);
expect(scratch.innerHTML).to.equal('');
});
});