From cd03fe92a5dbd2aba516b64fc8067c5fba1e4a81 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 13 Apr 2010 14:25:12 -0700 Subject: checkbox widget fix --- test/widgetsSpec.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/widgetsSpec.js') diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index c64f03ca..04b8b1ec 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -6,9 +6,10 @@ describe("input widget", function(){ scope = null; element = null; var compiler = new Compiler(angularTextMarkup, angularAttrMarkup, angularDirective, angularWidget); - compile = function(html) { + compile = function(html, before) { element = jqLite(html); scope = compiler.compile(element)(element); + (before||noop)(); scope.$init(); }; }); @@ -51,6 +52,14 @@ describe("input widget", function(){ expect(scope.$get('list')).toEqual(['1', '2', '3']); }); + it("should process ng-format for booleans", function(){ + compile('', function(){ + scope.name = false; + }); + expect(scope.name).toEqual(false); + expect(scope.$element[0].checked).toEqual(false); + }); + it("should process ng-validation", function(){ compile(''); expect(element.hasClass('ng-validation-error')).toBeTruthy(); -- cgit v1.2.3