@@ -2,21 +2,14 @@ import React from "react";
22import ReactTestUtils from "react/lib/ReactTestUtils" ;
33import ReCAPTCHA from "../src/recaptcha" ;
44
5- describe ( "ReCAPTCHA" , function ( ) {
6- let callbackName = "onloadcallback" ;
7-
8- afterEach ( function ( ) {
9- delete window . grecaptcha ;
10- delete window . callbackName ;
11- } ) ;
12-
13- it ( "Rendered Component should be a div" , function ( ) {
5+ describe ( "ReCAPTCHA" , ( ) => {
6+ it ( "Rendered Component should be a div" , ( ) => {
147 let instance = ReactTestUtils . renderIntoDocument (
15- < ReCAPTCHA sitekey = "xxx" onloadCallbackName = { callbackName } />
8+ < ReCAPTCHA sitekey = "xxx" />
169 ) ;
1710 assert . equal ( instance . getDOMNode ( ) . nodeName , "DIV" ) ;
1811 } ) ;
19- it ( "Rendered Component should contained passed props" , function ( ) {
12+ it ( "Rendered Component should contained passed props" , ( ) => {
2013 let props = {
2114 className : "TheClassName" ,
2215 id : "superdefinedId" ,
@@ -28,7 +21,7 @@ describe("ReCAPTCHA", function () {
2821 assert . match ( instance . getDOMNode ( ) . className , new RegExp ( props . className ) ) ;
2922 } ) ;
3023
31- it ( "should call grecaptcha.render, when it is already loaded" , function ( done ) {
24+ it ( "should call grecaptcha.render, when it is already loaded" , ( done ) => {
3225 let grecaptchaMock = {
3326 render ( node , options ) {
3427 assert . isNotNull ( node ) ;
@@ -41,7 +34,7 @@ describe("ReCAPTCHA", function () {
4134 ) ;
4235 assert . ok ( instance ) ;
4336 } ) ;
44- it ( "reset, should call grecaptcha.reset with the widget id" , function ( done ) {
37+ it ( "reset, should call grecaptcha.reset with the widget id" , ( done ) => {
4538 let grecaptchaMock = {
4639 render ( ) {
4740 return "someWidgetId" ;
@@ -57,7 +50,7 @@ describe("ReCAPTCHA", function () {
5750 ) ;
5851 instance . reset ( ) ;
5952 } ) ;
60- describe ( "Expired" , function ( ) {
53+ describe ( "Expired" , ( ) => {
6154 it ( "should call onChange with null when response is expired" ) ;
6255 it ( "should call onExpired when response is expired" ) ;
6356 } ) ;
0 commit comments