Refactored test templates to use inline functions (#276)

Closes #275
This commit is contained in:
Stephan Herzog 2016-08-15 12:37:54 +02:00 committed by GitHub
parent 4f9488cb99
commit 2a2f4cf4df
2 changed files with 7 additions and 7 deletions

View File

@ -9,14 +9,14 @@ import createComponent from 'helpers/shallowRenderHelper';
import <%= component.className %> from '<%= component.webpackPath %>';
describe('<%= component.className %>', () => {
describe('<%= component.className %>', function () {
let component;
beforeEach(() => {
beforeEach(function () {
component = createComponent(<%= component.className %>);
});
it('should have its component name as default className', () => {
it('should have its component name as default className', function () {
expect(component.props.className).to.equal('<%= style.className %>');
});
});

View File

@ -2,16 +2,16 @@ import React from 'react';
import { shallow } from 'enzyme';
import <%= component.className %> from '<%= component.webpackPath %>';
describe('<<%= component.className %> />', () => {
describe('<<%= component.className %> />', function () {
let component;
beforeEach(() => {
beforeEach(function () {
component = shallow(<<%= component.className %> />);
});
describe('when rendering the component', () => {
describe('when rendering the component', function () {
it('should have a className of "<%= style.className %>"', () => {
it('should have a className of "<%= style.className %>"', function () {
expect(component.hasClass('<%= style.className %>')).to.equal(true);
});
});