Skip to content

Commit c93e4ee

Browse files
Fix dispatch_event rpc name.
1 parent 9e9500a commit c93e4ee

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/live/element.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def remove(selector, **options)
145145
end
146146

147147
def dispatch_event(selector, type, **options)
148-
rpc(:dispatch_event, selector, type, options)
148+
rpc(:dispatchEvent, selector, type, options)
149149
end
150150

151151
# Render the element.

test/live/element.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@
169169
end
170170

171171
with "#dispatch_event" do
172-
it "enqueues a dispatch_event RPC with correct type" do
172+
it "enqueues a dispatchEvent RPC with correct type" do
173173
element.dispatch_event("#my-element", "click")
174174

175175
args = page.enqueued.last
176-
expect(args[0]).to be == :dispatch_event
176+
expect(args[0]).to be == :dispatchEvent
177177
expect(args[1]).to be == "#my-element"
178178
expect(args[2]).to be == "click"
179179
end
@@ -182,7 +182,7 @@
182182
element.dispatch_event("[data-id=\"test\"]", "gametick", detail: {score: 42}, bubbles: true)
183183

184184
args = page.enqueued.last
185-
expect(args[0]).to be == :dispatch_event
185+
expect(args[0]).to be == :dispatchEvent
186186
expect(args[1]).to be == "[data-id=\"test\"]"
187187
expect(args[2]).to be == "gametick"
188188
expect(args[3]).to be == {detail: {score: 42}, bubbles: true}

0 commit comments

Comments
 (0)