This repository was archived by the owner on Aug 17, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 206206
207207 /**
208208 * Executes the reCaptcha
209+ * @param widgetId
210+ * @param [action] the action for reCAPTCHA v3
209211 */
210- execute : function ( widgetId ) {
212+ execute : function ( widgetId , action ) {
211213 validateRecaptchaInstance ( ) ;
212214
213- recaptcha . execute ( widgetId ) ;
215+ recaptcha . execute ( widgetId , { action : action } ) ;
214216 } ,
215217
216218 /**
Original file line number Diff line number Diff line change @@ -57,9 +57,9 @@ describe('service', function () {
5757 it ( 'should call execute' , function ( ) {
5858 var _widgetId = 123 ;
5959
60- driver . service . execute ( _widgetId ) ;
60+ driver . service . execute ( _widgetId , 'my-action' ) ;
6161
62- expect ( grecaptchaMock . execute ) . toHaveBeenCalledWith ( _widgetId ) ;
62+ expect ( grecaptchaMock . execute ) . toHaveBeenCalledWith ( _widgetId , { action : 'my-action' } ) ;
6363 } ) ;
6464
6565 it ( 'should call getResponse' , function ( ) {
@@ -163,9 +163,9 @@ describe('service', function () {
163163
164164 var _widgetId = 123 ;
165165
166- driver . service . execute ( _widgetId ) ;
166+ driver . service . execute ( _widgetId , 'my-action' ) ;
167167
168- expect ( grecaptchaMock . execute ) . toHaveBeenCalledWith ( _widgetId ) ;
168+ expect ( grecaptchaMock . execute ) . toHaveBeenCalledWith ( _widgetId , { action : 'my-action' } ) ;
169169 } ) ;
170170
171171 it ( 'should not proceed if render function not available in grecaptcha' , function ( ) {
You can’t perform that action at this time.
0 commit comments