Fix test failures

parent b94d7450
...@@ -12,7 +12,6 @@ import { ...@@ -12,7 +12,6 @@ import {
import { n__, s__, sprintf } from '~/locale'; import { n__, s__, sprintf } from '~/locale';
import { mergeUrlParams, webIDEUrl } from '~/lib/utils/url_utility'; import { mergeUrlParams, webIDEUrl } from '~/lib/utils/url_utility';
import clipboardButton from '~/vue_shared/components/clipboard_button.vue'; import clipboardButton from '~/vue_shared/components/clipboard_button.vue';
import tooltip from '~/vue_shared/directives/tooltip';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue';
import MrWidgetIcon from './mr_widget_icon.vue'; import MrWidgetIcon from './mr_widget_icon.vue';
...@@ -162,19 +161,22 @@ export default { ...@@ -162,19 +161,22 @@ export default {
:aria-label="__('Download as')" :aria-label="__('Download as')"
icon="download" icon="download"
right right
data-qa-selector="download_dropdown"
> >
<gl-dropdown-header>{{ s__('Download as') }}</gl-dropdown-header> <gl-dropdown-header>{{ s__('Download as') }}</gl-dropdown-header>
<gl-dropdown-item <gl-dropdown-item
:href="mr.emailPatchesPath" :href="mr.emailPatchesPath"
class="js-download-email-patches qa-download-email-patches" class="js-download-email-patches"
download download
data-qa-selector="download_email_patches"
> >
{{ s__('mrWidget|Email patches') }} {{ s__('mrWidget|Email patches') }}
</gl-dropdown-item> </gl-dropdown-item>
<gl-dropdown-item <gl-dropdown-item
:href="mr.plainDiffPath" :href="mr.plainDiffPath"
class="js-download-plain-diff qa-download-plain-diff" class="js-download-plain-diff"
download download
data-qa-selector="download_plain_diff"
> >
{{ s__('mrWidget|Plain diff') }} {{ s__('mrWidget|Plain diff') }}
</gl-dropdown-item> </gl-dropdown-item>
......
...@@ -8,7 +8,7 @@ module QA ...@@ -8,7 +8,7 @@ module QA
include Page::Component::Issuable::Sidebar include Page::Component::Issuable::Sidebar
view 'app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue' do view 'app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue' do
element :dropdown_toggle element :download_dropdown
element :download_email_patches element :download_email_patches
element :download_plain_diff element :download_plain_diff
element :open_in_web_ide_button element :open_in_web_ide_button
......
...@@ -22,8 +22,10 @@ describe('MRWidgetHeader', () => { ...@@ -22,8 +22,10 @@ describe('MRWidgetHeader', () => {
}); });
const expectDownloadDropdownItems = () => { const expectDownloadDropdownItems = () => {
const downloadEmailPatchesEl = vm.$el.querySelector('.js-download-email-patches'); const downloadEmailPatchesEl = vm.$el.querySelector(
const downloadPlainDiffEl = vm.$el.querySelector('.js-download-plain-diff'); '.js-download-email-patches .dropdown-item',
);
const downloadPlainDiffEl = vm.$el.querySelector('.js-download-plain-diff .dropdown-item');
expect(downloadEmailPatchesEl.textContent.trim()).toEqual('Email patches'); expect(downloadEmailPatchesEl.textContent.trim()).toEqual('Email patches');
expect(downloadEmailPatchesEl.getAttribute('href')).toEqual('/mr/email-patches'); expect(downloadEmailPatchesEl.getAttribute('href')).toEqual('/mr/email-patches');
......
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