Commit 010c9337 authored by Clement Ho's avatar Clement Ho

Add tests

parent 17f5a34b
...@@ -139,6 +139,14 @@ require('~/lib/utils/url_utility'); ...@@ -139,6 +139,14 @@ require('~/lib/utils/url_utility');
this.dropdownButtonElement.click(); this.dropdownButtonElement.click();
}); });
it('should show loading indicator while search results are being fetched by backend', () => {
const dropdownMenu = document.querySelector('.dropdown-menu');
expect(dropdownMenu.className.indexOf('is-loading') !== -1).toEqual(true);
remoteCallback();
expect(dropdownMenu.className.indexOf('is-loading') !== -1).toEqual(false);
});
it('should not focus search input while remote task is not complete', () => { it('should not focus search input while remote task is not complete', () => {
expect($(document.activeElement)).not.toEqual($(SEARCH_INPUT_SELECTOR)); expect($(document.activeElement)).not.toEqual($(SEARCH_INPUT_SELECTOR));
remoteCallback(); remoteCallback();
......
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