diff options
author | Phil Hughes <me@iamphill.com> | 2017-01-19 11:33:19 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-01-21 20:05:02 +0000 |
commit | 88b4ea60422dbcb471c4f4af51fe40ca73d830ba (patch) | |
tree | 738d05636c2e7c38a9090e8b39e842bab1496aa5 /spec/javascripts | |
parent | 91ad8c3c93ea5f558891e6302b04c378aa79d412 (diff) | |
download | gitlab-ce-88b4ea60422dbcb471c4f4af51fe40ca73d830ba.tar.gz |
Teaspoon test fix
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/filtered_search/dropdown_utils_spec.js.es6 | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/spec/javascripts/filtered_search/dropdown_utils_spec.js.es6 b/spec/javascripts/filtered_search/dropdown_utils_spec.js.es6 index ce61b73aa8a..f14583ec7d8 100644 --- a/spec/javascripts/filtered_search/dropdown_utils_spec.js.es6 +++ b/spec/javascripts/filtered_search/dropdown_utils_spec.js.es6 @@ -31,22 +31,37 @@ }); describe('filterWithSymbol', () => { + let input; const item = { title: '@root', }; + beforeEach(() => { + setFixtures(` + <input type="text" id="test" /> + `); + + input = document.getElementById('test'); + }); + it('should filter without symbol', () => { - const updatedItem = gl.DropdownUtils.filterWithSymbol('@', item, ':roo'); + input.value = ':roo'; + + const updatedItem = gl.DropdownUtils.filterWithSymbol('@', input, item); expect(updatedItem.droplab_hidden).toBe(false); }); it('should filter with symbol', () => { - const updatedItem = gl.DropdownUtils.filterWithSymbol('@', item, ':@roo'); + input.value = '@roo'; + + const updatedItem = gl.DropdownUtils.filterWithSymbol('@', input, item); expect(updatedItem.droplab_hidden).toBe(false); }); it('should filter with colon', () => { - const updatedItem = gl.DropdownUtils.filterWithSymbol('@', item, ':'); + input.value = 'roo'; + + const updatedItem = gl.DropdownUtils.filterWithSymbol('@', input, item); expect(updatedItem.droplab_hidden).toBe(false); }); }); |