File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ let decoratorConstructor,
15
15
*/
16
16
functionConstructor = ( Component , defaultStyles , options ) => {
17
17
return class extends Component {
18
+ static displayName = Component . displayName ;
19
+
18
20
render ( ) {
19
21
let renderResult ,
20
22
styles ;
Original file line number Diff line number Diff line change @@ -7,6 +7,19 @@ import TestUtils from 'react-addons-test-utils';
7
7
import reactCssModules from './../src/index' ;
8
8
9
9
describe ( 'reactCssModules' , ( ) => {
10
+ context ( 'a ReactComponent is decorated using react-css-modules' , ( ) => {
11
+ it ( 'inherits displayName' , ( ) => {
12
+ let Foo ;
13
+
14
+ Foo = class extends React . Component {
15
+ static displayName = 'Foo' ;
16
+ } ;
17
+
18
+ Foo = reactCssModules ( Foo ) ;
19
+
20
+ expect ( Foo . displayName ) . to . equal ( 'Foo' ) ;
21
+ } ) ;
22
+ } ) ;
10
23
context ( 'a ReactComponent renders an element with the styleName prop' , ( ) => {
11
24
it ( 'that element should contain the equivalent className' , ( ) => {
12
25
let Foo ,
You can’t perform that action at this time.
0 commit comments