Commit 0b545cbf authored by Simon Knox's avatar Simon Knox

Merge branch...

Merge branch '329574-epic-start-due-date-help-tooltip-is-appearing-in-unexpected-locations' into 'master'

Fix unexpected due date tooltip for issues

See merge request gitlab-org/gitlab!60681
parents bacd7dc6 242aa575
...@@ -237,13 +237,14 @@ export default { ...@@ -237,13 +237,14 @@ export default {
:data-testid="dataTestId" :data-testid="dataTestId"
@open="openDatePicker" @open="openDatePicker"
> >
<template #title-extra> <template v-if="canInherit" #title-extra>
<gl-icon <gl-icon
ref="epicDatePopover" ref="epicDatePopover"
name="question-o" name="question-o"
class="gl-ml-3 gl-cursor-pointer gl-text-blue-600" class="gl-ml-3 gl-cursor-pointer gl-text-blue-600 hide-collapsed"
tabindex="0" tabindex="0"
:aria-label="$options.i18n.help" :aria-label="$options.i18n.help"
data-testid="inherit-date-popover"
/> />
<gl-popover <gl-popover
:target="() => $refs.epicDatePopover.$el" :target="() => $refs.epicDatePopover.$el"
......
...@@ -22,6 +22,7 @@ describe('Sidebar date Widget', () => { ...@@ -22,6 +22,7 @@ describe('Sidebar date Widget', () => {
const date = '2021-04-15'; const date = '2021-04-15';
const findEditableItem = () => wrapper.findComponent(SidebarEditableItem); const findEditableItem = () => wrapper.findComponent(SidebarEditableItem);
const findPopoverIcon = () => wrapper.find('[data-testid="inherit-date-popover"]');
const createComponent = ({ const createComponent = ({
dueDateQueryHandler = jest.fn().mockResolvedValue(issuableDueDateResponse()), dueDateQueryHandler = jest.fn().mockResolvedValue(issuableDueDateResponse()),
...@@ -70,6 +71,12 @@ describe('Sidebar date Widget', () => { ...@@ -70,6 +71,12 @@ describe('Sidebar date Widget', () => {
expect(wrapper.text()).toContain('Due date'); expect(wrapper.text()).toContain('Due date');
}); });
it('does not display icon popover by default', () => {
createComponent();
expect(findPopoverIcon().exists()).toBe(false);
});
describe('when issuable has no due date', () => { describe('when issuable has no due date', () => {
beforeEach(async () => { beforeEach(async () => {
createComponent({ createComponent({
...@@ -146,4 +153,10 @@ describe('Sidebar date Widget', () => { ...@@ -146,4 +153,10 @@ describe('Sidebar date Widget', () => {
expect(wrapper.emitted(event)).toEqual([[date]]); expect(wrapper.emitted(event)).toEqual([[date]]);
}, },
); );
it('displays icon popover when issuable can inherit date', () => {
createComponent({ canInherit: true });
expect(findPopoverIcon().exists()).toBe(true);
});
}); });
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