File tree 3 files changed +13
-3
lines changed
plugins/star-rating/frontend/public/javascripts
e2e/dashboard/feedback/ratings
lib/dashboard/feedback/ratings
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1145
1145
steps : null
1146
1146
} ;
1147
1147
}
1148
- if ( Array . isArray ( this . widget . links ) ) {
1148
+ if ( Array . isArray ( this . widget . links ) && this . widget . links . length ) {
1149
1149
this . widget . links . forEach ( function ( link ) {
1150
1150
if ( link . linkValue . indexOf ( 'term' ) ) {
1151
1151
link . text = "Terms and Conditions" ;
1162
1162
link . linkValue = link . linkValue . replace ( new RegExp ( '[?&]' + CLY_X_INT + '=[^&]*' ) , '' ) . replace ( / [ ? & ] $ / , '' ) ;
1163
1163
} ) ;
1164
1164
this . widget . links = { "link" : this . widget . links , "finalText" : this . widget . finalText } ;
1165
+ this . widget . consent = true ;
1165
1166
}
1166
- if ( ! this . widget . links ) {
1167
+ else {
1167
1168
this . widget . links = {
1168
1169
"link" : [
1169
1170
{
1182
1183
"finalText" : "I agree to the Terms and Conditions and Privacy Policy."
1183
1184
1184
1185
} ;
1186
+ this . widget . consent = false ;
1185
1187
}
1186
1188
if ( ! this . widget . rating_symbol ) {
1187
1189
this . widget . rating_symbol = "emojis" ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ describe('Create New Widget', () => {
16
16
navigationHelpers . goToFeedbackRatingsWidgetsPage ( ) ;
17
17
} ) ;
18
18
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 ( ) {
20
20
widgetsHelpers . clickAddNewWidgetButton ( ) ;
21
21
widgetsHelpers . verifySettingsPageDefaultElements ( ) ;
22
22
widgetsHelpers . typeWidgetName ( "My New Widget" ) ;
@@ -222,6 +222,7 @@ describe('Create New Widget', () => {
222
222
contactViaCheckboxLabelText : widget . contactViaCheckboxLabelText ,
223
223
contactEmail : widgetRate . contactEmail ,
224
224
submitButtonText : widget . submitButtonText ,
225
+ hasAggrementCheckbox : true ,
225
226
selectedMainColor : widget . mainColor ,
226
227
selectedFontColor : widget . FontColor ,
227
228
hasPoweredByLogo : true ,
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ const verifyDemoPageElementsAndRate = ({
54
54
submitButtonText,
55
55
submitButtonColor,
56
56
submitButtonFontColor,
57
+ hasAggrementCheckbox = false ,
57
58
hasPoweredByLogo = true ,
58
59
thankYouMessageText,
59
60
successIconColor
@@ -132,6 +133,12 @@ const verifyDemoPageElementsAndRate = ({
132
133
cy . shouldNotExist ( demoPageElements . LOGO_IMAGE ) ;
133
134
}
134
135
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
+
135
142
cy . clickElement ( demoPageElements . SUBMIT_BUTTON ) ;
136
143
137
144
// cy.window().then((win) => {
You can’t perform that action at this time.
0 commit comments