Sha256: 8188af861052d36feb60556050886acd66bb7ad876050930b55d292e4bc1520c
Contents?: true
Size: 1.77 KB
Versions: 32
Compression:
Stored size: 1.77 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Strobe Inc. and contributors. // ©2008-2011 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ========================================================================== (function() { var checkboxView, pane; module("Checkbox Support", { setup: function() { checkboxView = SC.TemplateView.create(SC.CheckboxSupport, { template: SC.Handlebars.compile('<input type="checkbox">') }); pane = SC.MainPane.create({ childViews: [checkboxView] }); pane.append(); }, teardown: function() { pane.remove(); } }); test("value property mirrors input value", function() { checkboxView.$('input').attr('checked', true); equals(checkboxView.get('value'), true, "gets value property from DOM"); checkboxView.$('input').attr('checked', false); checkboxView.set('value', true); ok(checkboxView.$('input').attr("checked"), "sets value of DOM to value property"); }); module("SC.Checkbox", { setup: function() { checkboxView = SC.Checkbox.create({}); pane = SC.MainPane.create({ childViews: [checkboxView] }); pane.append(); }, teardown: function() { pane.remove(); } }); test("value property mirrors input value", function() { checkboxView.$('input').attr('checked', true); equals(checkboxView.get('value'), true, "gets value property from DOM"); checkboxView.$('input').attr('checked', false); checkboxView.set('value', true); ok(checkboxView.$('input').attr("checked"), "sets value of DOM to value property"); }); })();
Version data entries
32 entries across 32 versions & 1 rubygems