Skip to content

Commit e2df051

Browse files
committed
Added passing test from #395
1 parent de81801 commit e2df051

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/components/connect.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,5 +1862,18 @@ describe('React', () => {
18621862

18631863
ReactDOM.unmountComponentAtNode(div)
18641864
})
1865+
1866+
it('should allow custom displayName', () => {
1867+
// TODO remove __ENABLE_SECRET_EXPERIMENTAL_FEATURES_DO_NOT_USE_OR_YOU_WILL_BE_FIRED once approved
1868+
@connect(null, null, null, { getDisplayName: name => `Custom(${name})`, __ENABLE_SECRET_EXPERIMENTAL_FEATURES_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: true })
1869+
class MyComponent extends React.Component {
1870+
render() {
1871+
return <div></div>
1872+
}
1873+
}
1874+
1875+
expect(MyComponent.displayName).toEqual('Custom(MyComponent)')
1876+
})
1877+
18651878
})
18661879
})

0 commit comments

Comments
 (0)