@@ -5,7 +5,7 @@ import React from 'react';
5
5
import { MemoryRouter } from 'react-router-dom' ;
6
6
import { Factory } from 'rosie' ;
7
7
import { getConfig } from '@edx/frontend-platform' ;
8
- import { sendTrackEvent , sendTrackingLogEvent } from '@edx/frontend-platform/analytics' ;
8
+ import { sendTrackEvent } from '@edx/frontend-platform/analytics' ;
9
9
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth' ;
10
10
import MockAdapter from 'axios-mock-adapter' ;
11
11
import Cookies from 'js-cookie' ;
@@ -1190,80 +1190,6 @@ describe('Outline Tab', () => {
1190
1190
} ) ;
1191
1191
} ) ;
1192
1192
1193
- describe ( 'Upgrade Card' , ( ) => {
1194
- it ( 'renders title when upgrade is available' , async ( ) => {
1195
- await fetchAndRender ( ) ;
1196
- expect ( screen . queryByRole ( 'heading' , { name : 'Pursue a verified certificate' } ) ) . toBeInTheDocument ( ) ;
1197
- } ) ;
1198
-
1199
- it ( 'displays link to upgrade' , async ( ) => {
1200
- await fetchAndRender ( ) ;
1201
- expect ( screen . getByRole ( 'link' , { name : 'Upgrade for $149' } ) ) . toBeInTheDocument ( ) ;
1202
- } ) ;
1203
-
1204
- it ( 'viewing upgrade card sends analytics' , async ( ) => {
1205
- sendTrackEvent . mockClear ( ) ;
1206
- sendTrackingLogEvent . mockClear ( ) ;
1207
- await fetchAndRender ( ) ;
1208
-
1209
- expect ( sendTrackEvent ) . toHaveBeenCalledTimes ( 1 ) ;
1210
- expect ( sendTrackEvent ) . toHaveBeenCalledWith ( 'Promotion Viewed' , {
1211
- org_key : 'edX' ,
1212
- courserun_key : courseId ,
1213
- creative : 'sidebarupsell' ,
1214
- name : 'In-Course Verification Prompt' ,
1215
- position : 'sidebar-message' ,
1216
- promotion_id : 'courseware_verified_certificate_upsell' ,
1217
- } ) ;
1218
-
1219
- expect ( sendTrackingLogEvent ) . toHaveBeenCalledTimes ( 1 ) ;
1220
- expect ( sendTrackingLogEvent ) . toHaveBeenCalledWith ( 'edx.bi.course.upgrade.sidebarupsell.displayed' , {
1221
- org_key : 'edX' ,
1222
- courserun_key : courseId ,
1223
- } ) ;
1224
- } ) ;
1225
-
1226
- it ( 'clicking upgrade link sends analytics' , async ( ) => {
1227
- await fetchAndRender ( ) ;
1228
-
1229
- // Clearing after render to remove any events sent on view (ex. 'Promotion Viewed')
1230
- sendTrackEvent . mockClear ( ) ;
1231
- sendTrackingLogEvent . mockClear ( ) ;
1232
- const upgradeButton = screen . getByRole ( 'link' , { name : 'Upgrade for $149' } ) ;
1233
-
1234
- fireEvent . click ( upgradeButton ) ;
1235
-
1236
- expect ( sendTrackEvent ) . toHaveBeenCalledTimes ( 2 ) ;
1237
- expect ( sendTrackEvent ) . toHaveBeenNthCalledWith ( 1 , 'Promotion Clicked' , {
1238
- org_key : 'edX' ,
1239
- courserun_key : courseId ,
1240
- creative : 'sidebarupsell' ,
1241
- name : 'In-Course Verification Prompt' ,
1242
- position : 'sidebar-message' ,
1243
- promotion_id : 'courseware_verified_certificate_upsell' ,
1244
- } ) ;
1245
- expect ( sendTrackEvent ) . toHaveBeenNthCalledWith ( 2 , 'edx.bi.ecommerce.upsell_links_clicked' , {
1246
- org_key : 'edX' ,
1247
- courserun_key : courseId ,
1248
- linkCategory : 'green_upgrade' ,
1249
- linkName : 'course_home_green' ,
1250
- linkType : 'button' ,
1251
- pageName : 'course_home' ,
1252
- } ) ;
1253
-
1254
- expect ( sendTrackingLogEvent ) . toHaveBeenCalledTimes ( 2 ) ;
1255
- expect ( sendTrackingLogEvent ) . toHaveBeenNthCalledWith ( 1 , 'edx.bi.course.upgrade.sidebarupsell.clicked' , {
1256
- org_key : 'edX' ,
1257
- courserun_key : courseId ,
1258
- } ) ;
1259
- expect ( sendTrackingLogEvent ) . toHaveBeenNthCalledWith ( 2 , 'edx.course.enrollment.upgrade.clicked' , {
1260
- org_key : 'edX' ,
1261
- courserun_key : courseId ,
1262
- location : 'sidebar-message' ,
1263
- } ) ;
1264
- } ) ;
1265
- } ) ;
1266
-
1267
1193
describe ( 'Account Activation Alert' , ( ) => {
1268
1194
beforeEach ( ( ) => {
1269
1195
const intersectionObserverMock = ( ) => ( {
0 commit comments