diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-11 21:08:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-11 21:08:31 +0300 |
commit | 1a2f754734eb189e371e25e685413808f69a7f2c (patch) | |
tree | 2c97884971f36d9026600897b74364d2e212a109 /spec/frontend/invite_members | |
parent | f1ce71c88c407709987dd4a7b40bdb7596b6baa2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/invite_members')
-rw-r--r-- | spec/frontend/invite_members/components/invite_group_notification_spec.js | 14 | ||||
-rw-r--r-- | spec/frontend/invite_members/components/invite_groups_modal_spec.js | 26 |
2 files changed, 34 insertions, 6 deletions
diff --git a/spec/frontend/invite_members/components/invite_group_notification_spec.js b/spec/frontend/invite_members/components/invite_group_notification_spec.js index 3e6ba6da9f4..1da2e7b705d 100644 --- a/spec/frontend/invite_members/components/invite_group_notification_spec.js +++ b/spec/frontend/invite_members/components/invite_group_notification_spec.js @@ -2,7 +2,7 @@ import { GlAlert, GlLink, GlSprintf } from '@gitlab/ui'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { sprintf } from '~/locale'; import InviteGroupNotification from '~/invite_members/components/invite_group_notification.vue'; -import { GROUP_MODAL_ALERT_BODY } from '~/invite_members/constants'; +import { GROUP_MODAL_TO_GROUP_ALERT_BODY } from '~/invite_members/constants'; describe('InviteGroupNotification', () => { let wrapper; @@ -13,7 +13,11 @@ describe('InviteGroupNotification', () => { const createComponent = () => { wrapper = shallowMountExtended(InviteGroupNotification, { provide: { freeUsersLimit: 5 }, - propsData: { name: 'name' }, + propsData: { + name: 'name', + notificationLink: '_notification_link_', + notificationText: GROUP_MODAL_TO_GROUP_ALERT_BODY, + }, stubs: { GlSprintf }, }); }; @@ -28,15 +32,13 @@ describe('InviteGroupNotification', () => { }); it('shows the correct message', () => { - const message = sprintf(GROUP_MODAL_ALERT_BODY, { count: 5 }); + const message = sprintf(GROUP_MODAL_TO_GROUP_ALERT_BODY, { count: 5 }); expect(findAlert().text()).toMatchInterpolatedText(message); }); it('has a help link', () => { - expect(findLink().attributes('href')).toEqual( - 'https://docs.gitlab.com/ee/user/group/manage.html#share-a-group-with-another-group', - ); + expect(findLink().attributes('href')).toEqual('_notification_link_'); }); }); }); diff --git a/spec/frontend/invite_members/components/invite_groups_modal_spec.js b/spec/frontend/invite_members/components/invite_groups_modal_spec.js index 82b4717fbf1..4f082145562 100644 --- a/spec/frontend/invite_members/components/invite_groups_modal_spec.js +++ b/spec/frontend/invite_members/components/invite_groups_modal_spec.js @@ -12,6 +12,12 @@ import { displaySuccessfulInvitationAlert, reloadOnInvitationSuccess, } from '~/invite_members/utils/trigger_successful_invite_alert'; +import { + GROUP_MODAL_TO_GROUP_ALERT_BODY, + GROUP_MODAL_TO_GROUP_ALERT_LINK, + GROUP_MODAL_TO_PROJECT_ALERT_BODY, + GROUP_MODAL_TO_PROJECT_ALERT_LINK, +} from '~/invite_members/constants'; import { propsData, sharedGroup } from '../mock_data/group_modal'; jest.mock('~/invite_members/utils/trigger_successful_invite_alert'); @@ -91,6 +97,26 @@ describe('InviteGroupsModal', () => { expect(findInviteGroupAlert().exists()).toBe(false); }); + + it('shows the user limit notification alert with correct link and text for group', () => { + createComponent({ freeUserCapEnabled: true }); + + expect(findInviteGroupAlert().props()).toMatchObject({ + name: propsData.name, + notificationText: GROUP_MODAL_TO_GROUP_ALERT_BODY, + notificationLink: GROUP_MODAL_TO_GROUP_ALERT_LINK, + }); + }); + + it('shows the user limit notification alert with correct link and text for project', () => { + createComponent({ freeUserCapEnabled: true, isProject: true }); + + expect(findInviteGroupAlert().props()).toMatchObject({ + name: propsData.name, + notificationText: GROUP_MODAL_TO_PROJECT_ALERT_BODY, + notificationLink: GROUP_MODAL_TO_PROJECT_ALERT_LINK, + }); + }); }); describe('submitting the invite form', () => { |