diff options
Diffstat (limited to 'spec/frontend/tooltips/components/tooltips_spec.js')
-rw-r--r-- | spec/frontend/tooltips/components/tooltips_spec.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/frontend/tooltips/components/tooltips_spec.js b/spec/frontend/tooltips/components/tooltips_spec.js index 50848ca2978..3a894427643 100644 --- a/spec/frontend/tooltips/components/tooltips_spec.js +++ b/spec/frontend/tooltips/components/tooltips_spec.js @@ -18,7 +18,7 @@ describe('tooltips/components/tooltips.vue', () => { ...attributes, }; - Object.keys(defaults).forEach(name => { + Object.keys(defaults).forEach((name) => { target.setAttribute(name, defaults[name]); }); @@ -51,6 +51,16 @@ describe('tooltips/components/tooltips.vue', () => { expect(wrapper.find(GlTooltip).props('target')).toBe(target); }); + it('does not attach a tooltip to a target with empty title', async () => { + target.setAttribute('title', ''); + + wrapper.vm.addTooltips([target]); + + await wrapper.vm.$nextTick(); + + expect(wrapper.find(GlTooltip).exists()).toBe(false); + }); + it('does not attach a tooltip twice to the same element', async () => { wrapper.vm.addTooltips([target]); wrapper.vm.addTooltips([target]); |