diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-01-20 11:38:06 -0600 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-01-23 17:38:06 -0600 |
commit | cfe83509c094390f170f9cec53d1f6576c2162de (patch) | |
tree | 8d8f6b664be35f2703f4789ffb33e41e624467e3 /spec/javascripts | |
parent | b60de9c0fd90c310d2a4146f75b67f9f360cbd6c (diff) | |
download | gitlab-ce-cfe83509c094390f170f9cec53d1f6576c2162de.tar.gz |
Fix autocomplete initial undefined state26775-fix-auto-complete-initial-loading
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/26775
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/gfm_auto_complete_spec.js.es6 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/javascripts/gfm_auto_complete_spec.js.es6 b/spec/javascripts/gfm_auto_complete_spec.js.es6 index 6b48d82cb23..99cebb32a8b 100644 --- a/spec/javascripts/gfm_auto_complete_spec.js.es6 +++ b/spec/javascripts/gfm_auto_complete_spec.js.es6 @@ -62,4 +62,30 @@ describe('GfmAutoComplete', function () { }); }); }); + + describe('isLoading', function () { + it('should be true with loading data object item', function () { + expect(GfmAutoComplete.isLoading({ name: 'loading' })).toBe(true); + }); + + it('should be true with loading data array', function () { + expect(GfmAutoComplete.isLoading(['loading'])).toBe(true); + }); + + it('should be true with loading data object array', function () { + expect(GfmAutoComplete.isLoading([{ name: 'loading' }])).toBe(true); + }); + + it('should be false with actual array data', function () { + expect(GfmAutoComplete.isLoading([ + { title: 'Foo' }, + { title: 'Bar' }, + { title: 'Qux' }, + ])).toBe(false); + }); + + it('should be false with actual data item', function () { + expect(GfmAutoComplete.isLoading({ title: 'Foo' })).toBe(false); + }); + }); }); |