Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit bbc844f

Browse files
author
vikasrohit
committed
AS#159623706487509, Remove email subscription logic on members app for landing page after activation
-- removed unit tests as they are not needed now. -- removed unused reference to the user preference service
1 parent c3cb80a commit bbc844f

File tree

2 files changed

+2
-35
lines changed

2 files changed

+2
-35
lines changed

app/skill-picker/skill-picker.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import _ from 'lodash'
66

77
angular.module('tc.skill-picker').controller('SkillPickerController', SkillPickerController)
88

9-
SkillPickerController.$inject = ['$scope', 'CONSTANTS', 'ProfileService', '$state', 'userProfile', 'featuredSkills', 'logger', 'toaster', 'MemberCertService', '$q', 'UserPreferencesService']
9+
SkillPickerController.$inject = ['$scope', 'CONSTANTS', 'ProfileService', '$state', 'userProfile', 'featuredSkills', 'logger', 'toaster', 'MemberCertService', '$q']
1010

11-
function SkillPickerController($scope, CONSTANTS, ProfileService, $state, userProfile, featuredSkills, logger, toaster, MemberCertService, $q, UserPreferencesService) {
11+
function SkillPickerController($scope, CONSTANTS, ProfileService, $state, userProfile, featuredSkills, logger, toaster, MemberCertService, $q) {
1212
var vm = this
1313
vm.ASSET_PREFIX = CONSTANTS.ASSET_PREFIX
1414
vm.IOS_PROGRAM_ID = CONSTANTS.SWIFT_PROGRAM_ID

app/skill-picker/skill-picker.spec.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -138,39 +138,6 @@ describe('Skill Picker Controller', function() {
138138
CONSTANTS.SWIFT_PROGRAM_ID = origSwiftProgId
139139
})
140140

141-
it('should call mailchimp service to add subscription', function() {
142-
expect(vm).to.exist
143-
// getEmailPreferences should always be called
144-
expect(userPrefSvc.getEmailPreferences).to.be.calledOnce
145-
// saveEmailPreferences should be called once if not subscribed
146-
// getEmailPreferences service mock returns null for mockProfile.userId
147-
expect(userPrefSvc.saveEmailPreferences).to.be.calledOnce
148-
})
149-
150-
it('should not call mailchimp service to add subscription', function() {
151-
// reset getEmailPreferences, saveEmailPreferences spy's called count
152-
userPrefSvc.getEmailPreferences.reset()
153-
userPrefSvc.saveEmailPreferences.reset()
154-
var scope = $rootScope.$new()
155-
156-
var profile = angular.copy(mockProfile)
157-
// update userId to return valid object in service mock
158-
profile.userId = 12345
159-
vm = $controller('SkillPickerController', {
160-
$scope: scope,
161-
userProfile: profile,
162-
featuredSkills: [],
163-
$state: state
164-
})
165-
$rootScope.$digest()
166-
expect(vm).to.exist
167-
// getEmailPreferences should always be called
168-
expect(userPrefSvc.getEmailPreferences).to.be.calledOnce
169-
// saveEmailPreferences should not be called if already subscribed
170-
// getEmailPreferences service mock returns valid object for userId 12345
171-
expect(userPrefSvc.saveEmailPreferences).not.to.be.called
172-
})
173-
174141
it('should add skill ', function() {
175142
vm.toggleSkill(409)
176143
expect(vm.mySkills).to.exist.have.length(1)

0 commit comments

Comments
 (0)