Sha256: 95b82fe7b78ac5de746b1301d4057080dad1feb2458895514efa1822accef136
Contents?: true
Size: 1.77 KB
Versions: 4
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').is(":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').is(":checked"), "sets value of DOM to value property"); }); })();
Version data entries
4 entries across 4 versions & 1 rubygems