OLD | NEW |
1 /* | 1 /* |
2 This file is part of the Juju GUI, which lets users view and manage Juju | 2 This file is part of the Juju GUI, which lets users view and manage Juju |
3 environments within a graphical interface (https://launchpad.net/juju-gui). | 3 environments within a graphical interface (https://launchpad.net/juju-gui). |
4 Copyright (C) 2012-2013 Canonical Ltd. | 4 Copyright (C) 2012-2013 Canonical Ltd. |
5 | 5 |
6 This program is free software: you can redistribute it and/or modify it under | 6 This program is free software: you can redistribute it and/or modify it under |
7 the terms of the GNU Affero General Public License version 3, as published by | 7 the terms of the GNU Affero General Public License version 3, as published by |
8 the Free Software Foundation. | 8 the Free Software Foundation. |
9 | 9 |
10 This program is distributed in the hope that it will be useful, but WITHOUT | 10 This program is distributed in the hope that it will be useful, but WITHOUT |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 it('tells listeners the cache has updated', function() { | 280 it('tells listeners the cache has updated', function() { |
281 view.on(view.EV_CACHE_UPDATED, function(ev) { | 281 view.on(view.EV_CACHE_UPDATED, function(ev) { |
282 assert.isObject(ev.cache); | 282 assert.isObject(ev.cache); |
283 }); | 283 }); |
284 view.render(); | 284 view.render(); |
285 }); | 285 }); |
286 | 286 |
287 it('uses passed in cache data if available', function() { | 287 it('uses passed in cache data if available', function() { |
288 var search_called = false, | 288 var search_called = false, |
289 results = { | 289 results = { |
290 recommended: new Y.juju.models.BrowserCharmList(), | 290 recommended: new Y.juju.models.CharmList(), |
291 more: new Y.juju.models.BrowserCharmList() | 291 more: new Y.juju.models.CharmList() |
292 }; | 292 }; |
293 | 293 |
294 view.get('store').search = function() { | 294 view.get('store').search = function() { |
295 search_called = true; | 295 search_called = true; |
296 return results; | 296 return results; |
297 }; | 297 }; |
298 view.render(results); | 298 view.render(results); |
299 assert.isFalse(search_called); | 299 assert.isFalse(search_called); |
300 | 300 |
301 view.render(); | 301 view.render(); |
302 assert.isTrue(search_called); | 302 assert.isTrue(search_called); |
303 }); | 303 }); |
304 }); | 304 }); |
OLD | NEW |