Skip to content

Commit

Permalink
Initial failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceharris committed Dec 6, 2017
1 parent a59ed19 commit 46ff6b4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/LoadingIndicator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

export default class LoadingIndicator extends Component {
render() {
return null;
}
}

LoadingIndicator.propTypes = {
isLoading: PropTypes.bool.isRequired,
};
17 changes: 17 additions & 0 deletions src/components/LoadingIndicator.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { mount } from 'enzyme';
import LoadingIndicator from './LoadingIndicator'

describe('LoadingIndicator', () => {
describe('when isLoading is false', () => {
it('should render children', () => {
const wrapper = mount(
<LoadingIndicator isLoading={false}>
<div>ahoy!</div>
</LoadingIndicator>
);
expect(wrapper.html()).toEqual('<div>ahoy!</div>')
wrapper.unmount();
});
});
});

0 comments on commit 46ff6b4

Please sign in to comment.