File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
plugins/star-rating/frontend/public/javascripts
e2e/dashboard/feedback/ratings
lib/dashboard/feedback/ratings Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11451145 steps : null
11461146 } ;
11471147 }
1148- if ( Array . isArray ( this . widget . links ) ) {
1148+ if ( Array . isArray ( this . widget . links ) && this . widget . links . length ) {
11491149 this . widget . links . forEach ( function ( link ) {
11501150 if ( link . linkValue . indexOf ( 'term' ) ) {
11511151 link . text = "Terms and Conditions" ;
11621162 link . linkValue = link . linkValue . replace ( new RegExp ( '[?&]' + CLY_X_INT + '=[^&]*' ) , '' ) . replace ( / [ ? & ] $ / , '' ) ;
11631163 } ) ;
11641164 this . widget . links = { "link" : this . widget . links , "finalText" : this . widget . finalText } ;
1165+ this . widget . consent = true ;
11651166 }
1166- if ( ! this . widget . links ) {
1167+ else {
11671168 this . widget . links = {
11681169 "link" : [
11691170 {
11821183 "finalText" : "I agree to the Terms and Conditions and Privacy Policy."
11831184
11841185 } ;
1186+ this . widget . consent = false ;
11851187 }
11861188 if ( ! this . widget . rating_symbol ) {
11871189 this . widget . rating_symbol = "emojis" ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ describe('Create New Widget', () => {
1616 navigationHelpers . goToFeedbackRatingsWidgetsPage ( ) ;
1717 } ) ;
1818
19- it ( 'Verify default values of page and create a widget with that values and then update the widget data' , function ( ) {
19+ it . skip ( 'Verify default values of page and create a widget with that values and then update the widget data' , function ( ) {
2020 widgetsHelpers . clickAddNewWidgetButton ( ) ;
2121 widgetsHelpers . verifySettingsPageDefaultElements ( ) ;
2222 widgetsHelpers . typeWidgetName ( "My New Widget" ) ;
@@ -222,6 +222,7 @@ describe('Create New Widget', () => {
222222 contactViaCheckboxLabelText : widget . contactViaCheckboxLabelText ,
223223 contactEmail : widgetRate . contactEmail ,
224224 submitButtonText : widget . submitButtonText ,
225+ hasAggrementCheckbox : true ,
225226 selectedMainColor : widget . mainColor ,
226227 selectedFontColor : widget . FontColor ,
227228 hasPoweredByLogo : true ,
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ const verifyDemoPageElementsAndRate = ({
5454 submitButtonText,
5555 submitButtonColor,
5656 submitButtonFontColor,
57+ hasAggrementCheckbox = false ,
5758 hasPoweredByLogo = true ,
5859 thankYouMessageText,
5960 successIconColor
@@ -132,6 +133,12 @@ const verifyDemoPageElementsAndRate = ({
132133 cy . shouldNotExist ( demoPageElements . LOGO_IMAGE ) ;
133134 }
134135
136+ if ( hasAggrementCheckbox ) {
137+ cy . contains ( 'label' , 'I agree to the terms and conditions and privacy policy' )
138+ . find ( 'input[type="checkbox"]' )
139+ . click ( ) ;
140+ }
141+
135142 cy . clickElement ( demoPageElements . SUBMIT_BUTTON ) ;
136143
137144 // cy.window().then((win) => {
You can’t perform that action at this time.
0 commit comments