fix qunit search suggestion tests
This commit is contained in:
Родитель
9f12d6c00f
Коммит
e9dd5d9c21
|
@ -80,7 +80,7 @@ test('Default search label', function() {
|
|||
$results = this.results,
|
||||
$input = this.input;
|
||||
function check(cat, expected) {
|
||||
$('input[name=cat]', $sandbox).val(cat);
|
||||
$results.attr('data-cat', cat);
|
||||
$.when($input.searchSuggestions($results)).done(function() {
|
||||
equal($results.find('p a.sel').text(), expected);
|
||||
});
|
||||
|
@ -164,7 +164,8 @@ asyncTest('Cached results do not change', function() {
|
|||
return z._AjaxCache;
|
||||
}).thenDo(function() {
|
||||
var cache = z.AjaxCache(self.url + ':get'),
|
||||
args = JSON.stringify(self.sandbox.find('form').serialize());
|
||||
fields = self.sandbox.find('form').serialize(),
|
||||
args = JSON.stringify(fields + '&cat=' + $results.attr('data-cat'));
|
||||
tests.equalObjects(cache.items[args], items);
|
||||
tests.equalObjects(cache.previous.data, items);
|
||||
equal(cache.previous.args, args);
|
||||
|
|
|
@ -196,8 +196,7 @@
|
|||
<form id="search" action="/en-us/firefox/search/">
|
||||
<input id="search-q" type="text" name="q" required autocomplete="off" title=""
|
||||
class="text placeholder" placeholder="search for add-ons" value="">
|
||||
<input type="hidden" name="cat" value="all" id="id_cat">
|
||||
<div id="site-search-suggestions" data-src="/askjeeves"></div>
|
||||
<div id="site-search-suggestions" data-src="/askjeeves" data-cat="all"></div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче