Sha256: c26ff1873ece34d882039480064ed4db3e3f2927bee525963180897442e33883

Contents?: true

Size: 788 Bytes

Versions: 4

Compression:

Stored size: 788 Bytes

Contents

(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");
  });
})();

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
spade-0.0.1 sproutcore/frameworks/core_foundation/tests/views/template/checkbox_support.js
sproutcore-1.5.0.pre.5 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/checkbox_support.js
sproutcore-1.5.0.pre.4.1 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/checkbox_support.js
sproutcore-1.5.0.pre.4 lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/checkbox_support.js