Commit dcb61727 authored by Tom Quirk's avatar Tom Quirk

Address reviewer feedback

parent 7cfd6d20
......@@ -36,13 +36,8 @@ export default {
return `${gon.gitlab_url}/${gon.current_username}`;
},
},
created() {
this.setSignInURL();
},
methods: {
async setSignInURL() {
this.signInURL = await getGitlabSignInURL(this.usersPath);
},
async created() {
this.signInURL = await getGitlabSignInURL(this.usersPath);
},
i18n: {
signInText: __('Sign in to GitLab'),
......@@ -54,12 +49,7 @@ export default {
<div class="jira-connect-user gl-font-base">
<gl-sprintf v-if="userSignedIn" :message="$options.i18n.signedInAsUserText">
<template #user_link>
<gl-link
data-testid="gitlab-user-link"
:href="gitlabUserLink"
rel="noopener noreferrer"
target="_blank"
>
<gl-link data-testid="gitlab-user-link" :href="gitlabUserLink" target="_blank">
{{ gitlabUserHandle }}
</gl-link>
</template>
......@@ -69,7 +59,6 @@ export default {
v-else-if="hasSubscriptions"
data-testid="sign-in-link"
:href="signInURL"
rel="noopener noreferrer"
target="_blank"
>
{{ $options.i18n.signInText }}
......
import { shallowMount } from '@vue/test-utils';
import { GlSprintf } from '@gitlab/ui';
import UserLink from '~/jira_connect/subscriptions/components/user_link.vue';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
jest.mock('~/jira_connect/subscriptions/utils', () => ({
......@@ -11,7 +11,7 @@ describe('SubscriptionsList', () => {
let wrapper;
const createComponent = (propsData = {}, { provide } = {}) => {
wrapper = shallowMount(UserLink, {
wrapper = shallowMountExtended(UserLink, {
propsData,
provide,
stubs: {
......@@ -20,8 +20,8 @@ describe('SubscriptionsList', () => {
});
};
const findSignInLink = () => wrapper.find('[data-testid="sign-in-link"]');
const findGitlabUserLink = () => wrapper.find('[data-testid="gitlab-user-link"]');
const findSignInLink = () => wrapper.findByTestId('sign-in-link');
const findGitlabUserLink = () => wrapper.findByTestId('gitlab-user-link');
const findSprintf = () => wrapper.findComponent(GlSprintf);
afterEach(() => {
......
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