summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-11-21 12:49:26 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-11-21 12:57:03 +0100
commit6d3e829821707095269590f8a880f88d1cf8c980 (patch)
tree4f49c314b4602faed9909daf6e904da64cdd2479 /js/tests
parent1ef00530bd5eab6688b297197b775d3d6289fa6f (diff)
hide categories without elements
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/controller/ExploreControllerSpec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/tests/unit/controller/ExploreControllerSpec.js b/js/tests/unit/controller/ExploreControllerSpec.js
index a323e8d65..977ab5c32 100644
--- a/js/tests/unit/controller/ExploreControllerSpec.js
+++ b/js/tests/unit/controller/ExploreControllerSpec.js
@@ -60,4 +60,15 @@ describe('ExploreController', function () {
expect(controller.feedExists('amen')).toBe(false);
}));
+
+ it('should hide categories without unadded sites', inject(
+ function (FeedResource) {
+ FeedResource.add({id: 3, url: 'test'});
+
+ var data1 = [{url: 'test'}, {url: 'test2'}];
+ var data2 = [{url: 'test'}];
+
+ expect(controller.isCategoryShown(data1)).toBe(true);
+ expect(controller.isCategoryShown(data2)).toBe(false);
+ }));
}); \ No newline at end of file