@gechiui/compose
Version:
GeChiUI higher-order components (HOCs).
23 lines (19 loc) • 521 B
JavaScript
/**
* External dependencies
*/
import { render } from 'enzyme';
/**
* Internal dependencies
*/
import withInstanceId from '../';
describe( 'withInstanceId', () => {
const DumpComponent = withInstanceId( ( { instanceId } ) => {
return <div>{ instanceId }</div>;
} );
it( 'should generate a new instanceId for each instance', () => {
const dumb1 = render( <DumpComponent /> );
const dumb2 = render( <DumpComponent /> );
// Unrendered element.
expect( dumb1.text() ).not.toBe( dumb2.text() );
} );
} );