Commit 7a2593d9 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/fixSidebarCollapsedTooltipTitles' into 'master'

Fixes issuable collapsed sidebar tooltips

See merge request gitlab-org/gitlab!78693
parents 576964a6 10b9ca39
...@@ -307,7 +307,12 @@ export default { ...@@ -307,7 +307,12 @@ export default {
@close="handleClose" @close="handleClose"
> >
<template #collapsed> <template #collapsed>
<div v-if="isClassicSidebar" v-gl-tooltip class="sidebar-collapsed-icon"> <div
v-if="isClassicSidebar"
v-gl-tooltip.left.viewport
:title="attributeTypeTitle"
class="sidebar-collapsed-icon"
>
<gl-icon :size="16" :aria-label="attributeTypeTitle" :name="attributeTypeIcon" /> <gl-icon :size="16" :aria-label="attributeTypeTitle" :name="attributeTypeIcon" />
<span class="collapse-truncated-title"> <span class="collapse-truncated-title">
{{ attributeTitle }} {{ attributeTitle }}
......
...@@ -177,19 +177,14 @@ export default { ...@@ -177,19 +177,14 @@ export default {
/> />
<gl-button <gl-button
v-if="isClassicSidebar" v-if="isClassicSidebar"
v-gl-tooltip.left.viewport
:title="tootltipTitle"
category="tertiary" category="tertiary"
type="reset" type="reset"
class="sidebar-collapsed-icon sidebar-collapsed-container gl-rounded-0! gl-shadow-none!" class="sidebar-collapsed-icon sidebar-collapsed-container gl-rounded-0! gl-shadow-none!"
@click.stop.prevent="toggleTodo" @click.stop.prevent="toggleTodo"
> >
<gl-icon <gl-icon :class="{ 'todo-undone': hasTodo }" :name="collapsedButtonIcon" />
v-gl-tooltip.left.viewport
:title="tootltipTitle"
:size="16"
:class="{ 'todo-undone': hasTodo }"
:name="collapsedButtonIcon"
:aria-label="collapsedButtonIcon"
/>
</gl-button> </gl-button>
</div> </div>
</template> </template>
import { GlIcon } from '@gitlab/ui'; import { GlIcon, GlButton } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Vue from 'vue'; import Vue from 'vue';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
...@@ -103,7 +103,7 @@ describe('Sidebar Todo Widget', () => { ...@@ -103,7 +103,7 @@ describe('Sidebar Todo Widget', () => {
}); });
it('sets default tooltip title', () => { it('sets default tooltip title', () => {
expect(wrapper.find(GlIcon).attributes('title')).toBe('Add a to do'); expect(wrapper.find(GlButton).attributes('title')).toBe('Add a to do');
}); });
it('when user has a to do', async () => { it('when user has a to do', async () => {
...@@ -113,7 +113,7 @@ describe('Sidebar Todo Widget', () => { ...@@ -113,7 +113,7 @@ describe('Sidebar Todo Widget', () => {
await waitForPromises(); await waitForPromises();
expect(wrapper.find(GlIcon).props('name')).toBe('todo-done'); expect(wrapper.find(GlIcon).props('name')).toBe('todo-done');
expect(wrapper.find(GlIcon).attributes('title')).toBe('Mark as done'); expect(wrapper.find(GlButton).attributes('title')).toBe('Mark as done');
}); });
it('emits `todoUpdated` event on click on icon', async () => { it('emits `todoUpdated` event on click on icon', async () => {
......
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