Files
self c1f4339dde refactor: move Aether into TribeOne plugin namespace
Use TribeOne.TribesPlugin.Aether modules throughout the plugin and expose chat@1 from the entry module for capability-based consumers.
2026-05-26 01:13:28 +02:00

45 lines
1.4 KiB
Elixir

defmodule TribeOne.TribesPlugin.Aether.TimelinePageTest do
use Tribes.PluginTest.PageCase, plugin: TribeOne.TribesPlugin.Aether.Plugin
test "renders the timeline for signed-out visitors", %{conn: conn} do
{:ok, _view, html} = live(conn, "/aether")
assert html =~ "Aether"
assert html =~ "Sign in to publish notes from your local identity."
end
test "renders the posting form for signed-in users", %{signed_in_conn: conn, current_user: user} do
{:ok, view, _html} = live(conn, "/aether")
assert has_element?(view, "#note-form")
assert has_element?(view, "#post-note-button", "Post note")
assert is_binary(user.username)
end
test "handles batched Parrhesia note events", %{signed_in_conn: conn, current_user: user} do
{:ok, view, _html} = live(conn, "/aether")
send(view.pid, {:parrhesia, :events, make_ref(), "aether", [note_event(user.pubkey_hex)]})
assert render(view) =~ "Streamed batch note"
end
test "dispatches top-level subpaths to the timeline page", %{conn: conn} do
{:ok, _view, html} = live(conn, "/aether/tribe-123")
assert html =~ "Aether"
end
defp note_event(pubkey) do
%{
"id" => "batch-note-#{System.unique_integer([:positive])}",
"pubkey" => pubkey,
"created_at" => 1_777_237_381,
"kind" => 1,
"tags" => [],
"content" => "Streamed batch note",
"sig" => "test-signature"
}
end
end