Last active
October 20, 2016 00:13
-
-
Save stujo/2ebca81383a71c012a22c8ca9f76cd1e to your computer and use it in GitHub Desktop.
Example test from the ReactStarterKit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* React Starter Kit (https://www.reactstarterkit.com/) | |
* | |
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE.txt file in the root directory of this source tree. | |
*/ | |
/* eslint-env mocha */ | |
/* eslint-disable padded-blocks, no-unused-expressions */ | |
import React from 'react'; | |
import { expect } from 'chai'; | |
import { render } from 'enzyme'; | |
import App from '../App'; | |
import Layout from './Layout'; | |
describe('Layout', () => { | |
it('renders children correctly', () => { | |
const wrapper = render( | |
<App context={{ insertCss: () => {} }}> | |
<Layout> | |
<div className="child" /> | |
</Layout> | |
</App> | |
); | |
expect(wrapper.find('div.child').length).to.eq(1); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment