@@ -12,7 +12,7 @@ describe("ReCAPTCHA", function () {
1212
1313 it ( "Rendered Component should be a div" , function ( ) {
1414 let instance = ReactTestUtils . renderIntoDocument (
15- < ReCAPTCHA siteKey = "xxx" onloadCallbackName = { callbackName } />
15+ < ReCAPTCHA sitekey = "xxx" onloadCallbackName = { callbackName } />
1616 ) ;
1717 assert . equal ( instance . getDOMNode ( ) . nodeName , "DIV" ) ;
1818 } ) ;
@@ -21,29 +21,25 @@ describe("ReCAPTCHA", function () {
2121 className : "TheClassName" ,
2222 id : "superdefinedId" ,
2323 } ;
24- let className = "TheClassName" ;
2524 let instance = ReactTestUtils . renderIntoDocument (
26- < ReCAPTCHA siteKey = "xxx" { ...props } />
25+ < ReCAPTCHA sitekey = "xxx" { ...props } />
2726 ) ;
2827 assert . equal ( instance . getDOMNode ( ) . id , props . id ) ;
2928 assert . match ( instance . getDOMNode ( ) . className , new RegExp ( props . className ) ) ;
3029 } ) ;
3130
32- it ( "should register a callback on the window when grecaptcha is not loaded" , function ( ) {
33- let instance = ReactTestUtils . renderIntoDocument (
34- < ReCAPTCHA siteKey = "xxx" />
35- ) ;
36- assert . isNotNull ( window [ callbackName ] ) ;
37- } ) ;
3831 it ( "should call grecaptcha.render, when it is already loaded" , function ( done ) {
3932 let grecaptchaMock = {
40- render ( ) {
33+ render ( node , options ) {
34+ assert . isNotNull ( node ) ;
35+ assert . equal ( options . sitekey , "xxx" ) ;
4136 done ( ) ;
4237 } ,
4338 } ;
4439 let instance = ReactTestUtils . renderIntoDocument (
45- < ReCAPTCHA siteKey = "xxx" grecaptcha = { grecaptchaMock } />
40+ < ReCAPTCHA sitekey = "xxx" grecaptcha = { grecaptchaMock } />
4641 ) ;
42+ assert . ok ( instance ) ;
4743 } ) ;
4844 it ( "reset, should call grecaptcha.reset with the widget id" , function ( done ) {
4945 let grecaptchaMock = {
@@ -57,7 +53,7 @@ describe("ReCAPTCHA", function () {
5753 } ,
5854 } ;
5955 let instance = ReactTestUtils . renderIntoDocument (
60- < ReCAPTCHA siteKey = "xxx" grecaptcha = { grecaptchaMock } />
56+ < ReCAPTCHA sitekey = "xxx" grecaptcha = { grecaptchaMock } />
6157 ) ;
6258 instance . reset ( ) ;
6359 } ) ;
0 commit comments