diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/frontend/admin/signup_restrictions | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/frontend/admin/signup_restrictions')
-rw-r--r-- | spec/frontend/admin/signup_restrictions/components/signup_form_spec.js | 40 | ||||
-rw-r--r-- | spec/frontend/admin/signup_restrictions/mock_data.js | 2 |
2 files changed, 26 insertions, 16 deletions
diff --git a/spec/frontend/admin/signup_restrictions/components/signup_form_spec.js b/spec/frontend/admin/signup_restrictions/components/signup_form_spec.js index 18339164d5a..4bb22feb913 100644 --- a/spec/frontend/admin/signup_restrictions/components/signup_form_spec.js +++ b/spec/frontend/admin/signup_restrictions/components/signup_form_spec.js @@ -192,22 +192,27 @@ describe('Signup Form', () => { describe('form submit button confirmation modal for side-effect of adding possibly unwanted new users', () => { it.each` - requireAdminApprovalAction | userCapAction | buttonEffect - ${'unchanged from true'} | ${'unchanged'} | ${'submits form'} - ${'unchanged from false'} | ${'unchanged'} | ${'submits form'} - ${'toggled off'} | ${'unchanged'} | ${'shows confirmation modal'} - ${'toggled on'} | ${'unchanged'} | ${'submits form'} - ${'unchanged from false'} | ${'increased'} | ${'shows confirmation modal'} - ${'unchanged from true'} | ${'increased'} | ${'shows confirmation modal'} - ${'toggled off'} | ${'increased'} | ${'shows confirmation modal'} - ${'toggled on'} | ${'increased'} | ${'shows confirmation modal'} - ${'toggled on'} | ${'decreased'} | ${'submits form'} - ${'unchanged from false'} | ${'changed from limited to unlimited'} | ${'shows confirmation modal'} - ${'unchanged from false'} | ${'changed from unlimited to limited'} | ${'submits form'} - ${'unchanged from false'} | ${'unchanged from unlimited'} | ${'submits form'} + requireAdminApprovalAction | userCapAction | pendingUserCount | buttonEffect + ${'unchanged from true'} | ${'unchanged'} | ${0} | ${'submits form'} + ${'unchanged from false'} | ${'unchanged'} | ${0} | ${'submits form'} + ${'toggled off'} | ${'unchanged'} | ${1} | ${'shows confirmation modal'} + ${'toggled off'} | ${'unchanged'} | ${0} | ${'submits form'} + ${'toggled on'} | ${'unchanged'} | ${0} | ${'submits form'} + ${'unchanged from false'} | ${'increased'} | ${1} | ${'shows confirmation modal'} + ${'unchanged from true'} | ${'increased'} | ${0} | ${'submits form'} + ${'toggled off'} | ${'increased'} | ${1} | ${'shows confirmation modal'} + ${'toggled off'} | ${'increased'} | ${0} | ${'submits form'} + ${'toggled on'} | ${'increased'} | ${1} | ${'shows confirmation modal'} + ${'toggled on'} | ${'increased'} | ${0} | ${'submits form'} + ${'toggled on'} | ${'decreased'} | ${0} | ${'submits form'} + ${'toggled on'} | ${'decreased'} | ${1} | ${'submits form'} + ${'unchanged from false'} | ${'changed from limited to unlimited'} | ${1} | ${'shows confirmation modal'} + ${'unchanged from false'} | ${'changed from limited to unlimited'} | ${0} | ${'submits form'} + ${'unchanged from false'} | ${'changed from unlimited to limited'} | ${0} | ${'submits form'} + ${'unchanged from false'} | ${'unchanged from unlimited'} | ${0} | ${'submits form'} `( - '$buttonEffect if require admin approval for new sign-ups is $requireAdminApprovalAction and the user cap is $userCapAction', - async ({ requireAdminApprovalAction, userCapAction, buttonEffect }) => { + '$buttonEffect if require admin approval for new sign-ups is $requireAdminApprovalAction and the user cap is $userCapAction and pending user count is $pendingUserCount', + async ({ requireAdminApprovalAction, userCapAction, pendingUserCount, buttonEffect }) => { let isModalDisplayed; switch (buttonEffect) { @@ -224,7 +229,9 @@ describe('Signup Form', () => { const isFormSubmittedWhenClickingFormSubmitButton = !isModalDisplayed; - const injectedProps = {}; + const injectedProps = { + pendingUserCount, + }; const USER_CAP_DEFAULT = 5; @@ -310,6 +317,7 @@ describe('Signup Form', () => { await mountComponent({ injectedProps: { newUserSignupsCap: INITIAL_USER_CAP, + pendingUserCount: 5, }, stubs: { GlButton, GlModal: stubComponent(GlModal) }, }); diff --git a/spec/frontend/admin/signup_restrictions/mock_data.js b/spec/frontend/admin/signup_restrictions/mock_data.js index 624a5614c9c..135fc8caae0 100644 --- a/spec/frontend/admin/signup_restrictions/mock_data.js +++ b/spec/frontend/admin/signup_restrictions/mock_data.js @@ -17,6 +17,7 @@ export const rawMockData = { supportedSyntaxLinkUrl: '/supported/syntax/link', emailRestrictions: 'user1@domain.com, user2@domain.com', afterSignUpText: 'Congratulations on your successful sign-up!', + pendingUserCount: '0', }; export const mockData = { @@ -38,4 +39,5 @@ export const mockData = { supportedSyntaxLinkUrl: '/supported/syntax/link', emailRestrictions: 'user1@domain.com, user2@domain.com', afterSignUpText: 'Congratulations on your successful sign-up!', + pendingUserCount: '0', }; |