Permalink
Browse files

isEmpty test

  • Loading branch information...
1 parent 9e4b59e commit fe74d65f2b5d814a2c378394d4b8ec0efcfb45c5 @kpdecker kpdecker committed Apr 6, 2013
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/qunit_spec.js
View
15 spec/qunit_spec.js
@@ -1403,3 +1403,18 @@ test('GS-428: Nested if else rendering', function() {
shouldCompileTo(succeedingTemplate, [{}, helpers], ' Expected ');
shouldCompileTo(failingTemplate, [{}, helpers], ' Expected ');
});
+
+suite('Utils');
+
+test('isEmpty', function() {
+ equal(Handlebars.Utils.isEmpty(undefined), true);
+ equal(Handlebars.Utils.isEmpty(null), true);
+ equal(Handlebars.Utils.isEmpty(false), true);
+ equal(Handlebars.Utils.isEmpty(''), true);
+ equal(Handlebars.Utils.isEmpty([]), true);
+
+ equal(Handlebars.Utils.isEmpty(0), false);
+ equal(Handlebars.Utils.isEmpty([1]), false);
+ equal(Handlebars.Utils.isEmpty('foo'), false);
+ equal(Handlebars.Utils.isEmpty({bar: 1}), false);
+});

0 comments on commit fe74d65

Please sign in to comment.