diff options
Diffstat (limited to 'spec/frontend/jira_connect/subscriptions/components/user_link_spec.js')
-rw-r--r-- | spec/frontend/jira_connect/subscriptions/components/user_link_spec.js | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/spec/frontend/jira_connect/subscriptions/components/user_link_spec.js b/spec/frontend/jira_connect/subscriptions/components/user_link_spec.js index a10e352ed85..77bc1d2004c 100644 --- a/spec/frontend/jira_connect/subscriptions/components/user_link_spec.js +++ b/spec/frontend/jira_connect/subscriptions/components/user_link_spec.js @@ -1,6 +1,5 @@ import { GlSprintf } from '@gitlab/ui'; import UserLink from '~/jira_connect/subscriptions/components/user_link.vue'; -import SignInOauthButton from '~/jira_connect/subscriptions/components/sign_in_oauth_button.vue'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; @@ -13,42 +12,18 @@ describe('UserLink', () => { provide, stubs: { GlSprintf, - SignInOauthButton, }, }); }; const findGitlabUserLink = () => wrapper.findByTestId('gitlab-user-link'); const findSprintf = () => wrapper.findComponent(GlSprintf); - const findOauthButton = () => wrapper.findComponent(SignInOauthButton); - describe.each` - userSignedIn | hasSubscriptions | expectGlSprintf | expectOauthButton - ${false} | ${false} | ${false} | ${false} - ${false} | ${true} | ${false} | ${true} - ${true} | ${false} | ${true} | ${false} - ${true} | ${true} | ${true} | ${false} - `( - 'when `userSignedIn` is $userSignedIn, `hasSubscriptions` is $hasSubscriptions', - ({ userSignedIn, hasSubscriptions, expectGlSprintf, expectOauthButton }) => { - it('renders template correctly', () => { - createComponent( - { - userSignedIn, - hasSubscriptions, - }, - { - provide: { - oauthMetadata: {}, - }, - }, - ); + it('renders template correctly', () => { + createComponent(); - expect(findSprintf().exists()).toBe(expectGlSprintf); - expect(findOauthButton().exists()).toBe(expectOauthButton); - }); - }, - ); + expect(findSprintf().exists()).toBe(true); + }); describe('gitlab user link', () => { describe.each` @@ -62,14 +37,7 @@ describe('UserLink', () => { beforeEach(() => { window.gon = { current_username, relative_root_url: '' }; - createComponent( - { - userSignedIn: true, - hasSubscriptions: true, - user, - }, - { provide: { gitlabUserPath } }, - ); + createComponent({ user }, { provide: { gitlabUserPath } }); }); it(`sets href to ${expectedUserLink}`, () => { |