Commit 3f25f30f authored by pburdette's avatar pburdette

Apply maintainer feedback

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