Commit 632d3a94 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'ide-header-buttons-tooltip' into 'master'

Added tooltips to tree list header buttons in Web IDE

Closes #50141

See merge request gitlab-org/gitlab-ce!21138
parents 7167e399 dcec0907
<script>
import Icon from '~/vue_shared/components/icon.vue';
import tooltip from '~/vue_shared/directives/tooltip';
export default {
directives: {
tooltip,
},
components: {
Icon,
},
......@@ -26,6 +30,11 @@ export default {
default: true,
},
},
computed: {
tooltipTitle() {
return this.showLabel ? '' : this.label;
},
},
methods: {
clicked() {
this.$emit('click');
......@@ -36,7 +45,9 @@ export default {
<template>
<button
v-tooltip
:aria-label="label"
:title="tooltipTitle"
type="button"
class="btn-blank"
@click.stop.prevent="clicked"
......
---
title: Added tooltips to tree list header
merge_request: 21138
author:
type: added
......@@ -46,4 +46,20 @@ describe('IDE new entry dropdown button component', () => {
done();
});
});
describe('tooltipTitle', () => {
it('returns empty string when showLabel is true', () => {
expect(vm.tooltipTitle).toBe('');
});
it('returns label', done => {
vm.showLabel = false;
vm.$nextTick(() => {
expect(vm.tooltipTitle).toBe('Testing');
done();
});
});
});
});
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