Try karmatic! +test reorg

This commit is contained in:
Jason Miller
2018-06-29 20:12:40 +00:00
parent e9dad3d884
commit 10de559a0c
10 changed files with 3607 additions and 3578 deletions

27
test/unit/index.test.js Normal file
View File

@@ -0,0 +1,27 @@
/* eslint-env jest */
import { h, Component, render } from 'preact';
import App from '../../src/components/app';
describe('<App />', () => {
let scratch;
beforeEach(() => {
scratch = document.createElement('div');
document.body.appendChild(scratch);
});
afterEach(() => {
render(<span />, scratch, scratch.firstChild);
scratch.remove();
});
it('should render', () => {
let app;
render(<App ref={c => { app = c; }} />, scratch);
expect(app instanceof Component).toBe(true);
expect(scratch.innerHTML).toBe(
`<div id="app" class="app__1wROX"><div><h1>Select an image</h1><input type="file"></div></div>`
);
});
});