Skip to content

Commit

Permalink
Add test for querying components wrapped with HOCs
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Dail committed Sep 17, 2017
1 parent 4af7184 commit 3aa0c68
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/enzyme-test-suite/test/selector-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,29 @@ describe('selectors', () => {
expect(wrapper.find('a[href="https://www.foo.com"]')).to.have.lengthOf(1);
expect(wrapper.find('a[href="foo.com"]')).to.have.lengthOf(1);
});

it('parens in displayName', () => {
class Foo extends React.Component {
render() {
return <div />;
}
}
Foo.displayName = 'Wrapped(Foo)';
class Bar extends React.Component {
render() {
return <div />;
}
}
Bar.displayName = 'Wrapped(Twice(Bar))';
const wrapper = renderMethod(
<div>
<Foo />
<Bar />
</div>,
);
expect(wrapper.find('Wrapped(Foo)')).to.have.lengthOf(1);
expect(wrapper.find('Wrapped(Twice(Bar))')).to.have.lengthOf(1);
});
});
});
});

0 comments on commit 3aa0c68

Please sign in to comment.