diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/frontend/issue_show/components/pinned_links_spec.js | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/frontend/issue_show/components/pinned_links_spec.js')
-rw-r--r-- | spec/frontend/issue_show/components/pinned_links_spec.js | 34 |
1 files changed, 23 insertions, 11 deletions
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: `<a href="${plainZoomUrl}">Zoom</a>`, }); - expect(link.text).toBe('Join Zoom meeting'); + expect( + findLinks() + .at(0) + .text(), + ).toBe('Join Zoom meeting'); + }); + + it('displays Status link', () => { + createComponent({ + publishedIncidentUrl: `<a href="${plainStatusUrl}">Status</a>`, + }); + + 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); |