Layout.test.js (800B)
1 /** 2 * React Starter Kit (https://www.reactstarterkit.com/) 3 * 4 * Copyright © 2014-present Kriasoft, LLC. All rights reserved. 5 * 6 * This source code is licensed under the MIT license found in the 7 * LICENSE.txt file in the root directory of this source tree. 8 */ 9 10 /* eslint-env mocha */ 11 /* eslint-disable padded-blocks, no-unused-expressions */ 12 13 import React from 'react'; 14 import { expect } from 'chai'; 15 import { render } from 'enzyme'; 16 import App from '../App'; 17 import Layout from './Layout'; 18 19 describe('Layout', () => { 20 21 it('renders children correctly', () => { 22 const wrapper = render( 23 <App context={{ insertCss: () => {} }}> 24 <Layout> 25 <div className="child" /> 26 </Layout> 27 </App>, 28 ); 29 expect(wrapper.find('div.child').length).to.eq(1); 30 }); 31 32 });