Skip to content

Commit

Permalink
[Tests] failing test for memoized component display names
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavovnicius authored and ljharb committed May 24, 2019
1 parent 6fa7e64 commit 3ab8035
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/enzyme-test-suite/test/adapter-utils-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ describe('enzyme-adapter-utils', () => {
expect(displayNameOfNode(<Foo />)).to.equal('CustomWrapper');
});
});

describeIf(is('>= 16.6'), 'stateless memoized function components', () => {
it('returns the displayName', () => {
const Foo = Object.assign(React.memo(() => <div />), { displayName: 'Memoized(CustomWrapper)' });

expect(displayNameOfNode(<Foo />)).to.equal('Memoized(CustomWrapper)');
});
});
});

describe('given a node without displayName', () => {
Expand Down

0 comments on commit 3ab8035

Please sign in to comment.