@@ -15,9 +15,8 @@ describe('extendReactClass', () => {
15
15
16
16
global . window = document . defaultView ;
17
17
} ) ;
18
-
19
18
context ( 'using default styles' , ( ) => {
20
- it ( 'exposes styles through styles property' , ( done ) => {
19
+ it ( 'exposes styles through this.props. styles property' , ( done ) => {
21
20
let Component ,
22
21
styles ;
23
22
@@ -56,9 +55,8 @@ describe('extendReactClass', () => {
56
55
TestUtils . renderIntoDocument ( < Component bar = 'baz' /> ) ;
57
56
} ) ;
58
57
} ) ;
59
-
60
- context ( 'using explicit styles' , ( ) => {
61
- it ( 'exposes styles through styles property' , ( done ) => {
58
+ context ( 'overwriting default styles using "styles" property of the extended component' , ( ) => {
59
+ it ( 'overwrites default styles' , ( done ) => {
62
60
let Component ,
63
61
styles ;
64
62
@@ -73,9 +71,35 @@ describe('extendReactClass', () => {
73
71
foo : 'foo-1'
74
72
} ;
75
73
76
- Component = extendReactClass ( Component ) ;
74
+ Component = extendReactClass ( Component , {
75
+ foo : 'foo-0' ,
76
+ bar : 'bar-0'
77
+ } ) ;
77
78
78
79
TestUtils . renderIntoDocument ( < Component styles = { styles } /> ) ;
79
80
} ) ;
80
81
} ) ;
82
+ context ( 'rendering Component that returns null' , ( ) => {
83
+ it ( 'generates <noscript> element' , ( ) => {
84
+ let Component ,
85
+ component ,
86
+ shallowRenderer ;
87
+
88
+ shallowRenderer = TestUtils . createRenderer ( ) ;
89
+
90
+ Component = class extends React . Component {
91
+ render ( ) {
92
+ null
93
+ }
94
+ } ;
95
+
96
+ Component = extendReactClass ( Component ) ;
97
+
98
+ shallowRenderer . render ( < Component /> ) ;
99
+
100
+ component = shallowRenderer . getRenderOutput ( ) ;
101
+
102
+ expect ( component . type ) . to . equal ( 'noscript' ) ;
103
+ } ) ;
104
+ } ) ;
81
105
} ) ;
0 commit comments