Skip to content

Commit e65ef49

Browse files
committed
tweak unit tests
1 parent 48d0f20 commit e65ef49

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ui/src/app/user/user-update.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,29 +98,30 @@ describe('UserUpdateComponent', () => {
9898
expect(router.navigate).toHaveBeenCalledWith(['/users'])
9999
})
100100

101-
it('should disable salesforceId dropdown on init for non-admin users', () => {
101+
it('should disable salesforceId dropdown on init for existing users', () => {
102102
activatedRoute.data = of({ user: { salesforceId: 'test', id: 'id' } as IUser })
103103
accountService.hasAnyAuthority.and.returnValue(false)
104104
fixture.detectChanges()
105105

106-
expect(component.disableSalesForceIdDD()).toBe(true)
106+
expect(component.isExistentMember).toBe(true)
107107
})
108108

109-
it('should enable salesforceId dropdown for admin users', () => {
109+
it('should enable salesforceId dropdown for new users', () => {
110110
accountService.hasAnyAuthority.and.returnValue(true)
111111
fixture.detectChanges()
112112

113-
expect(component.disableSalesForceIdDD()).toBe(false)
113+
expect(component.isExistentMember).toBe(false)
114114
})
115115

116116
it('should validate non-owners', () => {
117+
activatedRoute.data = of({ user: { salesforceId: 'test', id: 'id' } as IUser })
117118
userService.hasOwner.and.returnValue(of(true))
118119
fixture.detectChanges()
119120

120121
component.editForm.patchValue({ salesforceId: '123', mainContact: false })
121122
component.validateOrgOwners()
122123
expect(component.hasOwner).toBe(false)
123-
expect(component.editForm.get('salesforceId')?.disabled).toBe(false)
124+
expect(component.isExistentMember).toBe(true)
124125
})
125126

126127
it('should validate org owners', () => {
@@ -130,7 +131,6 @@ describe('UserUpdateComponent', () => {
130131
component.editForm.patchValue({ salesforceId: '123', mainContact: true })
131132
component.validateOrgOwners()
132133
expect(component.hasOwner).toBe(true)
133-
expect(component.editForm.get('salesforceId')?.disabled).toBe(true)
134134
})
135135

136136
it('should create new user', () => {

0 commit comments

Comments
 (0)