mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-16 02:29:50 +00:00
Try karmatic! +test reorg
This commit is contained in:
27
test/unit/index.test.js
Normal file
27
test/unit/index.test.js
Normal 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>`
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user