Commit 94fae0df authored by Jarek Ostrowski's avatar Jarek Ostrowski

Update suggest gitlab ci popover button

MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37987
parent dc6b984c
<script> <script>
import { GlPopover, GlSprintf, GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import { GlPopover, GlSprintf, GlButton } from '@gitlab/ui';
import { parseBoolean, scrollToElement, setCookie, getCookie } from '~/lib/utils/common_utils'; import { parseBoolean, scrollToElement, setCookie, getCookie } from '~/lib/utils/common_utils';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
...@@ -29,8 +29,7 @@ export default { ...@@ -29,8 +29,7 @@ export default {
components: { components: {
GlPopover, GlPopover,
GlSprintf, GlSprintf,
GlIcon, GlButton,
GlDeprecatedButton,
}, },
mixins: [trackingMixin], mixins: [trackingMixin],
props: { props: {
...@@ -112,18 +111,17 @@ export default { ...@@ -112,18 +111,17 @@ export default {
<template #title> <template #title>
<span v-html="suggestTitle"></span> <span v-html="suggestTitle"></span>
<span class="ml-auto"> <span class="ml-auto">
<gl-deprecated-button <gl-button
:aria-label="__('Close')" :aria-label="__('Close')"
class="btn-blank" class="btn-blank"
name="dismiss" name="dismiss"
icon="close"
:data-track-property="humanAccess" :data-track-property="humanAccess"
:data-track-value="$options.dismissTrackValue" :data-track-value="$options.dismissTrackValue"
:data-track-event="$options.clickTrackValue" :data-track-event="$options.clickTrackValue"
:data-track-label="trackLabel" :data-track-label="trackLabel"
@click="onDismiss" @click="onDismiss"
> />
<gl-icon name="close" aria-hidden="true" />
</gl-deprecated-button>
</span> </span>
</template> </template>
......
---
title: Update suggest gitlab ci popover to gl-button
merge_request: 37987
author:
type: changed
...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import Popover from '~/blob/suggest_gitlab_ci_yml/components/popover.vue'; import Popover from '~/blob/suggest_gitlab_ci_yml/components/popover.vue';
import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper'; import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper';
import * as utils from '~/lib/utils/common_utils'; import * as utils from '~/lib/utils/common_utils';
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
jest.mock('~/lib/utils/common_utils', () => ({ jest.mock('~/lib/utils/common_utils', () => ({
...jest.requireActual('~/lib/utils/common_utils'), ...jest.requireActual('~/lib/utils/common_utils'),
...@@ -96,7 +96,7 @@ describe('Suggest gitlab-ci.yml Popover', () => { ...@@ -96,7 +96,7 @@ describe('Suggest gitlab-ci.yml Popover', () => {
const expectedAction = 'click_button'; const expectedAction = 'click_button';
const expectedProperty = 'owner'; const expectedProperty = 'owner';
const expectedValue = '10'; const expectedValue = '10';
const dismissButton = wrapper.find(GlDeprecatedButton); const dismissButton = wrapper.find(GlButton);
trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn); trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn);
triggerEvent(dismissButton.element); triggerEvent(dismissButton.element);
......
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