diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-09-21 07:16:09 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-09-21 07:16:09 +0200 |
commit | fa3e6ac59ce447c945064c3c75d05daa0cd72850 (patch) | |
tree | e41ae161be3de5854af10387a5487e1644706ed9 /js | |
parent | 4865cb2a5855a28fe7fefdbca9620075ece7e6c6 (diff) |
Don't display zero if no contact in groups
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'js')
-rw-r--r-- | js/filters/counterFormatter_filter.js | 3 | ||||
-rw-r--r-- | js/tests/filters/counterFormatter_filter.js | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/js/filters/counterFormatter_filter.js b/js/filters/counterFormatter_filter.js index a7340265..aa91b6e6 100644 --- a/js/filters/counterFormatter_filter.js +++ b/js/filters/counterFormatter_filter.js @@ -6,6 +6,9 @@ angular.module('contactsApp') if (count > 999) { return '999+'; } + if (count === 0) { + return ''; + } return count; }; }); diff --git a/js/tests/filters/counterFormatter_filter.js b/js/tests/filters/counterFormatter_filter.js index f9cc490f..40a84964 100644 --- a/js/tests/filters/counterFormatter_filter.js +++ b/js/tests/filters/counterFormatter_filter.js @@ -13,7 +13,7 @@ describe('counterFormatter filter', function() { var counterFormatter = $filter('counterFormatter'); expect(counterFormatter(Number.NaN)).to.be.Nan; expect(counterFormatter(15)).to.equal(15); - expect(counterFormatter(0)).to.equal(0); + expect(counterFormatter(0)).to.equal(''); expect(counterFormatter(-5)).to.equal(-5); expect(counterFormatter(999)).to.equal(999); expect(counterFormatter(1000)).to.equal('999+'); |