From 6d3e829821707095269590f8a880f88d1cf8c980 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 21 Nov 2014 12:49:26 +0100 Subject: hide categories without elements --- js/tests/unit/controller/ExploreControllerSpec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js/tests/unit/controller/ExploreControllerSpec.js') 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 -- cgit v1.2.3