@@ -8,7 +8,7 @@ import jsdom from 'jsdom';
88import linkClass from './../dist/linkClass' ;
99
1010describe ( 'linkClass' , ( ) => {
11- context ( 'when ReactElement does not define localClassName ' , ( ) => {
11+ context ( 'when ReactElement does not define styleName ' , ( ) => {
1212 it ( 'does not affect element properties' , ( ) => {
1313 expect ( linkClass ( < div > </ div > ) ) . to . deep . equal ( < div > </ div > ) ;
1414 } ) ;
@@ -33,12 +33,12 @@ describe('linkClass', () => {
3333 } ) ;
3434 } ) ;
3535
36- context ( 'when localClassName matches an existing CSS module' , ( ) => {
36+ context ( 'when styleName matches an existing CSS module' , ( ) => {
3737 context ( 'when ReactElement does not have an existing className' , ( ) => {
3838 it ( 'uses the generated class name to set the className property' , ( ) => {
3939 let subject ;
4040
41- subject = < div localClassName = 'foo' > </ div > ;
41+ subject = < div styleName = 'foo' > </ div > ;
4242
4343 subject = linkClass ( subject , {
4444 foo : 'foo-1'
@@ -51,7 +51,7 @@ describe('linkClass', () => {
5151 it ( 'appends the generated class name to the className property' , ( ) => {
5252 let subject ;
5353
54- subject = < div className = 'foo' localClassName = 'bar' > </ div > ;
54+ subject = < div className = 'foo' styleName = 'bar' > </ div > ;
5555
5656 subject = linkClass ( subject , {
5757 bar : 'bar-1'
@@ -67,15 +67,15 @@ describe('linkClass', () => {
6767 context ( 'when false' , ( ) => {
6868 it ( 'throws an error' , ( ) => {
6969 expect ( ( ) => {
70- linkClass ( < div localClassName = 'foo bar' > </ div > , { } , { allowMultiple : false } ) ;
71- } ) . to . throw ( Error , 'ReactElement localClassName property defines multiple module names ("foo bar").' ) ;
70+ linkClass ( < div styleName = 'foo bar' > </ div > , { } , { allowMultiple : false } ) ;
71+ } ) . to . throw ( Error , 'ReactElement styleName property defines multiple module names ("foo bar").' ) ;
7272 } ) ;
7373 } ) ;
7474 context ( 'when true' , ( ) => {
7575 it ( 'appends a generated class name for every referenced CSS module' , ( ) => {
7676 let subject ;
7777
78- subject = < div localClassName = 'foo bar' > </ div > ;
78+ subject = < div styleName = 'foo bar' > </ div > ;
7979
8080 subject = linkClass ( subject , {
8181 foo : 'foo-1' ,
@@ -89,12 +89,12 @@ describe('linkClass', () => {
8989 } ) ;
9090
9191 describe ( 'options.errorWhenNotFound' , ( ) => {
92- context ( 'when localClassName does not match an existing CSS module' , ( ) => {
92+ context ( 'when styleName does not match an existing CSS module' , ( ) => {
9393 context ( 'when false' , ( ) => {
9494 it ( 'ignores the missing CSS module' , ( ) => {
9595 let subject ;
9696
97- subject = < div localClassName = 'foo' > </ div > ;
97+ subject = < div styleName = 'foo' > </ div > ;
9898
9999 subject = linkClass ( subject , { } , { errorWhenNotFound : false } ) ;
100100
@@ -104,7 +104,7 @@ describe('linkClass', () => {
104104 context ( 'when is true' , ( ) => {
105105 it ( 'throws an error' , ( ) => {
106106 expect ( ( ) => {
107- linkClass ( < div localClassName = 'foo' > </ div > , { } , { errorWhenNotFound : true } ) ;
107+ linkClass ( < div styleName = 'foo' > </ div > , { } , { errorWhenNotFound : true } ) ;
108108 } ) . to . throw ( Error , '"foo" CSS module is undefined.' ) ;
109109 } ) ;
110110 } ) ;
@@ -130,11 +130,11 @@ describe('linkClass', () => {
130130
131131 Foo = class extends React . Component {
132132 render ( ) {
133- return < div localClassName = 'foo' > Hello</ div > ;
133+ return < div styleName = 'foo' > Hello</ div > ;
134134 }
135135 } ;
136136
137- nodeList = TestUtils . renderIntoDocument ( linkClass ( < div localClassName = 'foo' > < Foo /> </ div > , { foo : 'foo-1' } ) ) ;
137+ nodeList = TestUtils . renderIntoDocument ( linkClass ( < div styleName = 'foo' > < Foo /> </ div > , { foo : 'foo-1' } ) ) ;
138138 } ) ;
139139 it ( 'processes ReactElement nodes' , ( ) => {
140140 expect ( nodeList . className ) . to . equal ( 'foo-1' ) ;
0 commit comments