Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b22ba066
Commit
b22ba066
authored
May 11, 2021
by
Angelo Gulina
Committed by
Dan Davison
May 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specs for modal component
parent
a19e7b79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_activation_form.vue
...loud_licenses/components/subscription_activation_form.vue
+5
-1
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
...es/admin/cloud_licences/admin_views_cloud_license_spec.rb
+41
-0
No files found.
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_activation_form.vue
View file @
b22ba066
...
...
@@ -148,7 +148,11 @@ export default {
:invalid-feedback=
"$options.i18n.fieldRequiredMessage"
data-testid=
"form-group-terms"
>
<gl-form-checkbox
v-model=
"form.fields.terms.state"
:state=
"isCheckboxValid"
>
<gl-form-checkbox
id=
"subscription-form-terms-check"
v-model=
"form.fields.terms.state"
:state=
"isCheckboxValid"
>
<gl-sprintf
:message=
"$options.i18n.acceptTerms"
>
<template
#link
="
{ content }">
<gl-link
href=
"https://about.gitlab.com/terms/"
target=
"_blank"
...
...
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
View file @
b22ba066
...
...
@@ -43,6 +43,39 @@ RSpec.describe 'Admin views Cloud License', :js do
expect
(
page
).
to
have_content
(
'You can no longer sync your subscription details with GitLab. Get help for the most common connectivity issues by troubleshooting the activation code'
)
end
end
context
'activate another subscription'
do
before
do
click_button
(
'Enter activation code'
)
end
it
'shows the activation modal'
do
page
.
within
(
find
(
'#subscription-activation-modal'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
'Activate subscription'
)
end
end
it
'displays an error when the activation fails'
do
stub_request
(
:post
,
EE
::
SUBSCRIPTIONS_GRAPHQL_URL
).
to_return
(
status:
422
,
body:
''
,
headers:
{})
page
.
within
(
find
(
'#subscription-activation-modal'
,
match: :first
))
do
fill_activation_form
expect
(
page
).
to
have_content
(
'An error occurred while activating your subscription.'
)
end
end
it
'displays a connectivity error'
do
stub_request
(
:post
,
EE
::
SUBSCRIPTIONS_GRAPHQL_URL
)
.
to_return
(
status:
500
,
body:
''
,
headers:
{})
page
.
within
(
find
(
'#subscription-activation-modal'
,
match: :first
))
do
fill_activation_form
expect
(
page
).
to
have_content
(
'There is a connectivity issue.'
)
end
end
end
end
context
'when there is no license'
do
...
...
@@ -68,4 +101,12 @@ RSpec.describe 'Admin views Cloud License', :js do
end
end
end
private
def
fill_activation_form
fill_in
'activationCode'
,
with:
'fake-activation-code'
check
'subscription-form-terms-check'
click_button
'Activate'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment