Skip to content

Commit

Permalink
fix: use jump_to as event name (#46)
Browse files Browse the repository at this point in the history
* fix: use jump_to as event name

* fix: tests
  • Loading branch information
polvalente authored Nov 19, 2022
1 parent b4dbd91 commit 935bc2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/kino/maplibre.ex
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ defmodule Kino.MapLibre do
end

def handle_cast({:jumps, jump}, ctx) do
broadcast_event(ctx, "jumps", jump)
broadcast_event(ctx, "jump_to", jump)
ctx = update_assigned_events(ctx, :jumps, jump)
{:noreply, ctx}
end
Expand Down
4 changes: 2 additions & 2 deletions test/kino/maplibre_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ defmodule Kino.MapLibreTest do
data = connect(ml)

assert data.events.jumps == [%{location: {0, 0}, options: %{"zoom" => 6}}]
assert_broadcast_event(ml, "jumps", %{location: {0, 0}, options: %{"zoom" => 6}})
assert_broadcast_event(ml, "jump_to", %{location: {0, 0}, options: %{"zoom" => 6}})
end

test "adds a jump effect to a converted map" do
Expand All @@ -357,7 +357,7 @@ defmodule Kino.MapLibreTest do
%{location: {0, 0}, options: %{}}
]

assert_broadcast_event(ml, "jumps", %{location: {-40, 20}, options: %{"zoom" => 6}})
assert_broadcast_event(ml, "jump_to", %{location: {-40, 20}, options: %{"zoom" => 6}})
end
end
end

0 comments on commit 935bc2b

Please sign in to comment.