From 88b4ea60422dbcb471c4f4af51fe40ca73d830ba Mon Sep 17 00:00:00 2001
From: Phil Hughes <me@iamphill.com>
Date: Thu, 19 Jan 2017 11:33:19 +0000
Subject: [PATCH] Teaspoon test fix

---
 .../dropdown_utils_spec.js.es6                | 21 ++++++++++++++++---
 1 file 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);
       });
     });
-- 
GitLab