diff options
Diffstat (limited to 'spec/frontend/jira_connect/subscriptions/components/browser_support_alert_spec.js')
-rw-r--r-- | spec/frontend/jira_connect/subscriptions/components/browser_support_alert_spec.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/frontend/jira_connect/subscriptions/components/browser_support_alert_spec.js b/spec/frontend/jira_connect/subscriptions/components/browser_support_alert_spec.js new file mode 100644 index 00000000000..aa93a6be3c8 --- /dev/null +++ b/spec/frontend/jira_connect/subscriptions/components/browser_support_alert_spec.js @@ -0,0 +1,37 @@ +import { GlAlert, GlLink } from '@gitlab/ui'; +import { shallowMount, mount } from '@vue/test-utils'; +import BrowserSupportAlert from '~/jira_connect/subscriptions/components/browser_support_alert.vue'; + +describe('BrowserSupportAlert', () => { + let wrapper; + + const createComponent = ({ mountFn = shallowMount } = {}) => { + wrapper = mountFn(BrowserSupportAlert); + }; + + const findAlert = () => wrapper.findComponent(GlAlert); + const findLink = () => wrapper.findComponent(GlLink); + + afterEach(() => { + wrapper.destroy(); + }); + + it('displays a non-dismissible alert', () => { + createComponent(); + + expect(findAlert().exists()).toBe(true); + expect(findAlert().props()).toMatchObject({ + dismissible: false, + title: BrowserSupportAlert.i18n.title, + variant: 'danger', + }); + }); + + it('renders help link with target="_blank" and rel="noopener noreferrer"', () => { + createComponent({ mountFn: mount }); + expect(findLink().attributes()).toMatchObject({ + target: '_blank', + rel: 'noopener', + }); + }); +}); |