Commit 03d3f3b7 authored by Sam White's avatar Sam White Committed by Alexander Turinske

Fix for approval check popover bug

- when multiple `ApprovalCheckPopover` components exists,
  the popovers do not attach to the correct icon
- add title to `id` to make the id unique

Changelog: fixed
EE: true
parent 4b04c92a
...@@ -35,14 +35,14 @@ export default { ...@@ -35,14 +35,14 @@ export default {
<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="'reportInfo' + title"
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="'reportInfo' + title" 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>
......
...@@ -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