From 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Jun 2020 11:18:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-1-stable-ee --- .../issue_show/components/pinned_links_spec.js | 34 +++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'spec/frontend/issue_show/components/pinned_links_spec.js') diff --git a/spec/frontend/issue_show/components/pinned_links_spec.js b/spec/frontend/issue_show/components/pinned_links_spec.js index 59c919c85d5..007ad4c9a1b 100644 --- a/spec/frontend/issue_show/components/pinned_links_spec.js +++ b/spec/frontend/issue_show/components/pinned_links_spec.js @@ -3,23 +3,18 @@ import { GlLink } from '@gitlab/ui'; import PinnedLinks from '~/issue_show/components/pinned_links.vue'; const plainZoomUrl = 'https://zoom.us/j/123456789'; +const plainStatusUrl = 'https://status.com'; describe('PinnedLinks', () => { let wrapper; - const link = { - get text() { - return wrapper.find(GlLink).text(); - }, - get href() { - return wrapper.find(GlLink).attributes('href'); - }, - }; + const findLinks = () => wrapper.findAll(GlLink); const createComponent = props => { wrapper = shallowMount(PinnedLinks, { propsData: { - zoomMeetingUrl: null, + zoomMeetingUrl: '', + publishedIncidentUrl: '', ...props, }, }); @@ -30,12 +25,29 @@ describe('PinnedLinks', () => { zoomMeetingUrl: `Zoom`, }); - expect(link.text).toBe('Join Zoom meeting'); + expect( + findLinks() + .at(0) + .text(), + ).toBe('Join Zoom meeting'); + }); + + it('displays Status link', () => { + createComponent({ + publishedIncidentUrl: `Status`, + }); + + expect( + findLinks() + .at(0) + .text(), + ).toBe('Published on status page'); }); it('does not render if there are no links', () => { createComponent({ - zoomMeetingUrl: null, + zoomMeetingUrl: '', + publishedIncidentUrl: '', }); expect(wrapper.find(GlLink).exists()).toBe(false); -- cgit v1.2.1