Skip to content

Commit

Permalink
test(reactive): add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypopp committed Jun 26, 2016
1 parent 7231483 commit 1995edd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/reactive/__tests__/reactive-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,40 @@ describe('react-forms/reactive', function() {
let ReactiveClassBased = reactive(ClassBased);
let ReactiveFunctional = reactive(Functional);

it('preserves displayName for class based components', function() {
class X extends React.Component {
render() {
return null;
}
}
assert(reactive(X).displayName === 'X');
});

it('preserves displayName for class based components with custom displayName', function() {
class X extends React.Component {
static displayName = 'Y';
render() {
return null;
}
}
assert(reactive(X).displayName === 'Y');
});

it('preserves displayName for functional components', function() {
function X() {
return null;
}
assert(reactive(X).displayName === 'X');
});

it('preserves displayName for functional components with custom displayName', function() {
function X() {
return null;
}
X.displayName = 'Y';
assert(reactive(X).displayName === 'Y');
});

[ReactiveClassBased, ReactiveFunctional].forEach(function(ReactiveHello) {

describe(ReactiveHello.displayName || ReactiveHello.name, function() {
Expand Down

0 comments on commit 1995edd

Please sign in to comment.