Skip to content

Commit

Permalink
Add Kino.Test.push_smart_cell_editor_source/2 to test editor changes (#…
Browse files Browse the repository at this point in the history
…468)

Co-authored-by: Jonatan Kłosko <[email protected]>
  • Loading branch information
mruoss and jonatanklosko authored Sep 5, 2024
1 parent a3ed376 commit e1c3713
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/kino/test.ex
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,19 @@ defmodule Kino.Test do
unquote(timeout)
end
end

@doc """
Sends a changed smart cell editor source to a `Kino.JS.Live` kino.
This is going to call `c:Kino.SmartCell.handle_editor_change/2` implementation
in the smart cell module.
## Examples
push_smart_cell_editor_source(kino, "source code")
"""
def push_smart_cell_editor_source(kino, source) do
send(kino.pid, {:editor_source, source})
end
end

0 comments on commit e1c3713

Please sign in to comment.