Sha256: 65021e991b27d932cb2baf921de2d00e45283032d0c3c254192f831d7a34dbf8

Contents?: true

Size: 867 Bytes

Versions: 8

Compression:

Stored size: 867 Bytes

Contents

<% content_for('final') do %>
<script>

Test.context("A SC.TextFieldView", {
  
  "Should allow text navigation keys when focused": function()
  {
    this.field.becomeFirstResponder();
    this.field.get('isFirstResponder').shouldEqual(true);
    
    var keynames = $w('backspace delete home end left right up down');
    for (var i=0, n=keynames.length; i < n; i++)
    {
      // var event = SC.Mock.KeyEvent.create({ 
      //         type: 'keydown', 
      //         keyCode: SC.KEY_CODES[ keynames[i] ] 
      //       });
      SC.window._onkeydown(event).shouldEqual(true);
      event.stopped.shouldEqual(false);
    }
  },

  setup: function()
  {
    this.field = SC.TextFieldView.create();
    SC.window.appendChild(this.field);
  },
  teardown: function()
  {
    SC.window.removeChild(this.field);
    delete this.field;
  }

});

</script>
<% end %>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090408130025 frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml
sproutit-sproutcore-1.0.0.20090416161445 frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml
sproutit-sproutcore-1.0.0.20090720093355 frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml
sproutit-sproutcore-1.0.0.20090720202429 frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml
sproutit-sproutcore-1.0.0.20090721125122 frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml
sproutit-sproutcore-1.0.126 frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml
sproutit-sproutcore-1.0.20090721145251 frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml
sproutit-sproutcore-1.0.203 frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml