Completed
Push — master ( 48c879...8f1cd0 )
by Denis
02:01
created

test.js ➔ ... ➔ it(ꞌShould call search by manual calling .search with search phrase as attributeꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 9.4285
1
describe('Jets', function() {
2
3
  var people = ['John Doe', 'Mike Doe', 'Alex Smith', 'Alice Vazovsky', 'Denis Koen'],
4
    $search = $('#jetsSearch'),
5
    searchNode = $search.get(0),
6
    $content = $('#jetsContent');
7
8
9
  /*
10
   * Helper functions
11
   */
12
  function trigger(ev, _elem) {
13
    elem = _elem || searchNode
0 ignored issues
show
Bug introduced by
The variable elem seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.elem.
Loading history...
14
    if ("createEvent" in document) {
15
        var evt = document.createEvent("HTMLEvents");
16
        evt.initEvent(ev, false, true);
17
        elem.dispatchEvent(evt);
18
    } else elem.fireEvent("on" + ev);
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
19
  }
20
21
  function ext(options) {
22
    return $.extend({
23
      searchTag: '#jetsSearch',
24
      contentTag: '#jetsContent'
25
    }, options || {});
26
  }
27
28
  function make(action) {
29
    action();
30
    trigger('change');
31
  }
32
33
34
  /*
35
   * Mocha helpers
36
   */ 
37
  before(function() {
38
    $content.html($.map(people, function(val, i){
39
      var reversed = val.split('').reverse().join('');
40
      return '<tr><td data-custom="' + reversed + '">' + val + '</td><td>' + i + '</td></tr>'
41
    }).join(''));
42
  })
43
44
  afterEach(function() {
45
    jet && jet.destroy();
0 ignored issues
show
Best Practice introduced by
If you intend to check if the variable jet is declared in the current environment, consider using typeof jet === "undefined" instead. This is safe if the variable is not actually declared.
Loading history...
46
    $search.val('');
47
    trigger('change', searchNode);
48
  })
49
50
  after(function() {
51
    jet && jet.destroy();
0 ignored issues
show
Best Practice introduced by
If you intend to check if the variable jet is declared in the current environment, consider using typeof jet === "undefined" instead. This is safe if the variable is not actually declared.
Loading history...
52
    $search.val('');
53
    $content.find('[data-custom]').removeAttr('data-custom');
54
  })
55
56
57
  /*
58
  * Specs
59
  */
60
61
  it('Should hide inappropriate rows', function() {
62
    jet = new Jets(ext({}));
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
63
    make(function() {
64
      $search.val(people[0]);
65
    })
66
    assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
67
  })
68
69
  it('Should show all rows if search query not specified', function() {
70
    jet = new Jets(ext({}));
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
71
    make(function() {
72
      $search.val('');
73
    })
74
    assert.lengthOf($content.children(':visible'), people.length);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
75
  })
76
77
  it('Should hide all rows if no suitable results', function() {
78
    jet = new Jets(ext({}));
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
79
    make(function() {
80
      $search.val('404');
81
    })
82
    assert.lengthOf($content.children(':visible'), 0);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
83
  })
84
85
  describe('On init', function() {
86
87
    it('Shoud add style tag after init', function() {
88
      jet = new Jets(ext({}));
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
89
      assert.lengthOf($('head').find(jet.styleTag), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
90
    })
91
92
    it('Should add "data-jets" attribute', function() {
93
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
94
        columns: [0]
95
      }));
96
      var $firstRow = $content.children(':first');
97
      assert.equal($firstRow.attr('data-jets'), $firstRow.children(':first').text().trim().toLowerCase());
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
98
    })
99
100
  })
101
102
  describe('On destroy', function() {
103
104
    it('Shoud remove style tag after destroy', function() {
105
      jet = new Jets(ext({}));
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
106
      jet.destroy();
107
      assert.lengthOf($('head').find(jet.styleTag), 0);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
108
    })
109
110
    it('Should remove "data-jets" attribute', function() {
111
      jet = new Jets(ext({}));
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
112
      jet.destroy()
113
      assert.isUndefined($content.children(':first').attr('data-jets'));
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
114
    })
115
    
116
  })
117
118
  describe('Columns option', function() {
119
    
120
    it('Should search by any column', function() {
121
      jet = new Jets(ext({}));
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
122
      make(function() {
123
        $search.val('1');
124
      })
125
      assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
126
    })
127
128
    it('Should find one row by first column', function() {
129
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
130
        columns: [0]
131
      }));
132
      make(function() {
133
        $search.val(people[0]);
134
      })
135
      assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
136
    })
137
138
    it('Should avoid second column', function() {
139
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
140
        columns: [0]
141
      }));
142
      make(function() {
143
        $search.val('1');
144
      })
145
      assert.lengthOf($content.children(':visible'), 0);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
146
    })
147
    
148
  })
149
150
  describe('addImportant option', function() {
151
152
    it('Should avoid !important by default', function() {
153
      jet = new Jets(ext({}));
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
154
      make(function() {
155
        $search.val(people[0]);
156
      })
157
      assert.notInclude($(jet.styleTag).html(), '!important');
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
158
    })
159
160
    it('Should add !important', function() {
161
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
162
        addImportant: true
163
      }));
164
      make(function() {
165
        $search.val(people[0]);
166
      })
167
      assert.include($(jet.styleTag).html(), '!important');
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
168
    })
169
170
  })
171
172
  describe('searchSelector option', function() {
173
174
    function execute(selector) {
175
      it('Should use custom selector: ' + selector, function() {
176
        jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
177
          searchSelector: selector
178
        }));
179
        make(function() {
180
          $search.val(people[0]);
181
        })
182
        assert.include($(jet.styleTag).html(), selector);  
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
183
      })
184
    }
185
186
    var selectors = ['^', '$', '~', '|'];
187
    for(var i = 0, ii = selectors.length; i < ii; i++) {
188
      execute(selectors[i]);
189
    }
190
191
    it('Should find one result with * selector', function() {
192
193
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
194
        searchSelector: '*'
195
      }));
196
      make(function() {
197
        $search.val('John Doe');
198
      })
199
      assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
200
201
    })
202
203
    it('Should hide all results with * selector and mixed words', function() {
204
205
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
206
        searchSelector: '*'
207
      }));
208
      make(function() {
209
        $search.val('Doe John');
210
      })
211
      assert.lengthOf($content.children(':visible'), 0);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
212
213
    })
214
215
    it('Should find one result with *AND selector and mixed words', function() {
216
217
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
218
        searchSelector: '*AND'
219
      }));
220
      make(function() {
221
        $search.val('Doe John');
222
      })
223
      assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
224
225
    })
226
227
    it('Should find one result with *AND selector and part of word', function() {
228
229
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
230
        searchSelector: '*AND'
231
      }));
232
      make(function() {
233
        $search.val('John oe');
234
      })
235
      assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
236
237
    })
238
239
    it('Should find three results with *OR selector and part of word', function() {
240
241
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
242
        searchSelector: '*OR'
243
      }));
244
      make(function() {
245
        $search.val('John oe');
246
      })
247
      assert.lengthOf($content.children(':visible'), 3);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
248
249
    })
250
251
  })
252
253
  describe('manualContentHandling option', function() {
254
255
    it('Should fetch content by custom rule', function() {
256
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
257
        manualContentHandling: function(tag) {
258
          return $(tag).children(0).attr('data-custom')
259
        }
260
      }));
261
      make(function() {
262
        $search.val(people[0].split('').reverse().join(''));
263
      })
264
      assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
265
    })
266
267
  })
268
269
  describe('invert option', function() {
270
271
    it('Should invert results', function() {
272
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
273
        invert: true
274
      }));
275
      make(function() {
276
        $search.val(people[0]);
277
      })
278
      assert.lengthOf($content.children(':visible'), 3);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
279
    })
280
281
  })
282
283
  describe('callSearchManually option', function() {
284
285
    it('Should not call search on typing', function() {
286
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
287
        callSearchManually: true
288
      }));
289
      make(function() {
290
        $search.val(people[0]);
291
      })
292
      assert.lengthOf($content.children(':visible'), 5);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
293
    })
294
295
    it('Should call search by manual calling .search', function() {
296
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
297
        callSearchManually: true
298
      }));
299
      make(function() {
300
        $search.val(people[0]);
301
      })
302
      jet.search();
303
      assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
304
    })
305
306
    it('Should call search by manual calling .search with search phrase as attribute', function() {
307
      jet = new Jets(ext({
0 ignored issues
show
Bug introduced by
The variable Jets seems to be never declared. If this is a global, consider adding a /** global: Jets */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable jet seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.jet.
Loading history...
308
        callSearchManually: true
309
      }));
310
      jet.search(people[0]);
311
      assert.lengthOf($content.children(':visible'), 1);
0 ignored issues
show
Bug introduced by
The variable assert seems to be never declared. If this is a global, consider adding a /** global: assert */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
312
    })
313
314
  })
315
316
})