Commit e1b83551 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'ag-326310-update-subs-activation-links' into 'master'

Update anchor link for subscription with code

See merge request gitlab-org/gitlab!62067
parents f583dad2 bf8e670d
...@@ -5,7 +5,9 @@ import { activateSubscription, howToActivateSubscription, uploadLegacyLicense } ...@@ -5,7 +5,9 @@ import { activateSubscription, howToActivateSubscription, uploadLegacyLicense }
import SubscriptionActivationErrors from './subscription_activation_errors.vue'; import SubscriptionActivationErrors from './subscription_activation_errors.vue';
import SubscriptionActivationForm from './subscription_activation_form.vue'; import SubscriptionActivationForm from './subscription_activation_form.vue';
export const adminLicenseUrl = helpPagePath('/user/admin_area/license'); export const activateSubscriptionUrl = helpPagePath('/user/admin_area/license', {
anchor: 'activate-gitlab-ee-with-an-activation-code',
});
export default { export default {
name: 'SubscriptionActivationCard', name: 'SubscriptionActivationCard',
...@@ -23,7 +25,7 @@ export default { ...@@ -23,7 +25,7 @@ export default {
}, },
inject: ['licenseUploadPath'], inject: ['licenseUploadPath'],
links: { links: {
adminLicenseUrl, activateSubscriptionUrl,
}, },
data() { data() {
return { return {
...@@ -51,7 +53,12 @@ export default { ...@@ -51,7 +53,12 @@ export default {
<p class="gl-mb-0 gl-px-5 gl-pt-5"> <p class="gl-mb-0 gl-px-5 gl-pt-5">
<gl-sprintf :message="$options.i18n.howToActivateSubscription"> <gl-sprintf :message="$options.i18n.howToActivateSubscription">
<template #link="{ content }"> <template #link="{ content }">
<gl-link :href="$options.links.adminLicenseUrl" target="_blank">{{ content }}</gl-link> <gl-link
data-testid="activate-subscription-link"
:href="$options.links.activateSubscriptionUrl"
target="_blank"
>{{ content }}</gl-link
>
</template> </template>
</gl-sprintf> </gl-sprintf>
</p> </p>
......
...@@ -155,9 +155,9 @@ export default { ...@@ -155,9 +155,9 @@ export default {
> >
<gl-sprintf :message="$options.i18n.acceptTerms"> <gl-sprintf :message="$options.i18n.acceptTerms">
<template #link="{ content }"> <template #link="{ content }">
<gl-link href="https://about.gitlab.com/terms/" target="_blank" <gl-link href="https://about.gitlab.com/terms/" target="_blank">{{
>{{ content }} content
</gl-link> }}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</gl-form-checkbox> </gl-form-checkbox>
......
import { GlCard } from '@gitlab/ui'; import { GlCard, GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import SubscriptionActivationCard from 'ee/pages/admin/cloud_licenses/components/subscription_activation_card.vue'; import SubscriptionActivationCard, {
activateSubscriptionUrl,
} from 'ee/pages/admin/cloud_licenses/components/subscription_activation_card.vue';
import SubscriptionActivationErrors from 'ee/pages/admin/cloud_licenses/components/subscription_activation_errors.vue'; import SubscriptionActivationErrors from 'ee/pages/admin/cloud_licenses/components/subscription_activation_errors.vue';
import SubscriptionActivationForm, { import SubscriptionActivationForm, {
SUBSCRIPTION_ACTIVATION_FAILURE_EVENT, SUBSCRIPTION_ACTIVATION_FAILURE_EVENT,
...@@ -15,6 +17,7 @@ describe('CloudLicenseApp', () => { ...@@ -15,6 +17,7 @@ describe('CloudLicenseApp', () => {
const findSubscriptionActivationForm = () => wrapper.findComponent(SubscriptionActivationForm); const findSubscriptionActivationForm = () => wrapper.findComponent(SubscriptionActivationForm);
const findSubscriptionActivationErrors = () => const findSubscriptionActivationErrors = () =>
wrapper.findComponent(SubscriptionActivationErrors); wrapper.findComponent(SubscriptionActivationErrors);
const findActivateSubscriptionLink = () => wrapper.findByTestId('activate-subscription-link');
const findUploadLink = () => wrapper.findByTestId('upload-license-link'); const findUploadLink = () => wrapper.findByTestId('upload-license-link');
const createComponent = ({ props = {}, stubs = {}, provide = {} } = {}) => { const createComponent = ({ props = {}, stubs = {}, provide = {} } = {}) => {
...@@ -50,13 +53,17 @@ describe('CloudLicenseApp', () => { ...@@ -50,13 +53,17 @@ describe('CloudLicenseApp', () => {
describe('with an upload legacy license link', () => { describe('with an upload legacy license link', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ stubs: { GlCard } }); createComponent({ stubs: { GlCard, GlSprintf } });
}); });
it('shows a link when provided', () => { it('shows a link when provided', () => {
expect(findUploadLink().text()).toBe('Upload a legacy license'); expect(findUploadLink().text()).toBe('Upload a legacy license');
}); });
it('shows an help link', () => {
expect(findActivateSubscriptionLink().attributes('href')).toBe(activateSubscriptionUrl);
});
it('provides the correct path', () => { it('provides the correct path', () => {
expect(findUploadLink().attributes('href')).toBe(licenseUploadPath); expect(findUploadLink().attributes('href')).toBe(licenseUploadPath);
}); });
......
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