Add tests

This commit is contained in:
Clement Ho 2017-02-13 15:55:12 -06:00
parent 17f5a34bfd
commit 010c9337b5
1 changed files with 8 additions and 0 deletions

View File

@ -139,6 +139,14 @@ require('~/lib/utils/url_utility');
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', () => {
expect($(document.activeElement)).not.toEqual($(SEARCH_INPUT_SELECTOR));
remoteCallback();