Commit f361ce1f authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'fix-vuln-check-popovers' into 'master'

Fix for approval check popover bug

See merge request gitlab-org/gitlab!65579
parents 9da58575 f3943823
...@@ -29,20 +29,25 @@ export default { ...@@ -29,20 +29,25 @@ export default {
default: '', default: '',
}, },
}, },
computed: {
popoverTriggerId() {
return `reportInfo-${this.title}`;
},
},
}; };
</script> </script>
<template> <template>
<span class="vertical-align-middle text-muted js-help ml-2"> <span class="vertical-align-middle text-muted js-help ml-2">
<gl-icon <gl-icon
id="reportInfo" :id="popoverTriggerId"
name="question" name="question"
class="author-link suggestion-help-hover" class="author-link suggestion-help-hover"
:aria-label="__('help')" :aria-label="__('help')"
:size="14" :size="14"
data-testid="icon2" data-testid="icon2"
/> />
<gl-popover target="reportInfo" placement="top" :title="title"> <gl-popover :target="popoverTriggerId" placement="top" :title="title">
<div class="mb-2">{{ text }}</div> <div class="mb-2">{{ text }}</div>
<gl-link v-if="documentationLink" target="_blank" :href="documentationLink"> <gl-link v-if="documentationLink" target="_blank" :href="documentationLink">
<span class="vertical-align-middle">{{ documentationText }}</span> <span class="vertical-align-middle">{{ documentationText }}</span>
......
...@@ -7,11 +7,11 @@ import { TEST_HOST } from 'helpers/test_constants'; ...@@ -7,11 +7,11 @@ import { TEST_HOST } from 'helpers/test_constants';
describe('Approval Check Popover', () => { describe('Approval Check Popover', () => {
let wrapper; let wrapper;
const title = 'Title';
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(component, { wrapper = shallowMount(component, {
propsData: { propsData: { title },
title: 'Title',
},
}); });
}); });
...@@ -43,8 +43,8 @@ describe('Approval Check Popover', () => { ...@@ -43,8 +43,8 @@ describe('Approval Check Popover', () => {
it('should render gl-popover with correct props', () => { it('should render gl-popover with correct props', () => {
expect(wrapper.find(GlPopover).props()).toMatchObject({ expect(wrapper.find(GlPopover).props()).toMatchObject({
title: 'Title', title,
target: 'reportInfo', target: `reportInfo-${title}`,
placement: 'top', placement: 'top',
}); });
}); });
......
...@@ -60,7 +60,7 @@ describe('Approval Check Popover', () => { ...@@ -60,7 +60,7 @@ describe('Approval Check Popover', () => {
}); });
describe('approvalConfig', () => { describe('approvalConfig', () => {
it('returns "Vulberability-Check" config', (done) => { it('returns "Vulnerability-Check" config', (done) => {
wrapper.setProps({ rule: { name: VULNERABILITY_CHECK_NAME } }); wrapper.setProps({ rule: { name: VULNERABILITY_CHECK_NAME } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.approvalRuleConfig.title).toBe( expect(wrapper.vm.approvalRuleConfig.title).toBe(
......
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