|
|
|
@ -8,7 +8,6 @@ var CONFIG = {
|
|
|
|
|
trackjs_app_key: 'trackjs_app_key',
|
|
|
|
|
google_analytics_ua: 'UA-20934186-25',
|
|
|
|
|
google_analytics_domain: 'carto.com',
|
|
|
|
|
hubspot_enabled: true,
|
|
|
|
|
hubspot_token: 'yourtoken',
|
|
|
|
|
fullstoryEnabled: false,
|
|
|
|
|
fullstoryOrg: '',
|
|
|
|
@ -46,7 +45,6 @@ describe('common/vendor_scripts_view', function () {
|
|
|
|
|
googleAnalyticsDomain: 'carto.com',
|
|
|
|
|
googleAnalyticsMemberType: 'FREE',
|
|
|
|
|
googleAnalyticsUa: 'UA-20934186-25',
|
|
|
|
|
hubspotEnabled: false,
|
|
|
|
|
hubspotIds: '{}',
|
|
|
|
|
hubspotToken: 'yourtoken',
|
|
|
|
|
intercomAppId: 'intercom_app_id',
|
|
|
|
@ -70,49 +68,6 @@ describe('common/vendor_scripts_view', function () {
|
|
|
|
|
expect(this.view.$el.html).toHaveBeenCalledWith('<div>foo bar!</div>');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should not render hubspot script if it is not enabled', function () {
|
|
|
|
|
var CONFIG_NO_VENDOR = _.extend(CONFIG, {
|
|
|
|
|
hubspot_enabled: false,
|
|
|
|
|
trackjs_enabled: false,
|
|
|
|
|
google_analytics_ua: null
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var USER_NO_VENDOR = _.extend(USER, {
|
|
|
|
|
intercom: false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.user = new cdb.admin.User(USER_NO_VENDOR);
|
|
|
|
|
|
|
|
|
|
this.view = new VendorScriptsView({
|
|
|
|
|
config: CONFIG_NO_VENDOR,
|
|
|
|
|
assetsVersion: '1.0.0',
|
|
|
|
|
user: this.user
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
spyOn(this.view, 'template');
|
|
|
|
|
|
|
|
|
|
this.view.render();
|
|
|
|
|
|
|
|
|
|
expect(this.view.template).toHaveBeenCalledWith({
|
|
|
|
|
assetsVersion: '1.0.0',
|
|
|
|
|
googleAnalyticsDomain: 'carto.com',
|
|
|
|
|
googleAnalyticsMemberType: 'FREE',
|
|
|
|
|
googleAnalyticsUa: null,
|
|
|
|
|
hubspotEnabled: false,
|
|
|
|
|
hubspotIds: '{}',
|
|
|
|
|
hubspotToken: 'yourtoken',
|
|
|
|
|
intercomAppId: 'intercom_app_id',
|
|
|
|
|
intercomEnabled: false,
|
|
|
|
|
trackjsAppKey: 'trackjs_app_key',
|
|
|
|
|
trackjsCustomer: 'trackjs_customer',
|
|
|
|
|
trackjsEnabled: false,
|
|
|
|
|
fullstoryEnabled: false,
|
|
|
|
|
fullstoryOrg: '',
|
|
|
|
|
userEmail: 'pepe@carto.com',
|
|
|
|
|
userName: 'pepe'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should have no leaks', function () {
|
|
|
|
|
expect(this.view).toHaveNoLeaks();
|
|
|
|
|
});
|
|
|
|
|