Commit 3e1e9b67 authored by Luke Bennett's avatar Luke Bennett

Fixed specs

parent 49c7ca2a
...@@ -617,6 +617,7 @@ ...@@ -617,6 +617,7 @@
} }
$el = $(selector, this.dropdown); $el = $(selector, this.dropdown);
if ($el.length) { if ($el.length) {
return $el.first().trigger('click');
e.preventDefault(); e.preventDefault();
e.stopImmediatePropagation(); e.stopImmediatePropagation();
$el.first().trigger('click'); $el.first().trigger('click');
...@@ -690,8 +691,8 @@ ...@@ -690,8 +691,8 @@
if (!index) { if (!index) {
$dropdownContent.scrollTop(0) $dropdownContent.scrollTop(0)
} else if (index === ($listItems.length - 1)) { } else if (index === ($listItems.length - 1)) {
$dropdownContent.scrollTop($dropdownContent.prop('scrollHeight')); $dropdownContent.scrollTop $dropdownContent.prop('scrollHeight');
} else if (listItemBottom > (dropdownContentBottom + dropdownScrollTop)) { } else if (listItemBottom > (dropdownContentBottom + dropdownScrollTop))
$dropdownContent.scrollTop(listItemBottom - dropdownContentBottom + CURSOR_SELECT_SCROLL_PADDING); $dropdownContent.scrollTop(listItemBottom - dropdownContentBottom + CURSOR_SELECT_SCROLL_PADDING);
} else if (listItemTop < (dropdownContentTop + dropdownScrollTop)) { } else if (listItemTop < (dropdownContentTop + dropdownScrollTop)) {
return $dropdownContent.scrollTop(listItemTop - dropdownContentTop - CURSOR_SELECT_SCROLL_PADDING); return $dropdownContent.scrollTop(listItemTop - dropdownContentTop - CURSOR_SELECT_SCROLL_PADDING);
......
...@@ -105,13 +105,13 @@ ...@@ -105,13 +105,13 @@
a3 = "a[href='" + mrsAssignedToMeLink + "']"; a3 = "a[href='" + mrsAssignedToMeLink + "']";
a4 = "a[href='" + mrsIHaveCreatedLink + "']"; a4 = "a[href='" + mrsIHaveCreatedLink + "']";
expect(list.find(a1).length).toBe(1); expect(list.find(a1).length).toBe(1);
expect(list.find(a1).text()).toBe(' Issues assigned to me '); expect(list.find(a1).text()).toBe('Issues assigned to me');
expect(list.find(a2).length).toBe(1); expect(list.find(a2).length).toBe(1);
expect(list.find(a2).text()).toBe(" Issues I've created "); expect(list.find(a2).text()).toBe("Issues I've created");
expect(list.find(a3).length).toBe(1); expect(list.find(a3).length).toBe(1);
expect(list.find(a3).text()).toBe(' Merge requests assigned to me '); expect(list.find(a3).text()).toBe('Merge requests assigned to me');
expect(list.find(a4).length).toBe(1); expect(list.find(a4).length).toBe(1);
return expect(list.find(a4).text()).toBe(" Merge requests I've created "); return expect(list.find(a4).text()).toBe("Merge requests I've created");
}; };
describe('Search autocomplete dropdown', function() { describe('Search autocomplete dropdown', function() {
......
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