@@ -102,12 +102,12 @@ describe('UserUpdateComponent', () => {
102102 expect ( router . navigate ) . toHaveBeenCalledWith ( [ '/users' ] )
103103 } )
104104
105- it ( 'should disable salesforceId dropdown on init for non-admin users' , ( ) => {
105+ it ( 'should disable salesforceId dropdown on init for existing users' , ( ) => {
106106 activatedRoute . data = of ( { user : { salesforceId : 'test' , id : 'id' } as IUser } )
107107 accountService . hasAnyAuthority . and . returnValue ( false )
108108 fixture . detectChanges ( )
109109
110- expect ( component . disableSalesForceIdDD ( ) ) . toBe ( true )
110+ expect ( component . isExistentMember ) . toBe ( true )
111111 } )
112112
113113 it ( 'should display disable 2fa checkbox for admins when editing an existing user' , ( ) => {
@@ -191,17 +191,18 @@ describe('UserUpdateComponent', () => {
191191 accountService . hasAnyAuthority . and . returnValue ( true )
192192 fixture . detectChanges ( )
193193
194- expect ( component . disableSalesForceIdDD ( ) ) . toBe ( false )
194+ expect ( component . isExistentMember ) . toBe ( false )
195195 } )
196196
197197 it ( 'should validate non-owners' , ( ) => {
198+ activatedRoute . data = of ( { user : { salesforceId : 'test' , id : 'id' } as IUser } )
198199 userService . hasOwner . and . returnValue ( of ( true ) )
199200 fixture . detectChanges ( )
200201
201202 component . editForm . patchValue ( { salesforceId : '123' , mainContact : false } )
202203 component . validateOrgOwners ( )
203204 expect ( component . hasOwner ) . toBe ( false )
204- expect ( component . editForm . get ( 'salesforceId' ) ?. disabled ) . toBe ( false )
205+ expect ( component . isExistentMember ) . toBe ( true )
205206 } )
206207
207208 it ( 'should validate org owners' , ( ) => {
@@ -211,7 +212,6 @@ describe('UserUpdateComponent', () => {
211212 component . editForm . patchValue ( { salesforceId : '123' , mainContact : true } )
212213 component . validateOrgOwners ( )
213214 expect ( component . hasOwner ) . toBe ( true )
214- expect ( component . editForm . get ( 'salesforceId' ) ?. disabled ) . toBe ( true )
215215 } )
216216
217217 it ( 'should create new user' , ( ) => {
0 commit comments