diff options
Diffstat (limited to 'spec/frontend/members/components/action_buttons/user_action_buttons_spec.js')
-rw-r--r-- | spec/frontend/members/components/action_buttons/user_action_buttons_spec.js | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/spec/frontend/members/components/action_buttons/user_action_buttons_spec.js b/spec/frontend/members/components/action_buttons/user_action_buttons_spec.js index 10e451376c8..356df7e7b11 100644 --- a/spec/frontend/members/components/action_buttons/user_action_buttons_spec.js +++ b/spec/frontend/members/components/action_buttons/user_action_buttons_spec.js @@ -13,6 +13,7 @@ describe('UserActionButtons', () => { propsData: { member, isCurrentUser: false, + isInvitedUser: false, ...propsData, }, }); @@ -45,7 +46,9 @@ describe('UserActionButtons', () => { title: 'Remove member', isAccessRequest: false, isInvite: false, - icon: 'remove', + icon: '', + buttonCategory: 'secondary', + buttonText: 'Remove user', userDeletionObstacles: { name: member.user.name, obstacles: parseUserDeletionObstacles(member.user), @@ -129,4 +132,30 @@ describe('UserActionButtons', () => { expect(findRemoveMemberButton().props().memberType).toBe('ProjectMember'); }); }); + + describe('isInvitedUser', () => { + it.each` + isInvitedUser | icon | buttonText | buttonCategory + ${true} | ${'remove'} | ${null} | ${'primary'} + ${false} | ${''} | ${'Remove user'} | ${'secondary'} + `( + 'passes the correct props to remove-member-button when isInvitedUser is $isInvitedUser', + ({ isInvitedUser, icon, buttonText, buttonCategory }) => { + createComponent({ + isInvitedUser, + permissions: { + canRemove: true, + }, + }); + + expect(findRemoveMemberButton().props()).toEqual( + expect.objectContaining({ + icon, + buttonText, + buttonCategory, + }), + ); + }, + ); + }); }); |