Commit 3f25f30f authored by pburdette's avatar pburdette

Apply maintainer feedback

parent c28b6bbd
......@@ -24,31 +24,36 @@ export default {
moreInfo: s__('mrWidget|More information'),
learnMore: s__('mrWidget|Learn more'),
},
popoverConstants: {
target: 'merge-train-help',
container: 'merge-train-help-container',
},
};
</script>
<template>
<div id="merge-train-help-container" data-testid="merge-train-helper-icon">
<div :id="$options.popoverConstants.container">
<gl-icon
id="merge-train-help"
:id="$options.popoverConstants.target"
name="question-o"
class="gl-text-blue-600"
:aria-label="$options.i18n.moreInfo"
data-testid="merge-train-helper-icon"
/>
<gl-popover
target="merge-train-help"
container="merge-train-help-container"
:target="$options.popoverConstants.target"
:container="$options.popoverConstants.container"
placement="top"
:title="$options.i18n.popoverTitle"
triggers="hover focus"
>
<p>{{ $options.i18n.popoverContent }}</p>
<p data-testid="merge-train-helper-content">{{ $options.i18n.popoverContent }}</p>
<gl-link
class="gl-mt-3"
:href="mergeTrainWhenPipelineSucceedsDocsPath"
target="_blank"
rel="noopener noreferrer"
data-testid="documentation-link"
data-testid="merge-train-helper-link"
>
{{ $options.i18n.learnMore }}
</gl-link>
......
......@@ -29,7 +29,11 @@ RSpec.describe 'User adds to merge train when pipeline succeeds', :js do
visit project_merge_request_path(project, merge_request)
expect(page).to have_button('Start merge train when pipeline succeeds')
expect(page).to have_selector('[data-testid="merge-train-helper-icon"]')
find('[data-testid="merge-train-helper-icon"]').hover
expect(page).to have_selector('[data-testid="merge-train-helper-content"]')
expect(page).to have_link('Learn more', href: help_page_path('ci/pipelines/merge_trains.md', anchor: 'add-a-merge-request-to-a-merge-train'))
end
context 'when merge_trains EEP license is not available' do
......@@ -41,6 +45,7 @@ RSpec.describe 'User adds to merge train when pipeline succeeds', :js do
visit project_merge_request_path(project, merge_request)
expect(page).not_to have_button('Start merge train when pipeline succeeds')
expect(page).not_to have_selector('[data-testid="merge-train-helper-icon"]')
end
end
......
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