Skip to content

Commit

Permalink
Merge pull request #4 from pluma2/display-name
Browse files Browse the repository at this point in the history
Added missing displayName
  • Loading branch information
gaearon committed Oct 30, 2014
2 parents 20284bd + dca7210 commit 02e6867
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ var React = require('react'),
* });
*/
var DocumentTitle = React.createClass({
displayName: 'DocumentTitle',

propTypes: {
title: PropTypes.string
},
Expand Down
7 changes: 6 additions & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ var expect = require('expect.js'),
DocumentTitle = require('../');

describe('DocumentTitle', function () {
it('has a displayName', function () {
var el = React.createElement(DocumentTitle);
expect(el.type.displayName).to.be.a('string');
expect(el.type.displayName).not.to.be.empty();
});
it('hides itself from the DOM', function () {
var Component = React.createClass({
render: function () {
Expand Down Expand Up @@ -98,4 +103,4 @@ describe('DocumentTitle.rewind', function () {
DocumentTitle.rewind();
expect(DocumentTitle.rewind()).to.equal(undefined);
});
});
});

0 comments on commit 02e6867

Please sign in to comment.