Sha256: db1591c630f2b3ce9123869edf9d46f058b98a8287626c1126756b7c2f3ea588

Contents?: true

Size: 837 Bytes

Versions: 24

Compression:

Stored size: 837 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

24 entries across 24 versions & 1 rubygems

Version Path
sproutcore-0.9.10 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.11 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.1 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.12 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.0 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.14 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.13 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.15 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.17 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.16 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.19 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.18 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.2 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.23 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.21 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.22 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.20 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.5 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.3 frameworks/sproutcore/tests/views/text_field.rhtml
sproutcore-0.9.4 frameworks/sproutcore/tests/views/text_field.rhtml