Fix license fabrication

parent c0e69e10
...@@ -57,8 +57,8 @@ export default { ...@@ -57,8 +57,8 @@ export default {
data-testid="activate-subscription-link" data-testid="activate-subscription-link"
:href="$options.links.activateSubscriptionUrl" :href="$options.links.activateSubscriptionUrl"
target="_blank" target="_blank"
>{{ content }}</gl-link >{{ content }}
> </gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</p> </p>
...@@ -67,7 +67,11 @@ export default { ...@@ -67,7 +67,11 @@ export default {
@subscription-activation-failure="handleFormActivationFailure" @subscription-activation-failure="handleFormActivationFailure"
/> />
<template #footer> <template #footer>
<gl-link v-if="licenseUploadPath" data-testid="upload-license-link" :href="licenseUploadPath" <gl-link
v-if="licenseUploadPath"
data-testid="upload-license-link"
data-qa-selector="license_upload_link"
:href="licenseUploadPath"
>{{ $options.i18n.uploadLicenseFile }} >{{ $options.i18n.uploadLicenseFile }}
</gl-link> </gl-link>
</template> </template>
......
...@@ -62,4 +62,4 @@ ...@@ -62,4 +62,4 @@
%p= _('If you remove this license, GitLab will fall back on the previous license, if any.') %p= _('If you remove this license, GitLab will fall back on the previous license, if any.')
%p= _('If there is no previous license or if the previous license has expired, some GitLab functionality will be blocked until a new, valid license is uploaded.') %p= _('If there is no previous license or if the previous license has expired, some GitLab functionality will be blocked until a new, valid license is uploaded.')
%br %br
= link_to _('Remove license'), admin_license_path, data: { confirm: _('Are you sure you want to remove the license?'), qa_selector: 'remove_license_link' }, method: :delete, class: 'gl-button btn btn-danger' = link_to _('Remove license'), admin_license_path, data: { confirm: _('Are you sure you want to remove the license?') }, method: :delete, class: 'gl-button btn btn-danger'
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
- if @license&.trial? - if @license&.trial?
= render 'upload_buy_license' = render 'upload_buy_license'
- else - else
= link_to _('Upload New License'), new_admin_license_path, class: 'gl-button btn btn-confirm float-right', data: { qa_selector: 'license_upload_link' } = link_to _('Upload New License'), new_admin_license_path, class: 'gl-button btn btn-confirm float-right'
%hr %hr
......
= nav_link(controller: 'admin/subscriptions') do = nav_link(controller: 'admin/subscriptions') do
= link_to admin_subscription_path, class: "qa-link-license-menu" do = link_to admin_subscription_path, class: "qa-link-subscription-menu" do
.nav-icon-container .nav-icon-container
= sprite_icon('license') = sprite_icon('license')
%span.nav-item-name %span.nav-item-name
......
...@@ -9,11 +9,11 @@ module QA ...@@ -9,11 +9,11 @@ module QA
element :missing_license_content element :missing_license_content
end end
view 'ee/app/views/admin/licenses/show.html.haml' do view 'ee/app/assets/javascripts/admin/subscriptions/show/components/subscription_activation_card.vue' do
element :license_upload_link element :license_upload_link
end end
view 'ee/app/views/admin/licenses/_info.html.haml' do view 'ee/app/assets/javascripts/admin/subscriptions/show/components/subscription_breakdown.vue' do
element :remove_license_link element :remove_license_link
end end
...@@ -25,7 +25,7 @@ module QA ...@@ -25,7 +25,7 @@ module QA
end end
def license? def license?
has_element?(:remove_license_link) || !has_element?(:missing_license_content) has_element?(:remove_license_link)
end end
def add_new_license(key) def add_new_license(key)
......
...@@ -21,7 +21,7 @@ module QA ...@@ -21,7 +21,7 @@ module QA
end end
view 'ee/app/views/layouts/nav/sidebar/_licenses_link.html.haml' do view 'ee/app/views/layouts/nav/sidebar/_licenses_link.html.haml' do
element :link_license_menu element :link_subscription_menu
end end
view 'ee/app/views/layouts/nav/ee/admin/_new_monitoring_sidebar.html.haml' do view 'ee/app/views/layouts/nav/ee/admin/_new_monitoring_sidebar.html.haml' do
...@@ -42,8 +42,8 @@ module QA ...@@ -42,8 +42,8 @@ module QA
click_element :link_geo_menu click_element :link_geo_menu
end end
def click_license_menu_link def click_subscription_menu_link
click_element :link_license_menu click_element :link_subscription_menu
end end
def go_to_template_settings def go_to_template_settings
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
def fabricate!(license) def fabricate!(license)
QA::Page::Main::Login.perform(&:sign_in_using_admin_credentials) QA::Page::Main::Login.perform(&:sign_in_using_admin_credentials)
QA::Page::Main::Menu.perform(&:go_to_admin_area) QA::Page::Main::Menu.perform(&:go_to_admin_area)
QA::Page::Admin::Menu.perform(&:click_license_menu_link) QA::Page::Admin::Menu.perform(&:click_subscription_menu_link)
EE::Page::Admin::License.perform do |license_page| EE::Page::Admin::License.perform do |license_page|
license_page.add_new_license(license) unless license_page.license? license_page.add_new_license(license) unless license_page.license?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment