Sha256: c20e67d3cf9b2bfb6deee06ca57d9e9f1a8a1758b0fcf3ea3e71ff3b8bedad32

Contents?: true

Size: 1.07 KB

Versions: 31

Compression:

Stored size: 1.07 KB

Contents

require "spec_helper"

describe React::Event do
  it "should bridge attributes of native SyntheticEvent (see http://facebook.github.io/react/docs/events.html#syntheticevent)" do
    element = React.create_element('div').on(:click) do |event|
      expect(event.bubbles).to eq(`#{event.to_n}.bubbles`)
      expect(event.cancelable).to eq(`#{event.to_n}.cancelable`)
      expect(event.current_target).to eq(`#{event.to_n}.currentTarget`)
      expect(event.default_prevented).to eq(`#{event.to_n}.defaultPrevented`)
      expect(event.event_phase).to eq(`#{event.to_n}.eventPhase`)
      expect(event.is_trusted?).to eq(`#{event.to_n}.isTrusted`)
      expect(event.native_event).to eq(`#{event.to_n}.nativeEvent`)
      expect(event.target).to eq(`#{event.to_n}.target`)
      expect(event.timestamp).to eq(`#{event.to_n}.timeStamp`)
      expect(event.event_type).to eq(`#{event.to_n}.type`)
      expect(event).to respond_to(:prevent_default)
      expect(event).to respond_to(:stop_propagation)
    end
    instance = renderElementToDocument(element)
    simulateEvent(:click, instance)
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
reactive-ruby-0.7.28 opal-spec/event_spec.rb
reactive-ruby-0.7.27 opal-spec/event_spec.rb
reactive-ruby-0.7.26 opal-spec/event_spec.rb
reactive-ruby-0.7.25 opal-spec/event_spec.rb
reactive-ruby-0.7.24 opal-spec/event_spec.rb
reactive-ruby-0.7.23 opal-spec/event_spec.rb
reactive-ruby-0.7.22 spec/event_spec.rb
reactive-ruby-0.7.21 spec/event_spec.rb
reactive-ruby-0.7.20 spec/event_spec.rb
reactive-ruby-0.7.19 spec/event_spec.rb
reactive-ruby-0.7.18 spec/event_spec.rb
reactive-ruby-0.7.17 spec/event_spec.rb
reactive-ruby-0.7.16 spec/event_spec.rb
reactive-ruby-0.7.15 spec/event_spec.rb
reactive-ruby-0.7.14 spec/event_spec.rb
reactive-ruby-0.7.13 spec/event_spec.rb
reactive-ruby-0.7.12 spec/event_spec.rb
reactive-ruby-0.7.11 spec/event_spec.rb
reactive-ruby-0.7.10 spec/event_spec.rb
reactive-ruby-0.7.8 spec/event_spec.rb