Removed hubspot code from other areas

pull/15128/head
Alberto 5 years ago
parent 10ef214b3f
commit 91815cecd1

@ -10,7 +10,6 @@ module CartoGearsApi
include CartoDB::ConfigUtils
include TrackjsHelper
include GoogleAnalyticsHelper
include HubspotHelper
include FrontendConfigHelper
include AppAssetsHelper
include MapsApiHelper

@ -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();
});

@ -10,7 +10,6 @@ const configModelData = {
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: '',
@ -113,55 +112,8 @@ describe('dashboard/components/vendor-scripts/vendor-scripts-view', function ()
}));
});
it('should not render hubspot script if it is not enabled', function () {
const configNoVendor = _.extend(configModelData, {
hubspot_enabled: false,
trackjs_enabled: false,
google_analytics_ua: null
});
const userModelNoVendor = _.extend(userModelData, {
intercom: false
});
userModel = new UserModel(userModelNoVendor);
view = createViewFn({
configModel: new ConfigModel(configNoVendor),
assetsVersion: '1.0.0',
userModel
});
view.render();
expect(view.$el.html).toHaveBeenCalledWith(template({
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: '',
userId: 'user-id',
userAccountType: 'FREE',
userCreatedAtInSeconds: 1528416000,
userEmail: 'pepe@carto.com',
userName: 'pepe',
googleTagManagerId: 'google_tag_manager_id',
userJobRole: 'Developer',
userInTrialPeriod: false
}));
});
it('should not render Google Tag Manager script if its id is not present', function () {
const configNoVendor = _.extend(configModelData, {
hubspot_enabled: false,
trackjs_enabled: false,
google_analytics_ua: null,
google_tag_manager_id: null

Loading…
Cancel
Save