Fix test failures

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